diff --git a/README.md b/README.md index ddfd697d..f144d0e2 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ The code for Springy Widget is taken and refactored from (https://github.com/mat ## Ecommerce - + ## User Flow Screens diff --git a/assets/fooditem/plate1.jpg b/assets/fooditem/plate1.jpg new file mode 100644 index 00000000..d4241526 Binary files /dev/null and b/assets/fooditem/plate1.jpg differ diff --git a/assets/fooditem/plate2.jpg b/assets/fooditem/plate2.jpg new file mode 100644 index 00000000..97c6af3f Binary files /dev/null and b/assets/fooditem/plate2.jpg differ diff --git a/assets/fooditem/plate3.jpg b/assets/fooditem/plate3.jpg new file mode 100644 index 00000000..0c4292d7 Binary files /dev/null and b/assets/fooditem/plate3.jpg differ diff --git a/assets/fooditem/plate4.jpg b/assets/fooditem/plate4.jpg new file mode 100644 index 00000000..c540993d Binary files /dev/null and b/assets/fooditem/plate4.jpg differ diff --git a/lib/core/presentation/routes.dart b/lib/core/presentation/routes.dart index e6e18ecc..906dc6e5 100644 --- a/lib/core/presentation/routes.dart +++ b/lib/core/presentation/routes.dart @@ -76,6 +76,7 @@ import 'package:flutter_ui_challenges/src/pages/dialogs/dialogs.dart'; import 'package:flutter_ui_challenges/src/pages/todo/todo_home2.dart'; import 'package:flutter_ui_challenges/src/pages/todo/todo_home1.dart'; import 'package:flutter_ui_challenges/src/pages/ecommerce/cart1.dart'; +import 'package:flutter_ui_challenges/src/pages/ecommerce/cart3.dart'; import 'package:flutter_ui_challenges/src/pages/profile/profile3.dart'; import 'package:flutter_ui_challenges/src/pages/profile/profile2.dart'; import 'package:flutter_ui_challenges/src/pages/profile/profile1.dart'; @@ -193,6 +194,7 @@ final List pages = [ path: InvitationPageOne.path), ]), MenuItem(title: "Ecommerce", icon: Icons.shopping_basket, items: [ + SubMenuItem("Cart Three", CartThreePage(), path: CartThreePage.path), SubMenuItem("Cart Two", CartTwoPage(), path: CartTwoPage.path), SubMenuItem("Ecommerce Four", EcommerceFourPage(), path: EcommerceFourPage.path), diff --git a/lib/src/pages/ecommerce/cart3.dart b/lib/src/pages/ecommerce/cart3.dart new file mode 100644 index 00000000..1f835ab1 --- /dev/null +++ b/lib/src/pages/ecommerce/cart3.dart @@ -0,0 +1,199 @@ +import 'package:flutter/material.dart'; + +/** + * Author: Aparna Dulal + * profile: https://github.com/ambikadulal + */ + +class CartThreePage extends StatefulWidget { + static final String path = "lib/src/pages/ecommerece/cart3.dart"; + + @override + _CartThreePageState createState() => _CartThreePageState(); +} + +class _CartThreePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color(0xFF21BFBD), + body: ListView( + children: [ + Padding( + padding: EdgeInsets.only(top: 15.0, left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.white, + onPressed: () {}, + ), + Container( + width: 125.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + icon: Icon(Icons.filter_list), + color: Colors.white, + onPressed: () {}, + ), + IconButton( + icon: Icon(Icons.menu), + color: Colors.white, + onPressed: () {}, + ) + ], + )) + ], + ), + ), + SizedBox(height: 25.0), + Padding( + padding: EdgeInsets.only(left: 40.0), + child: Row( + children: [ + Text('Delicious', + style: TextStyle( + fontFamily: 'Montserrat', + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 25.0)), + SizedBox(width: 10.0), + Text('Food', + style: TextStyle( + fontFamily: 'Montserrat', + color: Colors.white, + fontSize: 25.0)) + ], + ), + ), + SizedBox(height: 40.0), + Container( + height: MediaQuery.of(context).size.height - 185.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(75.0)), + ), + child: ListView( + primary: false, + padding: EdgeInsets.only(left: 25.0, right: 20.0), + children: [ + Padding( + padding: EdgeInsets.only(top: 45.0), + child: Container( + height: MediaQuery.of(context).size.height - 300.0, + child: ListView(children: [ + _buildFoodItem('assets/fooditem/plate1.jpg', + 'Salmon bowl', '\$25.00'), + _buildFoodItem('assets/fooditem/plate2.jpg', + 'Spring bowl', '\$20.00'), + _buildFoodItem('assets/fooditem/plate3.jpg', + 'Avocado bowl', '\$26.00'), + _buildFoodItem('assets/fooditem/plate4.jpg', + 'Berry bowl', '\$14.00') + ]))), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + height: 65.0, + width: 60.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0), + borderRadius: BorderRadius.circular(10.0), + ), + child: Center( + child: Icon(Icons.search, color: Colors.black), + ), + ), + Container( + height: 65.0, + width: 60.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0), + borderRadius: BorderRadius.circular(10.0), + ), + child: Center( + child: Icon(Icons.shopping_basket, color: Colors.black), + ), + ), + Container( + height: 65.0, + width: 120.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0), + borderRadius: BorderRadius.circular(10.0), + color: Color(0xFF1C1428)), + child: Center( + child: Text('Checkout', + style: TextStyle( + fontFamily: 'Montserrat', + color: Colors.white, + fontSize: 15.0))), + ) + ], + ) + ], + ), + ) + ], + ), + ); + } + + Widget _buildFoodItem(String imgPath, String foodName, String price) { + return Padding( + padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0), + child: InkWell( + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + //builder: + )); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + child: Row(children: [ + Hero( + tag: imgPath, + child: Image( + image: AssetImage(imgPath), + fit: BoxFit.cover, + height: 75.0, + width: 75.0)), + SizedBox(width: 10.0), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(foodName, + style: TextStyle( + fontFamily: 'Montserrat', + fontSize: 17.0, + fontWeight: FontWeight.bold)), + Text(price, + style: TextStyle( + fontFamily: 'Montserrat', + fontSize: 15.0, + color: Colors.grey)) + ]) + ])), + IconButton( + icon: Icon(Icons.add), + color: Colors.black, + onPressed: () {}) + ], + ))); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 8f1fe286..9bc1f00e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,6 +57,7 @@ flutter: - assets/smwallet/ - assets/hotel/ - assets/icon/ + - assets/fooditem/ - assets/flare/ - lib/src/pages/animations/ - lib/src/pages/animations/animation1/ diff --git a/screenshots/cart3.jpg b/screenshots/cart3.jpg new file mode 100644 index 00000000..f9cdeda2 Binary files /dev/null and b/screenshots/cart3.jpg differ