Skip to content

Instantly share code, notes, and snippets.

@IshanFx
Created January 3, 2019 15:52
Show Gist options
  • Save IshanFx/ea08bc494a3f9a0d90ca87a1ca3d93fc to your computer and use it in GitHub Desktop.
Save IshanFx/ea08bc494a3f9a0d90ca87a1ca3d93fc to your computer and use it in GitHub Desktop.
Hero Animation first page
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