Created
January 3, 2019 15:52
-
-
Save IshanFx/ea08bc494a3f9a0d90ca87a1ca3d93fc to your computer and use it in GitHub Desktop.
Hero Animation first page
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'Second.dart'; | |
void main() => runApp(FlutterAni()); | |
class FlutterAni extends StatelessWidget{ | |
@override | |
Widget build(BuildContext context) { | |
// TODO: implement build | |
return MaterialApp( | |
title: 'Flutter Screen Animation', | |
theme: ThemeData( | |
primarySwatch: Colors.blue | |
), | |
home: FirstScreen(), | |
); | |
} | |
} | |
class FirstScreen extends StatelessWidget{ | |
@override | |
Widget build(BuildContext context) { | |
// TODO: implement build | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Screen Animation"), | |
), | |
body: Center( | |
child: Container( | |
width: 100, | |
child: Hero( | |
tag: "mainImage", | |
child: GestureDetector( | |
child: Image.network("https://matwrites.com/wp-content/uploads/2018/03/Flutter.png"), | |
onTap: (){ | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => Second())); | |
}, | |
), | |
), | |
), | |
), | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment