diff --git a/lib/models/indian_food.dart b/lib/models/indian_food.dart index a218655..647cd66 100644 --- a/lib/models/indian_food.dart +++ b/lib/models/indian_food.dart @@ -13,7 +13,7 @@ class IndianFood { return [ IndianFood(image: 'assets/images/food3.jpg', name: 'South\nIndian'), IndianFood(image: 'assets/images/food5.jpg', name: 'Indian\nChai'), - IndianFood(image: 'assets/images/food1.jpg', name: 'North \nndian'), + IndianFood(image: 'assets/images/food1.jpg', name: 'North \nIndian'), IndianFood(image: 'assets/images/food8.jpg', name: 'Indian\nBiryani'), IndianFood(image: 'assets/images/food9.jpg', name: 'Indian\nDosa'), IndianFood(image: 'assets/images/food4.jpg', name: 'Indian\nIdly'), diff --git a/lib/models/restaurant_detail.dart b/lib/models/restaurant_detail.dart new file mode 100644 index 0000000..08fca2c --- /dev/null +++ b/lib/models/restaurant_detail.dart @@ -0,0 +1,110 @@ +import 'package:flutter/foundation.dart'; + +class RestaurantDetail { + final String title; + final String price; + final String image; + final String desc; + + RestaurantDetail({ + @required this.title, + @required this.price, + this.image = '', + this.desc = '', + }); + + static List getBreakfast() { + return [ + RestaurantDetail( + title: 'Idly(2Pcs) (Breakfast)', + price: 'Rs48', + image: 'assets/images/food1.jpg', + desc: + 'A healthy breakfast item and an authentic south indian delicacy! Steamed and fluffy rice cake..more', + ), + RestaurantDetail( + title: 'Sambar Idly (2Pcs)', + image: 'assets/images/food2.jpg', + price: 'Rs70', + ), + RestaurantDetail( + title: 'Ghee Pongal', + image: 'assets/images/food3.jpg', + price: 'Rs85', + desc: + 'Cute, button idlis with authentic. South Indian sambar and coconut chutney gives the per..more', + ), + RestaurantDetail( + title: 'Boori (1Set)', + image: 'assets/images/food4.jpg', + price: 'Rs85', + ), + RestaurantDetail( + title: 'Podi Idly(2Pcs)', + image: 'assets/images/food5.jpg', + price: 'Rs110', + ), + RestaurantDetail( + title: 'Mini Idly with Sambar', + image: 'assets/images/food6.jpg', + price: 'Rs85', + desc: + 'Cute, button idlis with authentic. South Indian sambar and coconut chutney gives the per..more', + ), + ]; + } + + static List getAllTimeFavFoods() { + return [ + RestaurantDetail( + title: 'Plain Dosa', + price: 'Rs30', + desc: + 'A healthy breakfast item and an authentic south indian delicacy!', + ), + RestaurantDetail( + title: 'Rava Dosa', + price: 'Rs70', + ), + RestaurantDetail( + title: 'Onion Dosa', + price: 'Rs85', + desc: + 'Cute, button dosas with authentic. South Indian sambar and coconut chutney gives the per..more', + ), + RestaurantDetail( + title: 'Onion Uttapam', + price: 'Rs85', + ), + RestaurantDetail( + title: 'Tomato Uttapam', + price: 'Rs110', + ), + RestaurantDetail( + title: 'Onion Dosa & Sambar Vadai', + price: 'Rs85', + ), + ]; + } + + static List getOtherDishes() { + return [ + RestaurantDetail( + title: 'Kuzhi Paniyaram Karam (4Pcs)', + price: 'Rs70', + ), + RestaurantDetail( + title: 'Kuzhi Paniyaram Sweet (4Pcs)', + price: 'Rs70', + ), + RestaurantDetail( + title: 'Kuzhi Paniyaram Sweet & Karam (4Pcs)', + price: 'Rs110', + ), + RestaurantDetail( + title: 'Ghee Kuzhi Paniyaram', + price: 'Rs85', + ), + ]; + } +} diff --git a/lib/views/home_bottom_navigation_screen.dart b/lib/views/home_bottom_navigation_screen.dart index aa4111c..f254506 100644 --- a/lib/views/home_bottom_navigation_screen.dart +++ b/lib/views/home_bottom_navigation_screen.dart @@ -1,15 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:swiggy_ui/views/swiggy/meat/meat_screen.dart'; import '../utils/app_colors.dart'; import 'account/account_screen.dart'; import 'cart/cart_screen.dart'; import 'search/search_screen.dart'; -import 'swiggy/all_restaurants/all_restaurants_screen.dart'; -import 'swiggy/genie/genie_screen.dart'; -import 'swiggy/groceries/grocery_screen.dart'; -import 'swiggy/offers/offer_screen.dart'; -import 'swiggy/restaurant_detail_screen.dart'; import 'swiggy/swiggy_screen.dart'; class HomeBottomNavigationScreen extends StatefulWidget { @@ -21,7 +15,7 @@ class HomeBottomNavigationScreen extends StatefulWidget { class _HomeBottomNavigationScreenState extends State { final List _children = [ - RestaurantDetailScreen(), + SwiggyScreen(), SearchScreen(), CartScreen(), AccountScreen(), diff --git a/lib/views/swiggy/all_restaurants/all_restaurants_screen.dart b/lib/views/swiggy/all_restaurants/all_restaurants_screen.dart index 88bb431..196bffb 100644 --- a/lib/views/swiggy/all_restaurants/all_restaurants_screen.dart +++ b/lib/views/swiggy/all_restaurants/all_restaurants_screen.dart @@ -7,7 +7,7 @@ import '../../../utils/ui_helper.dart'; import '../../../widgets/custom_divider_view.dart'; import '../../../widgets/search_food_list_item_view.dart'; import '../groceries/grocery_screen.dart'; -import '../indian_delight_screen.dart'; +import '../indian_food/indian_delight_screen.dart'; import '../offers/offer_screen.dart'; class AllRestaurantsScreen extends StatelessWidget { @@ -154,6 +154,8 @@ class AllRestaurantsScreen extends StatelessWidget { } class _FoodHorizontalListView extends StatelessWidget { + final restaurants = AllRestaurant.getPopularBrands(); + @override Widget build(BuildContext context) { return Container( @@ -161,13 +163,13 @@ class _FoodHorizontalListView extends StatelessWidget { child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, - itemCount: 4, + itemCount: restaurants.length, itemBuilder: (context, index) => Padding( padding: const EdgeInsets.all(10.0), child: Stack( children: [ Image.asset( - 'assets/images/food1.jpg', + restaurants[index].image, height: MediaQuery.of(context).size.height / 4, width: MediaQuery.of(context).size.width / 2, ), @@ -179,12 +181,18 @@ class _FoodHorizontalListView extends StatelessWidget { child: Text('TRY NOW'), ), Positioned( - left: 10.0, - bottom: 10.0, - child: Text( - 'VEGGIE FRIENDLY\nEATERIES', - style: Theme.of(context).textTheme.headline6.copyWith( - color: Colors.white, fontWeight: FontWeight.bold), + bottom: 1.0, + child: Container( + alignment: Alignment.centerLeft, + padding: const EdgeInsets.symmetric(horizontal: 10.0), + height: 70.0, + color: Colors.black38, + width: MediaQuery.of(context).size.width / 2, + child: Text( + restaurants[index].name, + style: Theme.of(context).textTheme.headline6.copyWith( + color: Colors.white, fontWeight: FontWeight.bold), + ), ), ) ], diff --git a/lib/views/swiggy/best_in_safety_view.dart b/lib/views/swiggy/best_in_safety_view.dart index aad31b2..fc0558d 100644 --- a/lib/views/swiggy/best_in_safety_view.dart +++ b/lib/views/swiggy/best_in_safety_view.dart @@ -1,10 +1,9 @@ -import 'dart:math'; - import 'package:flutter/material.dart'; -import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; -import 'package:swiggy_ui/utils/app_colors.dart'; -import 'package:swiggy_ui/utils/ui_helper.dart'; -import 'package:swiggy_ui/widgets/spotlight_best_top_food_item.dart'; + +import '../../models/spotlight_best_top_food.dart'; +import '../../utils/app_colors.dart'; +import '../../utils/ui_helper.dart'; +import '../../widgets/spotlight_best_top_food_item.dart'; class BestInSafetyViews extends StatelessWidget { final restaurants = SpotlightBestTopFood.getBestRestaurants(); @@ -12,57 +11,65 @@ class BestInSafetyViews extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - margin: const EdgeInsets.all(10.0), + margin: const EdgeInsets.symmetric(vertical: 10.0), height: 330.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Icon(Icons.security), - UIHelper.horizontalSpaceExtraSmall(), - Text( - 'Best in Safety', - style: Theme.of(context) - .textTheme - .headline4 - .copyWith(fontSize: 20.0), - ), - Spacer(), - Row( - children: [ - Text( - 'SEE ALL', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(fontWeight: FontWeight.bold), - ), - UIHelper.horizontalSpaceExtraSmall(), - ClipOval( - child: Container( - alignment: Alignment.center, - color: swiggyOrange, - height: 25.0, - width: 25.0, - child: Icon( - Icons.arrow_forward_ios, - size: 12.0, - color: Colors.white, - ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.security), + UIHelper.horizontalSpaceExtraSmall(), + Text( + 'Best in Safety', + style: Theme.of(context) + .textTheme + .headline4 + .copyWith(fontSize: 20.0), ), - ) - ], - ) - ], - ), - UIHelper.verticalSpaceExtraSmall(), - Text( - 'Restaurants with best safety standards', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(color: Colors.grey), + Spacer(), + Row( + children: [ + Text( + 'SEE ALL', + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(fontWeight: FontWeight.bold), + ), + UIHelper.horizontalSpaceExtraSmall(), + ClipOval( + child: Container( + alignment: Alignment.center, + color: swiggyOrange, + height: 25.0, + width: 25.0, + child: Icon( + Icons.arrow_forward_ios, + size: 12.0, + color: Colors.white, + ), + ), + ) + ], + ) + ], + ), + UIHelper.verticalSpaceExtraSmall(), + Text( + 'Restaurants with best safety standards', + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(color: Colors.grey), + ), + ], + ), ), UIHelper.verticalSpaceMedium(), Flexible( diff --git a/lib/views/swiggy/food_groceries_availability_view.dart b/lib/views/swiggy/food_groceries_availability_view.dart index f5e247c..8e3b52b 100644 --- a/lib/views/swiggy/food_groceries_availability_view.dart +++ b/lib/views/swiggy/food_groceries_availability_view.dart @@ -4,7 +4,7 @@ import 'package:swiggy_ui/utils/ui_helper.dart'; import 'package:swiggy_ui/views/swiggy/genie/genie_screen.dart'; import 'all_restaurants/all_restaurants_screen.dart'; -import 'genie_grocery_card_view.dart'; +import 'genie/genie_grocery_card_view.dart'; import 'groceries/grocery_screen.dart'; import 'meat/meat_screen.dart'; diff --git a/lib/views/swiggy/genie_grocery_card_view.dart b/lib/views/swiggy/genie/genie_grocery_card_view.dart similarity index 100% rename from lib/views/swiggy/genie_grocery_card_view.dart rename to lib/views/swiggy/genie/genie_grocery_card_view.dart diff --git a/lib/views/swiggy/genie_view.dart b/lib/views/swiggy/genie/genie_view.dart similarity index 95% rename from lib/views/swiggy/genie_view.dart rename to lib/views/swiggy/genie/genie_view.dart index 0c66dae..478b3e1 100644 --- a/lib/views/swiggy/genie_view.dart +++ b/lib/views/swiggy/genie/genie_view.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:swiggy_ui/utils/app_colors.dart'; -import 'package:swiggy_ui/utils/ui_helper.dart'; -import 'package:swiggy_ui/views/swiggy/genie/genie_screen.dart'; -import 'package:swiggy_ui/widgets/dotted_seperator_view.dart'; + +import '../../../utils/app_colors.dart'; +import '../../../utils/ui_helper.dart'; +import '../../../widgets/dotted_seperator_view.dart'; class GenieView extends StatelessWidget { @override diff --git a/lib/views/swiggy/indian_delight_screen.dart b/lib/views/swiggy/indian_food/indian_delight_screen.dart similarity index 96% rename from lib/views/swiggy/indian_delight_screen.dart rename to lib/views/swiggy/indian_food/indian_delight_screen.dart index 0086c29..4ff1cce 100644 --- a/lib/views/swiggy/indian_delight_screen.dart +++ b/lib/views/swiggy/indian_food/indian_delight_screen.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import '../../utils/ui_helper.dart'; -import 'groceries/grocery_screen.dart'; +import '../../../utils/ui_helper.dart'; +import '../groceries/grocery_screen.dart'; class IndianDelightScreen extends StatelessWidget { @override diff --git a/lib/views/swiggy/indian_food_view.dart b/lib/views/swiggy/indian_food/indian_food_view.dart similarity index 100% rename from lib/views/swiggy/indian_food_view.dart rename to lib/views/swiggy/indian_food/indian_food_view.dart diff --git a/lib/views/swiggy/offer_banner_view.dart b/lib/views/swiggy/offers/offer_banner_view.dart similarity index 96% rename from lib/views/swiggy/offer_banner_view.dart rename to lib/views/swiggy/offers/offer_banner_view.dart index f800d53..84780f6 100644 --- a/lib/views/swiggy/offer_banner_view.dart +++ b/lib/views/swiggy/offers/offer_banner_view.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'groceries/grocery_screen.dart'; +import '../groceries/grocery_screen.dart'; class OfferBannerView extends StatelessWidget { final List images = [ diff --git a/lib/views/swiggy/offers/offer_screen.dart b/lib/views/swiggy/offers/offer_screen.dart index 4f400c3..6c580c9 100644 --- a/lib/views/swiggy/offers/offer_screen.dart +++ b/lib/views/swiggy/offers/offer_screen.dart @@ -5,6 +5,8 @@ import 'package:swiggy_ui/utils/ui_helper.dart'; import 'package:swiggy_ui/widgets/custom_divider_view.dart'; import 'package:swiggy_ui/widgets/food_list_item_view.dart'; +import '../restaurants/restaurant_detail_screen.dart'; + class OffersScreen extends StatelessWidget { @override Widget build(BuildContext context) { @@ -63,8 +65,18 @@ class _RestaurantOfferView extends StatelessWidget { itemCount: 18, itemBuilder: (context, index) => Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), - child: FoodListItemView( - restaurant: foods[index], + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantDetailScreen(), + ), + ); + }, + child: FoodListItemView( + restaurant: foods[index], + ), ), ), ), diff --git a/lib/views/swiggy/popular_brand_view.dart b/lib/views/swiggy/popular_brand_view.dart index 1ef3395..412f0fe 100644 --- a/lib/views/swiggy/popular_brand_view.dart +++ b/lib/views/swiggy/popular_brand_view.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:swiggy_ui/models/popular_brands.dart'; import 'package:swiggy_ui/utils/ui_helper.dart'; +import 'package:swiggy_ui/views/swiggy/restaurants/restaurant_detail_screen.dart'; class PopularBrandsView extends StatelessWidget { final brands = PopularBrands.getPopularBrands(); @@ -22,45 +23,55 @@ class PopularBrandsView extends StatelessWidget { shrinkWrap: true, scrollDirection: Axis.horizontal, itemCount: brands.length, - itemBuilder: (context, index) => Container( - margin: const EdgeInsets.only(right: 15.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey[300], - width: 3.0, + itemBuilder: (context, index) => InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantDetailScreen(), + ), + ); + }, + child: Container( + margin: const EdgeInsets.only(right: 15.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey[300], + width: 3.0, + ), + borderRadius: BorderRadius.circular(40.0), ), - borderRadius: BorderRadius.circular(40.0), - ), - child: ClipOval( - child: Image.asset( - brands[index].image, - height: 80.0, - width: 80.0, - fit: BoxFit.cover, + child: ClipOval( + child: Image.asset( + brands[index].image, + height: 80.0, + width: 80.0, + fit: BoxFit.cover, + ), ), ), - ), - UIHelper.verticalSpaceSmall(), - Text( - brands[index].name, - style: Theme.of(context) - .textTheme - .subtitle2 - .copyWith(fontWeight: FontWeight.w500), - ), - UIHelper.verticalSpace(2.0), - Text( - brands[index].minutes, - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(color: Colors.grey, fontSize: 13.0), - ) - ], + UIHelper.verticalSpaceSmall(), + Text( + brands[index].name, + style: Theme.of(context) + .textTheme + .subtitle2 + .copyWith(fontWeight: FontWeight.w500), + ), + UIHelper.verticalSpace(2.0), + Text( + brands[index].minutes, + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(color: Colors.grey, fontSize: 13.0), + ) + ], + ), ), ), ), diff --git a/lib/views/swiggy/restaurant_detail_screen.dart b/lib/views/swiggy/restaurants/restaurant_detail_screen.dart similarity index 76% rename from lib/views/swiggy/restaurant_detail_screen.dart rename to lib/views/swiggy/restaurants/restaurant_detail_screen.dart index cbbbf39..aa5e92f 100644 --- a/lib/views/swiggy/restaurant_detail_screen.dart +++ b/lib/views/swiggy/restaurants/restaurant_detail_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:swiggy_ui/models/restaurant_detail.dart'; import 'package:swiggy_ui/utils/ui_helper.dart'; import 'package:swiggy_ui/widgets/custom_divider_view.dart'; import 'package:swiggy_ui/widgets/veg_badge_view.dart'; @@ -10,6 +11,7 @@ class RestaurantDetailScreen extends StatelessWidget { length: 2, child: Scaffold( appBar: AppBar( + title: Text('Namma Veedu Vasanta Bhavan'), actions: [ Icon(Icons.favorite_border), UIHelper.horizontalSpaceSmall(), @@ -125,7 +127,20 @@ class _OrderNowView extends StatelessWidget { ), _RecommendedFoodView(), CustomDividerView(dividerHeight: 15.0), - _BreakFastView() + _FoodListView( + title: 'Breakfast', + foods: RestaurantDetail.getBreakfast(), + ), + CustomDividerView(dividerHeight: 15.0), + _FoodListView( + title: 'All Time Favourite', + foods: RestaurantDetail.getAllTimeFavFoods(), + ), + CustomDividerView(dividerHeight: 15.0), + _FoodListView( + title: 'Kozhukattaiyum & Paniyarams', + foods: RestaurantDetail.getOtherDishes(), + ) ], ), ), @@ -179,6 +194,8 @@ class _OrderNowView extends StatelessWidget { } class _RecommendedFoodView extends StatelessWidget { + final foods = RestaurantDetail.getBreakfast(); + @override Widget build(BuildContext context) { return Container( @@ -189,7 +206,7 @@ class _RecommendedFoodView extends StatelessWidget { childAspectRatio: 0.8, physics: NeverScrollableScrollPhysics(), children: List.generate( - 5, + foods.length, (index) => Container( margin: const EdgeInsets.all(10.0), child: Column( @@ -197,13 +214,13 @@ class _RecommendedFoodView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Image.asset( - 'assets/images/food1.jpg', + foods[index].image, height: 130.0, fit: BoxFit.fill, ), UIHelper.verticalSpaceExtraSmall(), Column( - mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -220,7 +237,7 @@ class _RecommendedFoodView extends StatelessWidget { UIHelper.horizontalSpaceExtraSmall(), Flexible( child: Text( - 'Idly (2pc) with Chatney', + foods[index].title, style: Theme.of(context) .textTheme .subtitle2 @@ -230,10 +247,11 @@ class _RecommendedFoodView extends StatelessWidget { ], ), UIHelper.verticalSpaceMedium(), + // Spacer(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Rs48', + Text(foods[index].price, style: Theme.of(context) .textTheme .bodyText1 @@ -273,47 +291,82 @@ class AddBtnView extends StatelessWidget { } } -class _BreakFastView extends StatelessWidget { +class _FoodListView extends StatelessWidget { + final String title; + final List foods; + + const _FoodListView({ + Key key, + @required this.title, + @required this.foods, + }) : super(key: key); + @override Widget build(BuildContext context) { return Container( padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), child: Column( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ + UIHelper.verticalSpaceMedium(), Text( - 'Breakfast', + title, style: Theme.of(context).textTheme.subtitle2.copyWith(fontSize: 18.0), ), ListView.builder( shrinkWrap: true, - itemCount: 10, + itemCount: foods.length, + physics: NeverScrollableScrollPhysics(), itemBuilder: (context, index) => Container( padding: const EdgeInsets.symmetric(vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + UIHelper.verticalSpaceSmall(), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ VegBadgeView(), - UIHelper.horizontalSpaceSmall(), - Text( - 'Idly (2pc) Breakfast', - style: Theme.of(context).textTheme.bodyText1, + UIHelper.horizontalSpaceMedium(), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + foods[index].title, + style: Theme.of(context).textTheme.bodyText1, + ), + UIHelper.verticalSpaceSmall(), + Text( + foods[index].price, + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(fontSize: 14.0), + ), + UIHelper.verticalSpaceMedium(), + foods[index].desc != null + ? Text( + foods[index].desc, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith( + fontSize: 12.0, + color: Colors.grey[500], + ), + ) + : SizedBox(), + ], + ), ), - Spacer(), AddBtnView() ], ), - Text( - 'Rs 48', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(fontSize: 14.0), - ), ], ), ), diff --git a/lib/views/swiggy/restaurant_vertical_list_view.dart b/lib/views/swiggy/restaurants/restaurant_vertical_list_view.dart similarity index 74% rename from lib/views/swiggy/restaurant_vertical_list_view.dart rename to lib/views/swiggy/restaurants/restaurant_vertical_list_view.dart index 48f9d9f..a52a920 100644 --- a/lib/views/swiggy/restaurant_vertical_list_view.dart +++ b/lib/views/swiggy/restaurants/restaurant_vertical_list_view.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; import 'package:swiggy_ui/widgets/food_list_item_view.dart'; -import '../../models/spotlight_best_top_food.dart'; -import '../../utils/ui_helper.dart'; -import '../../widgets/food_list_item_view.dart'; +import '../../../models/spotlight_best_top_food.dart'; +import '../../../utils/ui_helper.dart'; +import '../../../widgets/food_list_item_view.dart'; +import 'restaurant_detail_screen.dart'; class RestaurantVerticalListView extends StatelessWidget { final String title; @@ -51,8 +52,18 @@ class RestaurantVerticalListView extends StatelessWidget { shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemCount: restaurants.length, - itemBuilder: (context, index) => FoodListItemView( - restaurant: restaurants[index], + itemBuilder: (context, index) => InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantDetailScreen(), + ), + ); + }, + child: FoodListItemView( + restaurant: restaurants[index], + ), ), ), ], diff --git a/lib/views/swiggy/swiggy_screen.dart b/lib/views/swiggy/swiggy_screen.dart index 6787559..e37f7e1 100644 --- a/lib/views/swiggy/swiggy_screen.dart +++ b/lib/views/swiggy/swiggy_screen.dart @@ -1,19 +1,20 @@ import 'package:flutter/material.dart'; -import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; -import 'package:swiggy_ui/utils/app_colors.dart'; -import 'package:swiggy_ui/views/swiggy/offers/offer_screen.dart'; +import '../../models/spotlight_best_top_food.dart'; +import '../../utils/app_colors.dart'; import '../../utils/ui_helper.dart'; import '../../widgets/custom_divider_view.dart'; +import 'all_restaurants/all_restaurants_screen.dart'; import 'best_in_safety_view.dart'; import 'food_groceries_availability_view.dart'; -import 'genie_view.dart'; +import 'genie/genie_view.dart'; import 'in_the_spotlight_view.dart'; -import 'indian_food_view.dart'; -import 'offer_banner_view.dart'; +import 'indian_food/indian_food_view.dart'; +import 'offers/offer_banner_view.dart'; +import 'offers/offer_screen.dart'; import 'popular_brand_view.dart'; import 'popular_categories_view.dart'; -import 'restaurant_vertical_list_view.dart'; +import 'restaurants/restaurant_vertical_list_view.dart'; import 'swiggy_safety_banner_view.dart'; import 'top_offer_view.dart'; import 'top_picks_for_you_view.dart'; @@ -78,7 +79,14 @@ class SwiggyScreen extends StatelessWidget { .subtitle2 .copyWith(color: Colors.white, fontSize: 19.0), ), - onPressed: () {}, + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AllRestaurantsScreen(), + ), + ); + }, ), ), Container( diff --git a/lib/views/swiggy/top_offer_view.dart b/lib/views/swiggy/top_offer_view.dart index 5bd3de4..f138e53 100644 --- a/lib/views/swiggy/top_offer_view.dart +++ b/lib/views/swiggy/top_offer_view.dart @@ -11,57 +11,65 @@ class TopOffersViews extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - margin: const EdgeInsets.all(10.0), + margin: const EdgeInsets.symmetric(vertical: 10.0), height: 330.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Icon(Icons.security), - UIHelper.horizontalSpaceExtraSmall(), - Text( - 'Top Offers', - style: Theme.of(context) - .textTheme - .headline4 - .copyWith(fontSize: 20.0), - ), - Spacer(), - Row( - children: [ - Text( - 'SEE ALL', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(fontWeight: FontWeight.bold), - ), - UIHelper.horizontalSpaceExtraSmall(), - ClipOval( - child: Container( - alignment: Alignment.center, - color: swiggyOrange, - height: 25.0, - width: 25.0, - child: Icon( - Icons.arrow_forward_ios, - size: 12.0, - color: Colors.white, - ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.security), + UIHelper.horizontalSpaceExtraSmall(), + Text( + 'Top Offers', + style: Theme.of(context) + .textTheme + .headline4 + .copyWith(fontSize: 20.0), ), - ) - ], - ) - ], - ), - UIHelper.verticalSpaceExtraSmall(), - Text( - 'Get 20-50% Off', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(color: Colors.grey), + Spacer(), + Row( + children: [ + Text( + 'SEE ALL', + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(fontWeight: FontWeight.bold), + ), + UIHelper.horizontalSpaceExtraSmall(), + ClipOval( + child: Container( + alignment: Alignment.center, + color: swiggyOrange, + height: 25.0, + width: 25.0, + child: Icon( + Icons.arrow_forward_ios, + size: 12.0, + color: Colors.white, + ), + ), + ) + ], + ) + ], + ), + UIHelper.verticalSpaceExtraSmall(), + Text( + 'Get 20-50% Off', + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(color: Colors.grey), + ), + ], + ), ), UIHelper.verticalSpaceMedium(), Flexible( @@ -85,70 +93,4 @@ class TopOffersViews extends StatelessWidget { ), ); } - - Container _buildSpotlightFoodListItem(BuildContext context) => Container( - margin: const EdgeInsets.all(15.0), - child: Row( - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.grey, - blurRadius: 2.0, - ) - ], - ), - child: Image.asset( - 'assets/images/food2.jpg', - height: 100.0, - width: 100.0, - fit: BoxFit.cover, - ), - ), - UIHelper.horizontalSpaceSmall(), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Breakfast Express', - style: Theme.of(context) - .textTheme - .subtitle2 - .copyWith(fontSize: 18.0), - ), - Text('Continental, North Indian, South Indian', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(color: Colors.grey[800], fontSize: 13.5)), - UIHelper.verticalSpaceSmall(), - Text( - '20 % off | Use JUMBO', - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(color: Colors.red[900], fontSize: 13.0), - ), - UIHelper.verticalSpaceExtraSmall(), - Divider(), - UIHelper.verticalSpaceExtraSmall(), - Row( - children: [ - Icon( - Icons.star, - size: 14.0, - color: Colors.grey[600], - ), - Text('4.1 - 45 mins - Rs200 for two') - ], - ) - ], - ) - ], - ), - ); } diff --git a/lib/views/swiggy/top_picks_for_you_view.dart b/lib/views/swiggy/top_picks_for_you_view.dart index 8064db7..7241ef9 100644 --- a/lib/views/swiggy/top_picks_for_you_view.dart +++ b/lib/views/swiggy/top_picks_for_you_view.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:swiggy_ui/models/top_picks_food.dart'; import 'package:swiggy_ui/utils/ui_helper.dart'; +import 'package:swiggy_ui/views/swiggy/restaurants/restaurant_detail_screen.dart'; class TopPicksForYouView extends StatelessWidget { final foods = TopPicksFood.getTopPicksfoods(); @@ -31,49 +32,59 @@ class TopPicksForYouView extends StatelessWidget { shrinkWrap: true, scrollDirection: Axis.horizontal, itemCount: foods.length, - itemBuilder: (context, index) => Container( - margin: const EdgeInsets.all(10.0), - width: 100.0, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - boxShadow: [ - BoxShadow( - color: Colors.grey, - blurRadius: 2.0, - ) - ], + itemBuilder: (context, index) => InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantDetailScreen(), + ), + ); + }, + child: Container( + margin: const EdgeInsets.all(10.0), + width: 100.0, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 2.0, + ) + ], + ), + child: Image.asset( + foods[index].image, + width: 100.0, + height: 100.0, + fit: BoxFit.cover, + ), ), - child: Image.asset( - foods[index].image, - width: 100.0, - height: 100.0, - fit: BoxFit.cover, + UIHelper.verticalSpaceSmall(), + Flexible( + child: Text( + foods[index].name, + style: Theme.of(context).textTheme.subtitle2.copyWith( + fontSize: 14.0, + fontWeight: FontWeight.w600, + ), + ), ), - ), - UIHelper.verticalSpaceSmall(), - Flexible( - child: Text( - foods[index].name, - style: Theme.of(context).textTheme.subtitle2.copyWith( - fontSize: 14.0, - fontWeight: FontWeight.w600, + UIHelper.verticalSpaceExtraSmall(), + Text( + foods[index].minutes, + style: Theme.of(context).textTheme.bodyText1.copyWith( + color: Colors.grey[700], + fontSize: 13.0, ), - ), - ), - UIHelper.verticalSpaceExtraSmall(), - Text( - foods[index].minutes, - style: Theme.of(context).textTheme.bodyText1.copyWith( - color: Colors.grey[700], - fontSize: 13.0, - ), - ) - ], + ) + ], + ), ), ), ), diff --git a/lib/widgets/spotlight_best_top_food_item.dart b/lib/widgets/spotlight_best_top_food_item.dart index 6de9151..33824a3 100644 --- a/lib/widgets/spotlight_best_top_food_item.dart +++ b/lib/widgets/spotlight_best_top_food_item.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; import 'package:swiggy_ui/utils/ui_helper.dart'; +import 'package:swiggy_ui/views/swiggy/restaurants/restaurant_detail_screen.dart'; class SpotlightBestTopFoodItem extends StatelessWidget { final SpotlightBestTopFood restaurant; @@ -12,70 +13,80 @@ class SpotlightBestTopFoodItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - margin: const EdgeInsets.all(15.0), - child: Row( - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.grey, - blurRadius: 2.0, - ) - ], - ), - child: Image.asset( - restaurant.image, - height: 100.0, - width: 100.0, - fit: BoxFit.cover, - ), + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantDetailScreen(), ), - UIHelper.horizontalSpaceSmall(), - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - restaurant.name, - style: Theme.of(context) - .textTheme - .subtitle2 - .copyWith(fontSize: 18.0), + ); + }, + child: Container( + margin: const EdgeInsets.all(15.0), + child: Row( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 2.0, + ) + ], + ), + child: Image.asset( + restaurant.image, + height: 100.0, + width: 100.0, + fit: BoxFit.cover, ), - Text(restaurant.desc, + ), + UIHelper.horizontalSpaceSmall(), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + restaurant.name, + style: Theme.of(context) + .textTheme + .subtitle2 + .copyWith(fontSize: 18.0), + ), + Text(restaurant.desc, + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(color: Colors.grey[800], fontSize: 13.5)), + UIHelper.verticalSpaceSmall(), + Text( + restaurant.coupon, style: Theme.of(context) .textTheme .bodyText1 - .copyWith(color: Colors.grey[800], fontSize: 13.5)), - UIHelper.verticalSpaceSmall(), - Text( - restaurant.coupon, - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(color: Colors.red[900], fontSize: 13.0), - ), - UIHelper.verticalSpaceExtraSmall(), - Divider(), - UIHelper.verticalSpaceExtraSmall(), - Row( - children: [ - Icon( - Icons.star, - size: 14.0, - color: Colors.grey[600], - ), - Text(restaurant.ratingTimePrice) - ], - ) - ], - ) - ], + .copyWith(color: Colors.red[900], fontSize: 13.0), + ), + UIHelper.verticalSpaceExtraSmall(), + Divider(), + UIHelper.verticalSpaceExtraSmall(), + Row( + children: [ + Icon( + Icons.star, + size: 14.0, + color: Colors.grey[600], + ), + Text(restaurant.ratingTimePrice) + ], + ) + ], + ) + ], + ), ), ); } diff --git a/screenshots/account1.jpg b/screenshots/account1.jpg new file mode 100755 index 0000000..270f1dd Binary files /dev/null and b/screenshots/account1.jpg differ diff --git a/screenshots/account2.jpg b/screenshots/account2.jpg new file mode 100755 index 0000000..0533c34 Binary files /dev/null and b/screenshots/account2.jpg differ diff --git a/screenshots/all-restaurant1.jpg b/screenshots/all-restaurant1.jpg new file mode 100755 index 0000000..97b0c66 Binary files /dev/null and b/screenshots/all-restaurant1.jpg differ diff --git a/screenshots/all-restaurant2.jpg b/screenshots/all-restaurant2.jpg new file mode 100755 index 0000000..2cb0b98 Binary files /dev/null and b/screenshots/all-restaurant2.jpg differ diff --git a/screenshots/all-restaurant3.jpg b/screenshots/all-restaurant3.jpg new file mode 100755 index 0000000..56c6f3c Binary files /dev/null and b/screenshots/all-restaurant3.jpg differ diff --git a/screenshots/all-restaurant4.jpg b/screenshots/all-restaurant4.jpg new file mode 100755 index 0000000..a91c624 Binary files /dev/null and b/screenshots/all-restaurant4.jpg differ diff --git a/screenshots/cart1.jpg b/screenshots/cart1.jpg new file mode 100755 index 0000000..1b1938d Binary files /dev/null and b/screenshots/cart1.jpg differ diff --git a/screenshots/cart2.jpg b/screenshots/cart2.jpg new file mode 100755 index 0000000..a36c5bf Binary files /dev/null and b/screenshots/cart2.jpg differ diff --git a/screenshots/genie.jpg b/screenshots/genie.jpg new file mode 100755 index 0000000..3b0137a Binary files /dev/null and b/screenshots/genie.jpg differ diff --git a/screenshots/grocery.jpg b/screenshots/grocery.jpg new file mode 100755 index 0000000..a77dd95 Binary files /dev/null and b/screenshots/grocery.jpg differ diff --git a/screenshots/indian-food.jpg b/screenshots/indian-food.jpg new file mode 100755 index 0000000..f2e00c2 Binary files /dev/null and b/screenshots/indian-food.jpg differ diff --git a/screenshots/meat.jpg b/screenshots/meat.jpg new file mode 100755 index 0000000..8bf9850 Binary files /dev/null and b/screenshots/meat.jpg differ diff --git a/screenshots/offers1.jpg b/screenshots/offers1.jpg new file mode 100755 index 0000000..2098bde Binary files /dev/null and b/screenshots/offers1.jpg differ diff --git a/screenshots/offers2.jpg b/screenshots/offers2.jpg new file mode 100755 index 0000000..967429a Binary files /dev/null and b/screenshots/offers2.jpg differ diff --git a/screenshots/restaurant-detail1.jpg b/screenshots/restaurant-detail1.jpg new file mode 100755 index 0000000..c22600a Binary files /dev/null and b/screenshots/restaurant-detail1.jpg differ diff --git a/screenshots/restaurant-detail2.jpg b/screenshots/restaurant-detail2.jpg new file mode 100755 index 0000000..9ce18ac Binary files /dev/null and b/screenshots/restaurant-detail2.jpg differ diff --git a/screenshots/search.jpg b/screenshots/search.jpg new file mode 100755 index 0000000..758c896 Binary files /dev/null and b/screenshots/search.jpg differ diff --git a/screenshots/swiggy1.jpg b/screenshots/swiggy1.jpg new file mode 100755 index 0000000..6a96277 Binary files /dev/null and b/screenshots/swiggy1.jpg differ diff --git a/screenshots/swiggy2.jpg b/screenshots/swiggy2.jpg new file mode 100755 index 0000000..2b1e7d1 Binary files /dev/null and b/screenshots/swiggy2.jpg differ diff --git a/screenshots/swiggy3.jpg b/screenshots/swiggy3.jpg new file mode 100755 index 0000000..ce93a38 Binary files /dev/null and b/screenshots/swiggy3.jpg differ diff --git a/screenshots/swiggy4.jpg b/screenshots/swiggy4.jpg new file mode 100755 index 0000000..4c04534 Binary files /dev/null and b/screenshots/swiggy4.jpg differ diff --git a/screenshots/swiggy5.jpg b/screenshots/swiggy5.jpg new file mode 100755 index 0000000..30d6b26 Binary files /dev/null and b/screenshots/swiggy5.jpg differ diff --git a/screenshots/swiggy6.jpg b/screenshots/swiggy6.jpg new file mode 100755 index 0000000..ecc0c76 Binary files /dev/null and b/screenshots/swiggy6.jpg differ diff --git a/screenshots/swiggy7.jpg b/screenshots/swiggy7.jpg new file mode 100755 index 0000000..7653eea Binary files /dev/null and b/screenshots/swiggy7.jpg differ diff --git a/screenshots/swiggy8.jpg b/screenshots/swiggy8.jpg new file mode 100755 index 0000000..4ba5e0d Binary files /dev/null and b/screenshots/swiggy8.jpg differ