flick 2.0.0 flick: ^2.0.0 copied to clipboard
An extensive flick tool/widget for Flutter that allows very flexible flick management for your widgets.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// © Cosmos Software | Ali Yigit Bireroglu /
// All material used in the making of this code, project, program, application, software et cetera (the "Intellectual Property") /
// belongs completely and solely to Ali Yigit Bireroglu. This includes but is not limited to the source code, the multimedia and /
// other asset files. If you were granted this Intellectual Property for personal use, you are obligated to include this copyright /
// text at all times. /
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//@formatter:off
import 'package:flutter/material.dart';
import 'package:flick/flick.dart';
GlobalKey view = GlobalKey();
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flick Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: MyHomePage(title: 'Flick Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, this.title}) : super(key: key);
final String? title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Widget box() {
return Container(
key: view,
width: 200,
height: 200,
color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.all(5),
child: Container(
constraints: BoxConstraints.expand(),
decoration: const BoxDecoration(
color: Colors.redAccent,
borderRadius: const BorderRadius.all(const Radius.circular(10.0)),
),
child: Center(
child: Text(
"Flick",
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 25,
),
textAlign: TextAlign.center,
),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(widget.title!)),
body: FlickController(
box(),
true,
view,
sensitivity: 0.1,
),
);
}
}