diff --git a/assets/biry.png b/assets/biry.png new file mode 100644 index 0000000..df7da48 Binary files /dev/null and b/assets/biry.png differ diff --git a/assets/cake.png b/assets/cake.png new file mode 100644 index 0000000..0935c4d Binary files /dev/null and b/assets/cake.png differ diff --git a/assets/paneer.jpg b/assets/paneer.jpg new file mode 100644 index 0000000..e2d7a9e Binary files /dev/null and b/assets/paneer.jpg differ diff --git a/lib/app/core/app_config/app_colors.dart b/lib/app/core/app_config/app_colors.dart index e69de29..1c24588 100644 --- a/lib/app/core/app_config/app_colors.dart +++ b/lib/app/core/app_config/app_colors.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class AppColors { + AppColors._(); + + + static const black = Color(0xFF000000); + 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..6139ccf 100644 --- a/lib/app/core/app_config/app_sizes.dart +++ b/lib/app/core/app_config/app_sizes.dart @@ -0,0 +1,12 @@ +class AppSizes { + static const x1_50 = 12.0; + static const x2_25 = 18.0; + static const x2_50 = 20.0; + static const x2_75 = 22.0; + static const x3_12= 25.0; + static const x2_00 = 16.0; + static const x3_75 = 30.0; + static const x4_37 = 35.0; + static const x1_75= 100.0; + +} diff --git a/lib/app/modules/carts/bindings/carts_binding.dart b/lib/app/modules/carts/bindings/carts_binding.dart new file mode 100644 index 0000000..1651edc --- /dev/null +++ b/lib/app/modules/carts/bindings/carts_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../controllers/carts_controller.dart'; + +class CartsBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => CartsController(), + ); + } +} diff --git a/lib/app/modules/carts/controllers/carts_controller.dart b/lib/app/modules/carts/controllers/carts_controller.dart new file mode 100644 index 0000000..d7760d1 --- /dev/null +++ b/lib/app/modules/carts/controllers/carts_controller.dart @@ -0,0 +1,13 @@ +// ignore_for_file: unnecessary_overrides + +import 'package:get/get.dart'; + +class CartsController extends GetxController { + final blackForestCount = 0.obs; + final biryaniCount = 0.obs; + final paneerCount = 0.obs; + final blackForestCost = 0.obs; + final biryaniCost = 0.obs; + final paneerCost = 0.obs; + final totalprice= 0.obs; +} diff --git a/lib/app/modules/carts/views/carts_view.dart b/lib/app/modules/carts/views/carts_view.dart new file mode 100644 index 0000000..efa50ca --- /dev/null +++ b/lib/app/modules/carts/views/carts_view.dart @@ -0,0 +1,154 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:hunger/app/core/app_config/app_sizes.dart'; +import 'package:hunger/app/modules/carts/widgets/order_card.dart'; + +import '../controllers/carts_controller.dart'; + +class CartsView extends GetView { + const CartsView({super.key}); + + @override + Widget build(BuildContext context) { + final textTheme = Theme.of(context).textTheme; + return Scaffold( + appBar: AppBar( + leading: + IconButton(onPressed: () {}, icon: const Icon(Icons.arrow_back)), + title: Text( + "Your Order", + style: textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.bold + ), + ), + centerTitle: true, + // actions: [ + // Icon( + // Icons.question_mark_rounded, + // size: 28.0, + // ), + // SizedBox( + // width: 30.0, + // ) + // ], + ), + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Obx( + () => Column( + children: [ + OrderCard( + imageUrl: "assets/cake.png", + imageText: "cake", + productCount: + controller.blackForestCount.value.toString(), + productCost: controller.blackForestCost.value.toString(), + add: () { + controller.blackForestCount.value += 1; + controller.blackForestCost.value += 220; + controller.totalprice.value += 220; + }, + remove: () { + if (controller.blackForestCount.value > 0) { + controller.blackForestCount.value -= 1; + controller.blackForestCost.value -= 220; + controller.totalprice.value -= 220; + } + }, + ), + OrderCard( + imageUrl: "assets/biry.png", + imageText: "Biryani", + productCount: controller.biryaniCount.value.toString(), + productCost: controller.biryaniCost.value.toString(), + add: () { + controller.biryaniCount.value += 1; + controller.biryaniCost.value += 180; + controller.totalprice.value += 180; + }, + remove: () { + if (controller.biryaniCount.value > 0) { + controller.biryaniCount.value -= 1; + controller.biryaniCost.value -= 180; + controller.totalprice.value -= 180; + } + }, + ), + OrderCard( + imageUrl: "assets/paneer.jpg", + imageText: "Paneer", + productCount: controller.paneerCount.value.toString(), + productCost: controller.paneerCost.value.toString(), + add: () { + controller.paneerCount.value += 1; + controller.paneerCost.value += 120; + controller.totalprice.value += 120; + }, + remove: () { + if (controller.paneerCount.value > 0) { + controller.paneerCount.value -= 1; + controller.paneerCost.value -= 120; + controller.totalprice.value -= 120; + } + }, + ), + ], + ), + ), + ), + ), + Obx( + () => Card( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: AppSizes.x3_75), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ListTile( + leading: Text( + "Total price", + style: textTheme.titleMedium?.copyWith( + fontSize: AppSizes.x2_75, + fontWeight: FontWeight.bold), + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon( + Icons.currency_rupee, + size: AppSizes.x2_50, + ), + Text( + controller.totalprice.value.toString(), + style: Theme.of(context) + .textTheme + .titleMedium + ?.copyWith( + fontSize: AppSizes.x2_50, + fontWeight: FontWeight.bold), + ), + ], + ), + ), + + // Padding( + // padding: const EdgeInsets.symmetric(horizontal: 8.0), + // child: FilledButton( + // onPressed: () {}, + // child: const Text("Add items"), + // ), + // ), + ], + ), + )), + ) + ], + ), + ); + } +} diff --git a/lib/app/modules/carts/widgets/order_card.dart b/lib/app/modules/carts/widgets/order_card.dart new file mode 100644 index 0000000..9292891 --- /dev/null +++ b/lib/app/modules/carts/widgets/order_card.dart @@ -0,0 +1,93 @@ +// ignore_for_file: unused_local_variable + +import 'package:flutter/material.dart'; +import 'package:hunger/app/core/app_config/app_colors.dart'; +import 'package:hunger/app/core/app_config/app_sizes.dart'; + +class OrderCard extends StatelessWidget { + final String imageUrl; + final String imageText; + final String productCount; + final String productCost; + final Function() remove; + final Function() add; + + const OrderCard({ + super.key, + required this.imageUrl, + required this.imageText, + required this.productCount, + required this.productCost, + required this.remove, + required this.add, + }); + + @override + Widget build(BuildContext context) { + final textTheme = Theme.of(context).textTheme; + return SizedBox( + height: 100.0, + child: Card( + child: Center( + child: ListTile( + leading: Image.asset( + imageUrl, + // fit: BoxFit.contain, + ), + title: Text( + imageText, + style: Theme.of(context).textTheme.titleMedium?.copyWith( + fontSize: AppSizes.x2_25, fontWeight: FontWeight.bold), + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + height: AppSizes.x4_37, + decoration: BoxDecoration( + color: AppColors.rustedOrange, + borderRadius: BorderRadius.circular(AppSizes.x3_12), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + InkWell( + child: IconButton( + onPressed: remove, + icon: const Icon( + Icons.remove, + color: AppColors.white, + size: AppSizes.x1_50, + ),), + ), + Text( + productCount, + style: + const TextStyle(color: AppColors.white), + ), + InkWell( + child: IconButton( + onPressed: add, + icon: const Icon(Icons.add, + color: AppColors.white, size: AppSizes.x1_50),), + ), + ], + ), + ), + const Icon( + Icons.currency_rupee, + size: AppSizes.x2_50, + ), + Text( + productCost == "0" ? " 0 " : productCost, + style: Theme.of(context).textTheme.titleMedium?.copyWith( + fontSize: AppSizes.x2_50, fontWeight: FontWeight.bold), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/app/modules/home/controllers/home_controller.dart b/lib/app/modules/home/controllers/home_controller.dart index 89aa44b..4383079 100644 --- a/lib/app/modules/home/controllers/home_controller.dart +++ b/lib/app/modules/home/controllers/home_controller.dart @@ -1,7 +1,9 @@ +// ignore_for_file: unnecessary_overrides + import 'package:get/get.dart'; class HomeController extends GetxController { - //TODO: Implement HomeController + final count = 0.obs; @override diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index fe86cb8..ed72389 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -1,23 +1,355 @@ +// ignore_for_file: avoid_unnecessary_containers, prefer_const_constructors, use_key_in_widget_constructors + +import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; - import '../controllers/home_controller.dart'; class HomeView extends GetView { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text('HomeView'), - centerTitle: true, - ), - body: Center( - child: Text( - 'HomeView is working', - style: TextStyle(fontSize: 20), + appBar: AppBar( + title: const Text(''), + centerTitle: true, ), - ), - ); + + //1st carasoul + + body: SingleChildScrollView( + child: Column( + children: [ + Card( + child: Column( + children: [ + CarouselSlider( + items: [ + //kfc image1 + GestureDetector( + child: Container( + child: Image.asset('assets/kfccombo.png')), + onTap: () { + // Get.toNamed(Routes.''), + }, + ), + + //kfc image2 + GestureDetector( + child: Container( + child: Image.asset('assets/kgccombo2.png')), + onTap: () { + // Get.toNamed(Routes.''), + }, + ), + + //kfc image3 + GestureDetector( + child: Container( + child: Image.asset('assets/kfc.png'), + ), + onTap: () { + // Get.toNamed(Routes.''), + }, + ), + ], + options: CarouselOptions( + autoPlay: true, + enableInfiniteScroll: true, + // pauseAutoPlayInFiniteScroll: false, + autoPlayAnimationDuration: Duration(milliseconds: 150), + viewportFraction: 1.5, + )), + ListTile( + title: Text( + 'KFC', + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold), + ), + trailing: Container( + padding: EdgeInsets.all(5.0), + decoration: BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.circular(5.0)), + child: Row( + mainAxisSize: MainAxisSize.min, + children: const [ + Text( + '4.2', + style: TextStyle(color: Colors.white), + ), + Icon( + Icons.star_border_outlined, + color: Colors.white, + size: 15.0, + ), + ], + )), + subtitle: Row( + children: const [ + Text('KFC .'), + Icon( + Icons.currency_rupee, + size: 15.0, + ), + Text('300 for one'), + ], + ), + ), + ], + )), + + //2nd carousel + Card( + child: Column( + children: [ + CarouselSlider( + items: [ + //bawarachi image1 + + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/biryani1.jpg'))), + + //bawarachi image2 + + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/biryani4.jpg')), + ), + + //bawarachi image3 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/biryani7.png', + fit: BoxFit.fill)), + ) + ], + options: CarouselOptions( + autoPlay: true, + enableInfiniteScroll: true, + autoPlayAnimationDuration: Duration(milliseconds: 150), + viewportFraction: 1.8, + )), + ListTile( + title: Text( + 'BHAWARCHI', + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold), + ), + trailing: Container( + padding: EdgeInsets.all(5.0), + decoration: BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.circular(5.0)), + child: Row( + mainAxisSize: MainAxisSize.min, + children: const [ + Text( + '4.0', + style: TextStyle(color: Colors.white), + ), + Icon( + Icons.star_border_outlined, + color: Colors.white, + size: 15.0, + ), + ], + )), + subtitle: Row( + children: const [ + Text('Biryani . Non Veg .'), + Row( + children: [ + Icon( + Icons.currency_rupee, + size: 15.0, + ), + ], + ), + Text('240 for one'), + ], + ), + ), + ], + )), + + // 3rd carousel + + Card( + child: Column( + children: [ + CarouselSlider( + items: [ + //platform image1 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: + Container(child: Image.asset('assets/veg1.png')), + ), + //platform img2 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: + Container(child: Image.asset('assets/veg2.png')), + ), + //platform img3 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/veg3.jpg'), + ), + ) + ], + options: CarouselOptions( + autoPlay: true, + enableInfiniteScroll: true, + autoPlayAnimationDuration: Duration(milliseconds: 150), + viewportFraction: 1.5, + )), + ListTile( + title: Text( + 'PLATFORM 65', + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold), + ), + trailing: Container( + padding: EdgeInsets.all(5.0), + decoration: BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.circular(5.0)), + child: Row( + mainAxisSize: MainAxisSize.min, + children: const [ + Text( + '4.1', + style: TextStyle(color: Colors.white), + ), + Icon( + Icons.star_border_outlined, + color: Colors.white, + size: 15.0, + ), + ], + )), + subtitle: Row( + children: const [ + Text('Birayani . Pure veg .'), + Icon( + Icons.currency_rupee, + size: 15.0, + ), + Text('120 for one'), + ], + ), + ), + ], + )), + + //4th courasel + + Card( + color: Colors.white, + child: Column( + children: [ + CarouselSlider( + items: [ + //tiffin img1 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/puri.png')), + ), + //tiffin img2 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/dosa.jpg')), + ), + //tiffin img3 + GestureDetector( + onTap: () { + // Get.toNamed(Routes.''), + }, + child: Container( + child: Image.asset('assets/idli1.JPG'), + ), + ) + ], + options: CarouselOptions( + autoPlay: true, + enableInfiniteScroll: true, + autoPlayAnimationDuration: + Duration(milliseconds: 150), + viewportFraction: 1.5, + )), + ListTile( + title: Text( + 'TIFFINS KITCHEN ', + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold), + ), + trailing: Container( + padding: EdgeInsets.all(5.0), + decoration: BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.circular(5.0)), + child: Row( + mainAxisSize: MainAxisSize.min, + children: const [ + Text( + '3.9', + style: TextStyle(color: Colors.white), + ), + Icon( + Icons.star_border_outlined, + color: Colors.white, + size: 15.0, + ), + ], + )), + subtitle: Row( + children: const [ + Text('Tiffins'), + Icon( + Icons.currency_rupee, + size: 15.0, + ), + Text('60 for plate'), + ], + ), + ), + ], + )), + ], + ), + )); } } diff --git a/lib/app/modules/model/Food_Details.dat b/lib/app/modules/model/Food_Details.dat new file mode 100644 index 0000000..2efe3a6 --- /dev/null +++ b/lib/app/modules/model/Food_Details.dat @@ -0,0 +1,31 @@ +class FoodMenu { + String? title; + String? subTitle; + String? trailing; + String? bio; + double? version; + + FoodMenu({ + this.title, + this.subTitle, + this.trailing, + this.bio, + this.version, + }); + + factory FoodMenu.fromJson(Map json) => FoodMenu( + title: json["title"], + subTitle: json["sub-title"], + trailing: json["trailing"], + bio: json["bio"], + version: json["version"]?.toDouble(), + ); + + Map toJson() => { + "title": title, + "sub-title": subTitle, + "trailing": trailing, + "bio": bio, + "version": version, + }; +} diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart index bcea8c2..8fa59f5 100644 --- a/lib/app/routes/app_pages.dart +++ b/lib/app/routes/app_pages.dart @@ -1,5 +1,11 @@ import 'package:get/get.dart'; +import 'package:hunger/app/modules/Adress/bindings/adress_binding.dart'; +import 'package:hunger/app/modules/Adress/views/adress_view.dart'; +import 'package:hunger/app/modules/adressfields/bindings/adressfields_binding.dart'; +import 'package:hunger/app/modules/adressfields/views/adressfields_view.dart'; +import 'package:hunger/app/modules/carts/bindings/carts_binding.dart'; +import 'package:hunger/app/modules/carts/views/carts_view.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'; @@ -7,12 +13,14 @@ 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'; +// ignore_for_file: constant_identifier_names + part 'app_routes.dart'; class AppPages { AppPages._(); - static const INITIAL = Routes.HOME; + static const INITIAL = Routes.CARTS; static final routes = [ GetPage( @@ -30,5 +38,20 @@ class AppPages { page: () => SignUpView(), binding: SignUpBinding(), ), + GetPage( + name: _Paths.CARTS, + page: () => const CartsView(), + binding: CartsBinding(), + ), + GetPage( + name: _Paths.ADRESS, + page: () => AdressView(), + binding: AdressBinding(), + ), + GetPage( + name: _Paths.ADRESSFIELDS, + page: () => AdressfieldsView(), + binding: AdressfieldsBinding(), + ), ]; } diff --git a/lib/app/routes/app_routes.dart b/lib/app/routes/app_routes.dart index 20d60de..9bd132c 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 @@ -7,10 +9,16 @@ abstract class Routes { static const HOME = _Paths.HOME; static const LOGIN = _Paths.LOGIN; static const SIGN_UP = _Paths.SIGN_UP; + static const CARTS = _Paths.CARTS; + static const ADRESS = _Paths.ADRESS; + static const ADRESSFIELDS = _Paths.ADRESSFIELDS; } abstract class _Paths { static const HOME = '/home'; static const LOGIN = '/login'; static const SIGN_UP = '/sign-up'; + static const CARTS = '/carts'; + static const ADRESS = '/adress'; + static const ADRESSFIELDS = '/adressfields'; } diff --git a/lib/main.dart b/lib/main.dart index d90a1eb..188931b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,7 @@ import 'app/routes/app_pages.dart'; void main() { runApp( GetMaterialApp( + debugShowCheckedModeBanner: false, title: "Application", initialRoute: AppPages.INITIAL, getPages: AppPages.routes, 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..5dc49f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,11 +6,12 @@ environment: sdk: '>=3.2.3 <4.0.0' dependencies: - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.8 get_cli: ^1.8.1 get: 4.6.6 flutter: sdk: flutter + carousel_slider: ^4.2.1 dev_dependencies: flutter_lints: ^2.0.0 @@ -19,4 +20,28 @@ dev_dependencies: flutter: uses-material-design: true + assets: + - assets/kfccombo.png + - assets/kgccombo2.png + - assets/kfc.png + - assets/biryani1.jpg + - assets/biryani4.jpg + - assets/biryani7.png + - assets/veg1.png + - assets/veg2.png + - assets/veg3.jpg + - assets/puri.png + - assets/dosa.jpg + - assets/idli1.JPG + - assets/cake.png + - assets/thali.jpg + - assets/parota.jpg + - assets/paneer.jpg + - assets/biry.png + + + + + +