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; | |
Animation<double> animation; | |
@override | |
void initState() { | |
super.initState(); | |
_setupAnimation(); | |
} | |
_setupAnimation() { |
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
@override | |
void dispose() { | |
animationController.dispose(); | |
super.dispose(); | |
} |
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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Center( | |
child: AnimatedBuilder( | |
animation: animation, | |
child: Image( | |
image: AssetImage('assets/don.png'), | |
), | |
builder: (context, child) => 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
class TransitionPage extends StatelessWidget { | |
@override | |
build(BuildContext context) { | |
return Scaffold( | |
body: GestureDetector( | |
child: Hero( | |
child: Center( | |
child: Container( | |
child: Image( | |
image: AssetImage('assets/mountain.png'), |
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 TransitionDetailPage extends StatelessWidget { | |
@override | |
build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Transition Detail"), | |
), | |
body: Container( | |
child: Hero( | |
child: Image( |
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
@override | |
Widget build(BuildContext context) { | |
final size = MediaQuery.of(context).size; | |
return GestureDetector( | |
onPanDown: (details) { | |
_controller.stop(); | |
}, | |
onPanUpdate: (details) { | |
setState(() { | |
_dragAlignment += Alignment( |
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 DraggableCard extends StatefulWidget { | |
final Widget child; | |
final Alignment originAlignment; | |
DraggableCard({this.child, this.originAlignment}); | |
@override | |
_DraggableCardState createState() => _DraggableCardState(); | |
} | |
class _DraggableCardState extends State<DraggableCard> |
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 DraggableAnimationPage extends StatelessWidget { | |
@override | |
build(BuildContext context) { | |
return Align( | |
child: DraggableCard( | |
child: | |
Image(image: AssetImage('assets/don.png'), width: 100, height: 100), | |
originAlignment: Alignment.centerRight, | |
), | |
alignment: Alignment.centerRight, |
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
// onTap | |
String code = node1Controller.text + | |
node2Controller.text + | |
node3Controller.text + | |
node4Controller.text; | |
_showAlertDialog("SMS CODE", code); | |
// alert function | |
_showAlertDialog(String title, String message) { |