This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Animation _animation = Tween(begin: 0.0, end: 1.0).animate(type_of_animation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Animation transformAnimation = BorderRadiusTween( | |
begin: BorderRadius.circular(125.0), | |
end: BorderRadius.circular(0.0).animate(type_of_animation); | |
/////////////// OR /////////////// | |
Animation transformAnimation = Tween<BorderRadius>( | |
begin: BorderRadius.circular(125.0), | |
end: BorderRadius.circular(0.0).animate(type_of_animation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimationController _animationController = | |
AnimationController(vsync: this, duration: Duration(seconds: 1)); | |
Animation _animation = Tween(begin: 0.0, end: -0.15).animate( | |
CurvedAnimation(curve: Curves.ease, parent: _animationController)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Draggable( | |
data: 'Flutter', | |
child: FlutterLogo( | |
size: 100.0, | |
), | |
feedback: FlutterLogo( | |
size: 100.0, | |
), | |
childWhenDragging: Container(), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DragTarget( | |
builder: (context, List<String> candidateData, rejectedData) { | |
return Center( | |
child: isSuccessful | |
? Padding( | |
padding: EdgeInsets.only(top: 100.0), | |
child: Container( | |
color: Colors.yellow, | |
height: 200.0, | |
width: 200.0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Drag and Drop Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData(primarySwatch: Colors.green), | |
routes: <String, WidgetBuilder>{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Color GRAY_COLOR = Colors.grey; | |
const Color BROWN_COLOR = Colors.brown; | |
const Color RED_COLOR = Colors.red; | |
const Color ORANGE_COLOR = Colors.orange; | |
const Color BLUE_COLOR = Colors.blue; | |
const Color GREEN_COLOR = Colors.green; | |
const Color WHITE_COLOR = Colors.white; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const String APP_BAR_TITLE = 'Drag & Drop Demo'; | |
const String NO_ITEMS_LEFT = 'No Items Left'; | |
const String JAVA = 'Java'; | |
const String PHP = 'PHP'; | |
const String KOTLIN = 'Kotlin'; | |
const String FLUTTER = 'Flutter'; | |
const String NODEJS = 'Nodejs'; | |
const DROP_ITEMS_HERE = 'Drop Items Here'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CardItem { | |
String content; | |
Color cardColor; | |
double margin; | |
CardItem({this.content, this.cardColor, this.margin}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Constants{ | |
static String SPLASH_SCREEN='SPLASH_SCREEN'; | |
static String HOME_SCREEN='HOME_SCREEN'; | |
static List<CardItem> initializeList(List<CardItem> itemList){ | |
itemList = [ | |
CardItem(content: JAVA, cardColor: BROWN_COLOR), | |
CardItem(content: PHP, cardColor: RED_COLOR), |