diff --git a/lib/screens/home_page.dart b/lib/screens/home_page.dart index 513c152..e584c20 100644 --- a/lib/screens/home_page.dart +++ b/lib/screens/home_page.dart @@ -199,6 +199,7 @@ class _HomePageState extends State { height: MediaQuery.of(context).size.height * 0.4 - 30, width: double.infinity, child: ListView.builder( + physics: BouncingScrollPhysics(), scrollDirection: Axis.horizontal, itemCount: ProductList().product.length, itemBuilder: (context, index) { @@ -279,9 +280,12 @@ class _HomePageState extends State { ), SizedBox( height: 200, - child: Image.asset( - data.image, - scale: 0.2, + child: Hero( + tag: data.name, + child: Image.asset( + data.image, + scale: 0.2, + ), ), ), ], diff --git a/lib/screens/product_page.dart b/lib/screens/product_page.dart index dc52668..2e4c6d6 100644 --- a/lib/screens/product_page.dart +++ b/lib/screens/product_page.dart @@ -32,7 +32,7 @@ class _ProductPageState extends State { Colors.deepPurple, Colors.pink ]; - int selectedphoto = 0; + int selectedphoto = 0; List images = [ 'assets/product/shoe_thumb_1.png', 'assets/product/shoe_thumb_3.png', @@ -141,7 +141,9 @@ class _ProductPageState extends State { SizedBox( height: 250, width: double.infinity, - child: Image.asset(selectedphotoname), + child: Hero( + tag: data.image, + child: Image.asset(selectedphotoname)), ), ], ), @@ -361,9 +363,7 @@ class _ProductPageState extends State { width: 2)), child: Container( decoration: BoxDecoration( - color: index == selectedcolor - ? MyColors().mainColor - : data, + color: data, borderRadius: BorderRadius.circular(40)), child: index == selectedcolor