diff --git a/lib/screens/home_screens/home_screen.dart b/lib/screens/home_screens/home_screen.dart index 3412cac1e91ea4a90e8ee67337bcc4b7ab5b971c..ea35e9f19d247345acdf2424083d8fd5b18bd5ac 100644 --- a/lib/screens/home_screens/home_screen.dart +++ b/lib/screens/home_screens/home_screen.dart @@ -1,36 +1,151 @@ import 'package:flutter/material.dart'; class HomeScreen extends StatelessWidget { + Widget singleProducts() { + return Container( + margin: EdgeInsets.symmetric( + horizontal: 5, + ), + height: 230, + width: 160, + decoration: BoxDecoration( + color: Color(0xffd9dad9), + borderRadius: BorderRadius.circular(10), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 2, + child: Image.network( + 'https://pngimg.com/uploads/spinach/spinach_PNG10.png'), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 5, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Fresh Basil', + style: TextStyle( + color: Colors.black, fontWeight: FontWeight.bold), + ), + Text( + '50\$/50 Gram', + style: TextStyle( + color: Colors.grey, fontWeight: FontWeight.bold), + ), + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 5), + height: 20, + width: 50, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Expanded( + child: Text( + '50 Gram', + style: TextStyle(fontSize: 10), + ), + ), + Center( + child: Icon( + Icons.arrow_drop_down, + size: 20, + color: Colors.yellow, + ), + ) + ], + ), + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: Container( + height: 20, + width: 50, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.remove, + size: 15, + color: Color(0xffd0b84c), + ), + Text( + '1', + style: TextStyle( + color: Color(0xffd0b84c), + fontWeight: FontWeight.bold, + ), + ), + Icon( + Icons.add, + size: 15, + color: Color(0xffd0b84c), + ), + ], + ), + ), + ), + ], + ), + ], + )), + ), + ], + ), + ); + } + @override Widget build(BuildContext context) { return Scaffold( - drawer: Drawer(), - appBar: AppBar( - iconTheme: IconThemeData(color: Colors.black), - title: Text( - 'Home', - style: TextStyle(color: Colors.black, fontSize: 17), + backgroundColor: Color(0xffcbcbcb), + drawer: Drawer(), + appBar: AppBar( + iconTheme: IconThemeData(color: Colors.black), + title: Text( + 'Home', + style: TextStyle(color: Colors.black, fontSize: 17), + ), + actions: [ + CircleAvatar( + radius: 12, + backgroundColor: Color(0xffd4d181), + child: Icon(Icons.search, size: 18, color: Colors.black), ), - actions: [ - CircleAvatar( - radius: 12, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 5), + child: CircleAvatar( backgroundColor: Color(0xffd4d181), - child: Icon(Icons.search, size: 18, color: Colors.black), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 5), - child: CircleAvatar( - backgroundColor: Color(0xffd4d181), - radius: 12, - child: Icon(Icons.shop, size: 18, color: Colors.black), - ), + radius: 12, + child: Icon(Icons.shop, size: 18, color: Colors.black), ), - ], - backgroundColor: Color(0xffd6b738), - ), - body: Padding( - padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10), - child: Column(children: [ + ), + ], + backgroundColor: Color(0xffd6b738), + ), + body: Padding( + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10), + child: ListView( + children: [ Container( height: 150, decoration: BoxDecoration( @@ -45,12 +160,13 @@ class HomeScreen extends StatelessWidget { child: Row( children: [ Expanded( + flex: 2, child: Container( - child: Column( - children: [ - Padding( + child: ListView( + children: [ + Padding( padding: - const EdgeInsets.only(right: 120, bottom: 10), + const EdgeInsets.only(right: 130, bottom: 10), child: Container( height: 40, width: 100, @@ -76,17 +192,90 @@ class HomeScreen extends StatelessWidget { ), ), ), - )) - ], - )), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 20), + child: Text( + '30% Off', + style: TextStyle( + fontSize: 40, + color: Colors.green[100], + fontWeight: FontWeight.bold), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 20), + child: Text( + 'On all vegetable products', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ], + ), + ), ), Expanded( child: Container(), ), ], ), - ) - ]), - )); + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 5), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Herbs Seasonings'), + Text( + 'View All', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + singleProducts(), + singleProducts(), + singleProducts(), + singleProducts(), + singleProducts(), + ], + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 5), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Fresh Fruits'), + Text( + 'View All', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + singleProducts(), + singleProducts(), + singleProducts(), + singleProducts(), + singleProducts(), + ], + ), + ), + ], + ), + ), + ); } }