diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b4d5ca0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "hunger", + "request": "launch", + "type": "dart" + }, + { + "name": "hunger (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "hunger (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/assets/blackforest.png b/assets/blackforest.png new file mode 100644 index 0000000..4abf6eb Binary files /dev/null and b/assets/blackforest.png differ diff --git a/assets/cake-img.jpg b/assets/cake-img.jpg new file mode 100644 index 0000000..76bd2e2 Binary files /dev/null and b/assets/cake-img.jpg differ diff --git a/assets/cake1.jpeg b/assets/cake1.jpeg new file mode 100644 index 0000000..ed0e899 Binary files /dev/null and b/assets/cake1.jpeg differ diff --git a/assets/cake2.jpeg b/assets/cake2.jpeg new file mode 100644 index 0000000..692bd2b Binary files /dev/null and b/assets/cake2.jpeg differ diff --git a/assets/cake3.jpeg b/assets/cake3.jpeg new file mode 100644 index 0000000..f1e5004 Binary files /dev/null and b/assets/cake3.jpeg differ diff --git a/lib/app/core/app_config/app_colors.dart b/lib/app/core/app_config/app_colors.dart index e69de29..551cebb 100644 --- a/lib/app/core/app_config/app_colors.dart +++ b/lib/app/core/app_config/app_colors.dart @@ -0,0 +1,16 @@ +import 'package:flutter/material.dart'; + +class AppColors { + static const rustedOrange = Color(0xfff94700); + static const skyBlue = Color(0xff05d2e3); + static const white = Color(0xffffffff); + static const oliveGreen = Color(0xff44970f); + static const lightGrey = Color(0xffcac4cd); + static const grey = Color(0xffa1a1a1); + static const oliveGreenShade = Color(0xffccd890); + static const rupeeColor = Color(0xff007d1d); + static const rupeeBgColor = Color(0xff007d1d); + static const ratingColor = Color(0xffcf9e05); + static const linkTextColor = Color(0xff00315b); + static const blackColor = Color(0xff0a0a0a); +} diff --git a/lib/app/core/app_config/app_sizes.dart b/lib/app/core/app_config/app_sizes.dart index e69de29..f5a42a5 100644 --- a/lib/app/core/app_config/app_sizes.dart +++ b/lib/app/core/app_config/app_sizes.dart @@ -0,0 +1,23 @@ +class AppSizes { + static const x1_00 = 8.0; + static const x1_62 = 5; + static const x1_12 = 9.0; + static const x1_25 = 10.0; + static const x1_50 = 12.0; + static const x1_75 = 14.0; + static const x1_87 = 15.0; + static const x2_00 = 16.0; + static const x2_37 = 19.0; + static const x2_5 = 20.0; + static const x2_87 = 23.0; + static const x3_12 = 25.0; + static const x4_37 = 35.0; + static const x5_00 = 40.0; + static const x5_25 = 42.0; + static const x5_62 = 45.0; + static const x6_25 = 50.0; + static const x12_5 = 100.0; + static const x25_00 = 200.0; + static const x42_00 = 420.0; + static const x37_00 = 300.0; +} diff --git a/lib/app/modules/home/controllers/home_controller.dart b/lib/app/modules/home/controllers/home_controller.dart index 89aa44b..e7e99e0 100644 --- a/lib/app/modules/home/controllers/home_controller.dart +++ b/lib/app/modules/home/controllers/home_controller.dart @@ -1,20 +1,21 @@ import 'package:get/get.dart'; class HomeController extends GetxController { - //TODO: Implement HomeController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } +} + // @override +// void onInit() { +// super.onInit(); +// } - @override - void onReady() { - super.onReady(); - } +// @override +// void onReady() { +// super.onReady(); +// } + +// @override +// void onClose() {} +// void increment() => count.value++; +// } - @override - void onClose() {} - void increment() => count.value++; -} diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index fe86cb8..823a25e 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -5,14 +5,16 @@ import 'package:get/get.dart'; import '../controllers/home_controller.dart'; class HomeView extends GetView { + const HomeView({super.key}); + @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('HomeView'), + title: const Text('HomeView'), centerTitle: true, ), - body: Center( + body: const Center( child: Text( 'HomeView is working', style: TextStyle(fontSize: 20), diff --git a/lib/app/modules/login/bindings/login_binding.dart b/lib/app/modules/login/bindings/login_binding.dart deleted file mode 100644 index ac119f4..0000000 --- a/lib/app/modules/login/bindings/login_binding.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:get/get.dart'; - -import '../controllers/login_controller.dart'; - -class LoginBinding extends Bindings { - @override - void dependencies() { - Get.lazyPut( - () => LoginController(), - ); - } -} diff --git a/lib/app/modules/login/controllers/login_controller.dart b/lib/app/modules/login/controllers/login_controller.dart deleted file mode 100644 index 555e847..0000000 --- a/lib/app/modules/login/controllers/login_controller.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:get/get.dart'; - -class LoginController extends GetxController { - //TODO: Implement LoginController - - final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - - @override - void onReady() { - super.onReady(); - } - - @override - void onClose() {} - void increment() => count.value++; -} diff --git a/lib/app/modules/login/models/models.dart b/lib/app/modules/login/models/models.dart deleted file mode 100644 index e69de29..0000000 diff --git a/lib/app/modules/login/views/login_view.dart b/lib/app/modules/login/views/login_view.dart deleted file mode 100644 index 34f698d..0000000 --- a/lib/app/modules/login/views/login_view.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:get/get.dart'; - -import '../controllers/login_controller.dart'; - -class LoginView extends GetView { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('LoginView'), - centerTitle: true, - ), - body: Center( - child: Text( - 'LoginView is working', - style: TextStyle(fontSize: 20), - ), - ), - ); - } -} diff --git a/lib/app/modules/product_details/bindings/product_details_binding.dart b/lib/app/modules/product_details/bindings/product_details_binding.dart new file mode 100644 index 0000000..17aa9b5 --- /dev/null +++ b/lib/app/modules/product_details/bindings/product_details_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../controllers/product_details_controller.dart'; + +class ProductDetailsBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => ProductDetailsController(), + ); + } +} diff --git a/lib/app/modules/product_details/controllers/product_details_controller.dart b/lib/app/modules/product_details/controllers/product_details_controller.dart new file mode 100644 index 0000000..fbb1402 --- /dev/null +++ b/lib/app/modules/product_details/controllers/product_details_controller.dart @@ -0,0 +1,8 @@ +import 'package:get/get.dart'; + +class ProductDetailsController extends GetxController { + final favoriteClicked = false.obs; + final productAdded = 0.obs; + final productPrice = 0.obs; + final productCart = 0.obs; +} diff --git a/lib/app/modules/product_details/views/product_details_view.dart b/lib/app/modules/product_details/views/product_details_view.dart new file mode 100644 index 0000000..5d3f3a8 --- /dev/null +++ b/lib/app/modules/product_details/views/product_details_view.dart @@ -0,0 +1,480 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:get/get_state_manager/get_state_manager.dart'; +import 'package:hunger/app/core/app_config/app_colors.dart'; +import 'package:hunger/app/core/app_config/app_sizes.dart'; +import 'package:hunger/app/modules/product_details/widgets/rating.dart'; +import '../controllers/product_details_controller.dart'; + +class ProductDetailsView extends GetView { + const ProductDetailsView({super.key}); + + @override + Widget build(BuildContext context) { + final textTheme = Theme.of(context).textTheme; + return Scaffold( + appBar: AppBar( + actions: [ + IconButton(onPressed: () {}, icon: const Icon(Icons.shopping_cart)) + ], + ), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + SizedBox( + width: AppSizes.x42_00, + height: AppSizes.x37_00, + child: Image.asset( + "assets/cake-img.jpg", + fit: BoxFit.fill, + ), + ), + Obx( + () => Positioned( + right: AppSizes.x2_5, + bottom: AppSizes.x2_5, + child: CircleAvatar( + child: IconButton( + onPressed: () { + if (controller.favoriteClicked.value) { + controller.favoriteClicked.value = false; + } else { + controller.favoriteClicked.value = true; + } + }, + icon: controller.favoriteClicked.value + ? const Icon( + Icons.favorite_rounded, + color: AppColors.rustedOrange, + ) + : const Icon(Icons.favorite_border_outlined)), + )), + ), + ], + ), + Padding( + padding: const EdgeInsets.only(left: AppSizes.x1_00), + child: Row( + children: [ + Text("Black forest", + style: Theme.of(context) + .textTheme + .titleMedium + ?.copyWith( + fontSize: AppSizes.x2_5, + fontWeight: FontWeight.bold)), + const SizedBox( + width: AppSizes.x1_00, + ), + const Rating( + color: AppColors.ratingColor, + ), + const Rating( + color: AppColors.ratingColor, + ), + const Rating( + color: AppColors.ratingColor, + ), + const Rating( + color: AppColors.ratingColor, + ), + const Rating(), + const SizedBox( + width: AppSizes.x1_00, + ), + const Text("59 ratings"), + ], + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSizes.x1_50), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + const Icon( + Icons.currency_rupee, + size: AppSizes.x1_87, + ), + Text( + "400", + style: Theme.of(context) + .textTheme + .bodySmall + ?.copyWith( + fontWeight: FontWeight.bold, + fontSize: AppSizes.x2_37), + ), + ], + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: AppColors.rustedOrange), + child: Row( + children: [ + InkWell( + onTap: () { + if (controller.productAdded.value >= 1) { + controller.productAdded.value = + controller.productAdded.value - 1; + } + }, + child: const Icon( + Icons.remove, + color: AppColors.white, + size: AppSizes.x2_37, + )), + Container( + margin: const EdgeInsets.symmetric(horizontal: 6), + padding: const EdgeInsets.symmetric( + horizontal: 4, vertical: 1), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: AppColors.rustedOrange), + child: Obx( + () { + final addedValue = + controller.productAdded.value; + final convertedValue = + // ignore: prefer_interpolation_to_compose_strings + addedValue.toString() + " "; + return Text(convertedValue, + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith( + color: AppColors.white, + fontSize: AppSizes.x2_37, + )); + }, + ), + ), + InkWell( + onTap: () { + _displayBottomSheet(context); + + controller.productAdded.value = + controller.productAdded.value + 1; + }, + child: const Icon( + Icons.add, + color: AppColors.white, + size: AppSizes.x2_37, + )), + ], + ), + ), + ], + ), + ), + ListTile( + contentPadding: + const EdgeInsets.symmetric(horizontal: AppSizes.x1_00), + title: Text( + "Description", + style: Theme.of(context).textTheme.titleMedium?.copyWith( + fontSize: AppSizes.x2_5, fontWeight: FontWeight.bold), + ), + subtitle: const Text( + maxLines: null, + "A sweet baked food made from a dough or thick batter usually containing flour and sugar and often shortening any of a variety of breads, often rich or delicate."), + ), + const Divider( + color: AppColors.grey, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSizes.x1_50), + child: Text( + "Recommended sides", + style: Theme.of(context).textTheme.titleSmall?.copyWith( + fontSize: AppSizes.x2_5, fontWeight: FontWeight.bold), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSizes.x1_87), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + Padding( + padding: const EdgeInsets.only(right: AppSizes.x1_87), + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + elevation: 2, + margin: EdgeInsets.zero, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + "assets/blackforest.png", + width: AppSizes.x12_5, + height: AppSizes.x12_5, + ), + Text( + "Black forest", + style: Theme.of(context) + .textTheme + .bodySmall + ?.copyWith(fontSize: AppSizes.x2_00), + ), + Row( + children: [ + const Icon( + Icons.currency_rupee_sharp, + size: AppSizes.x1_87, + ), + Text( + "315", + style: textTheme.titleSmall! + .copyWith(fontWeight: FontWeight.bold), + ), + const SizedBox( + width: AppSizes.x1_87, + ), + IconButton( + onPressed: () {}, + icon: const Icon(Icons.add_circle_outline, + color: AppColors.ratingColor)) + ], + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.only(right: AppSizes.x1_87), + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + elevation: 2, + margin: EdgeInsets.zero, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + "assets/cake1.jpeg", + width: AppSizes.x12_5, + height: AppSizes.x12_5, + fit: BoxFit.cover, + ), + Text( + "Burger", + style: textTheme.titleSmall! + .copyWith(fontSize: AppSizes.x2_00), + ), + Row( + children: [ + const Icon( + Icons.currency_rupee_sharp, + size: AppSizes.x1_87, + ), + Text( + "190", + style: textTheme.titleSmall! + .copyWith(fontWeight: FontWeight.bold), + ), + const SizedBox( + width: AppSizes.x1_50, + ), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.add_circle_outline, + color: AppColors.ratingColor, + )) + ], + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.only(right: AppSizes.x1_87), + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + elevation: 2, + margin: EdgeInsets.zero, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + "assets/cake2.jpeg", + width: AppSizes.x12_5, + height: AppSizes.x12_5, + fit: BoxFit.cover, + ), + Text( + "Dark forest", + style: textTheme.titleSmall! + .copyWith(fontSize: AppSizes.x2_00), + ), + Row( + children: [ + const Icon( + Icons.currency_rupee_sharp, + size: AppSizes.x1_87, + ), + Text( + "420", + style: textTheme.titleSmall! + .copyWith(fontWeight: FontWeight.bold), + ), + const SizedBox( + width: AppSizes.x1_50, + ), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.add_circle_outline, + color: AppColors.ratingColor, + )) + ], + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.only(right: AppSizes.x1_87), + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + elevation: 2, + margin: EdgeInsets.zero, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + "assets/cake3.jpeg", + width: AppSizes.x12_5, + height: AppSizes.x12_5, + fit: BoxFit.cover, + ), + Text( + "vennala", + style: textTheme.titleSmall! + .copyWith(fontSize: AppSizes.x2_00), + ), + Row( + children: [ + const Icon( + Icons.currency_rupee_sharp, + size: AppSizes.x1_87, + ), + Text( + "215", + style: textTheme.titleSmall! + .copyWith(fontWeight: FontWeight.bold), + ), + const SizedBox( + width: AppSizes.x1_50, + ), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.add_circle_outline, + color: AppColors.ratingColor, + )) + ], + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.only(right: AppSizes.x1_87), + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + elevation: 2, + margin: EdgeInsets.zero, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + "assets/blackforest.png", + width: AppSizes.x12_5, + height: AppSizes.x12_5, + ), + Text( + "Black forest", + style: Theme.of(context) + .textTheme + .bodySmall + ?.copyWith(fontSize: AppSizes.x2_00), + ), + Row( + children: [ + const Icon( + Icons.currency_rupee_sharp, + size: AppSizes.x1_87, + ), + Text( + "315", + style: textTheme.titleSmall! + .copyWith(fontWeight: FontWeight.bold), + ), + const SizedBox( + width: AppSizes.x1_50, + ), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.add_circle_outline, + color: AppColors.ratingColor, + )) + ], + ) + ], + ), + ), + ) + ], + ), + ), + ), + ], + ), + )); + } + + Future _displayBottomSheet(BuildContext context) { + return showModalBottomSheet( + context: context, + builder: (context) => SizedBox( + height: AppSizes.x12_5, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSizes.x1_50), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Total:", + style: Theme.of(context).textTheme.titleSmall?.copyWith( + fontSize: AppSizes.x2_87, + fontWeight: FontWeight.bold)), + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppColors.rustedOrange), + onPressed: () {}, + child: const Row( + children: [ + Icon( + Icons.shopping_cart, + color: AppColors.white, + ), + Text( + " Add to cart", + style: TextStyle( + fontSize: AppSizes.x1_87, + color: AppColors.white), + ), + ], + )) + ], + ), + ), + )); + } +} diff --git a/lib/app/modules/product_details/widgets/rating.dart b/lib/app/modules/product_details/widgets/rating.dart new file mode 100644 index 0000000..48575d8 --- /dev/null +++ b/lib/app/modules/product_details/widgets/rating.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +class Rating extends StatelessWidget { + final Color? color; + const Rating({ + super.key, + this.color, + }); + + @override + Widget build(BuildContext context) { + return Icon( + Icons.star, + size: 15, + color: color, + ); + } +} diff --git a/lib/app/modules/profil_page/bindings/profil_page_binding.dart b/lib/app/modules/profil_page/bindings/profil_page_binding.dart new file mode 100644 index 0000000..3916e3f --- /dev/null +++ b/lib/app/modules/profil_page/bindings/profil_page_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../controllers/profil_page_controller.dart'; + +class ProfilPageBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => ProfilPageController(), + ); + } +} diff --git a/lib/app/modules/profil_page/controllers/profil_page_controller.dart b/lib/app/modules/profil_page/controllers/profil_page_controller.dart new file mode 100644 index 0000000..5951327 --- /dev/null +++ b/lib/app/modules/profil_page/controllers/profil_page_controller.dart @@ -0,0 +1,18 @@ +import 'package:get/get.dart'; + +class ProfilPageController extends GetxController { + final count = 0.obs; + // @override + // void onInit() { + // super.onInit(); + // } + + // @override + // void onReady() { + // super.onReady(); + // } + + // @override + // void onClose() {} + // void increment() => count.value++; +} diff --git a/lib/app/modules/profil_page/views/profil_page_view.dart b/lib/app/modules/profil_page/views/profil_page_view.dart new file mode 100644 index 0000000..93ac60c --- /dev/null +++ b/lib/app/modules/profil_page/views/profil_page_view.dart @@ -0,0 +1,634 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:hunger/app/core/app_config/app_colors.dart'; +import 'package:hunger/app/core/app_config/app_sizes.dart'; +import 'package:hunger/app/routes/app_pages.dart'; + +import '../controllers/profil_page_controller.dart'; + +class ProfilPageView extends GetView { + const ProfilPageView({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text(''), + centerTitle: true, + ), + body: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Card( + color: AppColors.white, + child: ListTile( + leading: CircleAvatar( + radius: AppSizes.x4_37, + child: IconButton( + onPressed: () { + Get.toNamed(Routes.PROFILE_DETAILS); + }, + icon: const Icon(Icons.person), + iconSize: AppSizes.x3_12, + ), + ), + title: Text( + "Suresh", + style: Theme.of(context).textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, fontSize: AppSizes.x2_5), + ), + subtitle: TextButton( + onPressed: () {}, + child: Padding( + padding: const EdgeInsets.only(right: AppSizes.x2_5), + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "View activity", + style: Theme.of(context) + .textTheme + .titleMedium + ?.copyWith(color: AppColors.rustedOrange), + ), + const Icon( + Icons.arrow_right, + size: AppSizes.x1_87, + color: AppColors.rustedOrange, + ) + ], + ), + ), + ))), + ), + Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: AppSizes.x25_00, + child: Card( + color: AppColors.white, + child: ListTile( + title: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.favorite_border_outlined)), + ), + subtitle: TextButton( + onPressed: () { + Get.toNamed(Routes.PRODUCT_DETAILS); + }, + child: Text( + "Favourites", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + ), + ), + ), + SizedBox( + width: AppSizes.x25_00, + child: Card( + color: AppColors.white, + child: ListTile( + title: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.currency_rupee)), + ), + subtitle: Row( + children: [ + TextButton( + onPressed: () {}, + child: Text( + "Money", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + IconButton( + style: const ButtonStyle( + backgroundColor: MaterialStatePropertyAll( + AppColors.oliveGreenShade)), + onPressed: () {}, + icon: Row( + children: [ + const Icon(Icons.currency_rupee, + size: AppSizes.x1_87, + color: AppColors.rupeeColor), + Text("0", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith( + color: AppColors.rupeeColor)) + ], + )), + ], + ), + ), + ), + ) + ], + ), + ), + Card( + color: AppColors.white, + child: ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.grey, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.person), + ), + ), + title: TextButton( + onPressed: () {}, + child: Text( + "Your profile", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + TextButton( + style: const ButtonStyle( + backgroundColor: MaterialStatePropertyAll( + AppColors.oliveGreenShade)), + onPressed: () {}, + child: Text( + "64% completed", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.oliveGreen), + )), + IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ], + ), + ), + ), + Card( + color: AppColors.white, + child: ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.star_border_outlined), + ), + ), + title: TextButton( + onPressed: () {}, + child: Text( + "Your rating", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + TextButton( + style: const ButtonStyle( + backgroundColor: MaterialStatePropertyAll( + AppColors.white)), + onPressed: () {}, + child: const Row( + children: [ + Text('4.39'), + Icon( + Icons.star, + size: AppSizes.x1_87, + color: AppColors.ratingColor, + ), + ], + )), + ], + ), + IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ], + ), + ), + ), + Card( + color: AppColors.white, + child: Column( + children: [ + const ListTile( + title: Text("Food orders", + style: TextStyle(fontWeight: FontWeight.bold)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.book_online_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "Your orders", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.favorite_border_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "Favorite orders", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.menu_book_sharp))), + title: TextButton( + onPressed: () { + Get.toNamed(Routes.ADDRESS); + }, + child: Text( + "Address book", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () { + Get.toNamed(Routes.ADDRESS); + }, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.remove_red_eye_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "Hidden Restaurants", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.message))), + title: TextButton( + onPressed: () {}, + child: Text( + "Online ordering help", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ) + ], + ), + ), + Card( + color: AppColors.white, + child: Column( + children: [ + ListTile( + title: Text("Money", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(fontWeight: FontWeight.bold)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.currency_rupee))), + title: TextButton( + onPressed: () {}, + child: Text( + "Zomato Money", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon( + Icons.calendar_view_month_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "Claim Gift Card", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.wallet))), + title: TextButton( + onPressed: () {}, + child: Text( + "Zomato Wallet", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.credit_score_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "Zomato Credits", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.payment_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "Payment settings", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ) + ], + ), + ), + Card( + color: AppColors.white, + child: Column(children: [ + const ListTile( + title: Text("Table bookings", + style: TextStyle(fontWeight: FontWeight.bold)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.bookmark))), + title: TextButton( + onPressed: () {}, + child: Text( + "Your bookings", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.message))), + title: TextButton( + onPressed: () {}, + child: Text( + "Table booking help", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ])), + Card( + color: AppColors.white, + child: Column( + children: [ + ListTile( + title: Text("More", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(fontWeight: FontWeight.bold)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.language))), + title: TextButton( + onPressed: () {}, + child: Text( + "Choose language", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.album_outlined))), + title: TextButton( + onPressed: () {}, + child: Text( + "About", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.edit_square))), + title: TextButton( + onPressed: () {}, + child: Text( + "Send feedback", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.settings))), + title: TextButton( + onPressed: () {}, + child: Text( + "Settings", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ), + ListTile( + leading: CircleAvatar( + backgroundColor: AppColors.white, + child: IconButton( + onPressed: () {}, + icon: const Icon(Icons.logout_rounded))), + title: TextButton( + onPressed: () {}, + child: Text( + "Log out", + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith(color: AppColors.blackColor), + )), + trailing: IconButton( + onPressed: () {}, + icon: + const Icon(Icons.keyboard_arrow_right_outlined)), + ) + ], + ), + ), + ], + ), + )); + } +} diff --git a/lib/app/modules/profile_details/bindings/profile_details_binding.dart b/lib/app/modules/profile_details/bindings/profile_details_binding.dart new file mode 100644 index 0000000..e162dd6 --- /dev/null +++ b/lib/app/modules/profile_details/bindings/profile_details_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../controllers/profile_details_controller.dart'; + +class ProfileDetailsBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => ProfileDetailsController(), + ); + } +} diff --git a/lib/app/modules/profile_details/controllers/profile_details_controller.dart b/lib/app/modules/profile_details/controllers/profile_details_controller.dart new file mode 100644 index 0000000..97e457d --- /dev/null +++ b/lib/app/modules/profile_details/controllers/profile_details_controller.dart @@ -0,0 +1,5 @@ +import 'package:get/get.dart'; + +class ProfileDetailsController extends GetxController { + final count = 0.obs; +} diff --git a/lib/app/modules/profile_details/views/profile_details_view.dart b/lib/app/modules/profile_details/views/profile_details_view.dart new file mode 100644 index 0000000..973658a --- /dev/null +++ b/lib/app/modules/profile_details/views/profile_details_view.dart @@ -0,0 +1,149 @@ +// ignore_for_file: avoid_print + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; +import 'package:hunger/app/core/app_config/app_colors.dart'; +import 'package:hunger/app/core/app_config/app_sizes.dart'; + +import '../controllers/profile_details_controller.dart'; + +class ProfileDetailsView extends GetView { + const ProfileDetailsView({super.key}); + + actionButton(BuildContext context) { + showCupertinoModalPopup( + context: context, + builder: (context) { + return CupertinoActionSheet( + actions: [ + CupertinoActionSheetAction( + child: const Text('Delete Photo'), + onPressed: () { + print('pressed'); + Get.back(); + }, + ), + CupertinoActionSheetAction( + child: const Text('Change Photo'), + onPressed: () { + print('pressed'); + Get.back(); + }, + ) + ], + cancelButton: CupertinoActionSheetAction( + child: const Text('Cancel'), + onPressed: () { + Get.back(); + }, + )); + }, + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Your Profile'), + ), + body: Column( + children: [ + Card( + color: AppColors.white, + child: Column( + children: [ + ListTile( + title: CircleAvatar( + radius: AppSizes.x5_62, + child: IconButton( + onPressed: () { + actionButton(context); + }, + icon: const Icon( + Icons.person, + size: AppSizes.x5_00, + ))), + ), + const SizedBox( + height: AppSizes.x1_25, + ), + const Padding( + padding: EdgeInsets.all(AppSizes.x1_50), + child: SizedBox( + height: AppSizes.x5_25, + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: "Enter Name", + suffixIcon: Icon(Icons.person)), + ), + ), + ), + const SizedBox( + height: AppSizes.x1_25, + ), + const Padding( + padding: EdgeInsets.all(AppSizes.x1_50), + child: SizedBox( + height: AppSizes.x5_25, + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: "Enter Mobile", + suffixIcon: Icon(Icons.phone_enabled)), + ), + ), + ), + const SizedBox( + height: AppSizes.x1_25, + ), + const Padding( + padding: EdgeInsets.all(AppSizes.x1_50), + child: SizedBox( + height: AppSizes.x5_25, + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: "Enter Email", + suffixIcon: Icon(Icons.email)), + ), + ), + ), + const Padding( + padding: EdgeInsets.all(AppSizes.x1_50), + child: SizedBox( + height: AppSizes.x5_25, + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: "Date of birth", + suffixIcon: Icon(Icons.date_range_outlined)), + ), + ), + ), + const Padding( + padding: EdgeInsets.all(AppSizes.x1_50), + child: SizedBox( + height: AppSizes.x5_25, + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: "Gender", + suffixIcon: Icon(Icons.arrow_drop_down_sharp)), + ), + ), + ), + ], + )), + const SizedBox( + height: AppSizes.x6_25, + ), + ElevatedButton( + onPressed: () {}, child: const Text("Update Profile")) + ], + )); + } +} diff --git a/lib/app/modules/sign_up/bindings/sign_up_binding.dart b/lib/app/modules/sign_up/bindings/sign_up_binding.dart deleted file mode 100644 index 0c752c0..0000000 --- a/lib/app/modules/sign_up/bindings/sign_up_binding.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:get/get.dart'; - -import '../controllers/sign_up_controller.dart'; - -class SignUpBinding extends Bindings { - @override - void dependencies() { - Get.lazyPut( - () => SignUpController(), - ); - } -} diff --git a/lib/app/modules/sign_up/controllers/sign_up_controller.dart b/lib/app/modules/sign_up/controllers/sign_up_controller.dart deleted file mode 100644 index 2e2bc9d..0000000 --- a/lib/app/modules/sign_up/controllers/sign_up_controller.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:get/get.dart'; - -class SignUpController extends GetxController { - //TODO: Implement SignUpController - - final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - - @override - void onReady() { - super.onReady(); - } - - @override - void onClose() {} - void increment() => count.value++; -} diff --git a/lib/app/modules/sign_up/views/sign_up_view.dart b/lib/app/modules/sign_up/views/sign_up_view.dart deleted file mode 100644 index d59077f..0000000 --- a/lib/app/modules/sign_up/views/sign_up_view.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:get/get.dart'; - -import '../controllers/sign_up_controller.dart'; - -class SignUpView extends GetView { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('SignUpView'), - centerTitle: true, - ), - body: Center( - child: Text( - 'SignUpView is working', - style: TextStyle(fontSize: 20), - ), - ), - ); - } -} diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart index bcea8c2..4917459 100644 --- a/lib/app/routes/app_pages.dart +++ b/lib/app/routes/app_pages.dart @@ -2,33 +2,41 @@ import 'package:get/get.dart'; import 'package:hunger/app/modules/home/bindings/home_binding.dart'; import 'package:hunger/app/modules/home/views/home_view.dart'; -import 'package:hunger/app/modules/login/bindings/login_binding.dart'; -import 'package:hunger/app/modules/login/views/login_view.dart'; -import 'package:hunger/app/modules/sign_up/bindings/sign_up_binding.dart'; -import 'package:hunger/app/modules/sign_up/views/sign_up_view.dart'; +import 'package:hunger/app/modules/product_details/bindings/product_details_binding.dart'; +import 'package:hunger/app/modules/product_details/views/product_details_view.dart'; +import 'package:hunger/app/modules/profil_page/bindings/profil_page_binding.dart'; +import 'package:hunger/app/modules/profil_page/views/profil_page_view.dart'; +import 'package:hunger/app/modules/profile_details/bindings/profile_details_binding.dart'; +import 'package:hunger/app/modules/profile_details/views/profile_details_view.dart'; part 'app_routes.dart'; class AppPages { AppPages._(); - static const INITIAL = Routes.HOME; + // ignore: constant_identifier_names + static const INITIAL = Routes.PROFIL_PAGE; static final routes = [ GetPage( name: _Paths.HOME, - page: () => HomeView(), + page: () => const HomeView(), binding: HomeBinding(), ), GetPage( - name: _Paths.LOGIN, - page: () => LoginView(), - binding: LoginBinding(), + name: _Paths.PROFIL_PAGE, + page: () => const ProfilPageView(), + binding: ProfilPageBinding(), ), GetPage( - name: _Paths.SIGN_UP, - page: () => SignUpView(), - binding: SignUpBinding(), + name: _Paths.PROFILE_DETAILS, + page: () => const ProfileDetailsView(), + binding: ProfileDetailsBinding(), + ), + GetPage( + name: _Paths.PRODUCT_DETAILS, + page: () => const ProductDetailsView(), + binding: ProductDetailsBinding(), ), ]; } diff --git a/lib/app/routes/app_routes.dart b/lib/app/routes/app_routes.dart index 20d60de..3fd4c21 100644 --- a/lib/app/routes/app_routes.dart +++ b/lib/app/routes/app_routes.dart @@ -1,3 +1,5 @@ +// ignore_for_file: constant_identifier_names + part of 'app_pages.dart'; // DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart @@ -5,12 +7,20 @@ abstract class Routes { Routes._(); static const HOME = _Paths.HOME; - static const LOGIN = _Paths.LOGIN; - static const SIGN_UP = _Paths.SIGN_UP; + static const PROFIL_PAGE = _Paths.PROFIL_PAGE; + static const PROFILE_DETAILS = _Paths.PROFILE_DETAILS; + static const FOOD_ITEMS = _Paths.FOOD_ITEMS; + static const ADDRESS = _Paths.ADDRESS; + static const SAVE_ADDRESS = _Paths.SAVE_ADDRESS; + static const PRODUCT_DETAILS = _Paths.PRODUCT_DETAILS; } abstract class _Paths { static const HOME = '/home'; - static const LOGIN = '/login'; - static const SIGN_UP = '/sign-up'; + static const PROFIL_PAGE = '/profil-page'; + static const PROFILE_DETAILS = '/profile-details'; + static const FOOD_ITEMS = '/food-items'; + static const ADDRESS = '/address'; + static const SAVE_ADDRESS = '/save-address'; + static const PRODUCT_DETAILS = '/product-details'; } diff --git a/lib/main.dart b/lib/main.dart index d90a1eb..35f84d1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,12 +4,13 @@ import 'package:get/get.dart'; import 'app/routes/app_pages.dart'; -void main() { +void main() { runApp( GetMaterialApp( title: "Application", initialRoute: AppPages.INITIAL, getPages: AppPages.routes, + debugShowCheckedModeBanner: false, ), ); } diff --git a/pubspec.lock b/pubspec.lock index efe39a4..9a2491c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + carousel_slider: + dependency: "direct main" + description: + name: carousel_slider + sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42" + url: "https://pub.dev" + source: hosted + version: "4.2.1" characters: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5c4d15f..95fa9cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: get: 4.6.6 flutter: sdk: flutter + carousel_slider: ^4.2.1 dev_dependencies: flutter_lints: ^2.0.0 @@ -19,4 +20,10 @@ dev_dependencies: flutter: uses-material-design: true + assets: + - assets/blackforest.png + - assets/cake-img.jpg + - assets/cake1.jpeg + - assets/cake2.jpeg + - assets/cake3.jpeg