Skip to content

Commit

Permalink
Update to dart null-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothvino42 committed Jun 8, 2021
1 parent 9c14d5d commit 687c47d
Show file tree
Hide file tree
Showing 48 changed files with 400 additions and 333 deletions.
11 changes: 5 additions & 6 deletions lib/models/all_restaurant.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import 'package:flutter/foundation.dart';
import 'package:swiggy_ui/models/spotlight_best_top_food.dart';

import 'indian_food.dart';

class AllRestaurant {
const AllRestaurant({
@required this.image,
@required this.name,
required this.image,
required this.name,
});

final String image;
Expand Down Expand Up @@ -187,9 +186,9 @@ class AllRestaurant {

class LargeRestaurantBanner {
const LargeRestaurantBanner({
@required this.image,
@required this.title,
@required this.subtitle,
required this.image,
required this.title,
required this.subtitle,
});

final String image;
Expand Down
29 changes: 17 additions & 12 deletions lib/models/available_coupon.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:flutter/foundation.dart';

class AvailableCoupon {
const AvailableCoupon({
@required this.coupon,
@required this.discount,
@required this.desc,
required this.coupon,
required this.discount,
required this.desc,
});

final String coupon;
Expand All @@ -16,37 +14,44 @@ class AvailableCoupon {
AvailableCoupon(
coupon: '100INDUSIND',
discount: 'Get 20 % discount using Induslnd Bank Credit Cards',
desc: 'Use code 100INDUSIND & get 20 % discount up to Rs100 on orders above Rs400',
desc:
'Use code 100INDUSIND & get 20 % discount up to Rs100 on orders above Rs400',
),
AvailableCoupon(
coupon: 'HSBC500',
discount: 'Get 15 % discount using HSBC Bank Credit Cards',
desc: 'Use code HSBC500 & get 14 % discount up to Rs125 on orders above Rs500',
desc:
'Use code HSBC500 & get 14 % discount up to Rs125 on orders above Rs500',
),
AvailableCoupon(
coupon: '100TMB',
discount: 'Get 20 % discount using TMB Bank Credit Cards',
desc: 'Use code 100TMB & get 20 % discount up to Rs100 on orders above Rs400',
desc:
'Use code 100TMB & get 20 % discount up to Rs100 on orders above Rs400',
),
AvailableCoupon(
coupon: 'INDUSIND20',
discount: 'Get 20 % discount using Induslnd Bank Credit Cards',
desc: 'Use code INDUSIND20 & get 20 % discount up to Rs200 on orders above Rs600',
desc:
'Use code INDUSIND20 & get 20 % discount up to Rs200 on orders above Rs600',
),
AvailableCoupon(
coupon: 'HSBC5100',
discount: 'Get 20 % discount using Induslnd Bank Credit Cards',
desc: 'Use code HSBC5100 & get 20 % discount up to Rs100 on orders above Rs400',
desc:
'Use code HSBC5100 & get 20 % discount up to Rs100 on orders above Rs400',
),
AvailableCoupon(
coupon: '100AXIS',
discount: 'Get 20 % discount using Axis Bank Credit Cards',
desc: 'Use code 100AXIS & get 20 % discount up to Rs100 on orders above Rs400',
desc:
'Use code 100AXIS & get 20 % discount up to Rs100 on orders above Rs400',
),
AvailableCoupon(
coupon: '100INDUSIND',
discount: 'Get 20 % discount using Induslnd Bank Credit Cards',
desc: 'Use code 100INDUSIND & get 20 % discount up to Rs100 on orders above Rs400',
desc:
'Use code 100INDUSIND & get 20 % discount up to Rs100 on orders above Rs400',
),
];
}
Expand Down
6 changes: 2 additions & 4 deletions lib/models/genie.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:flutter/foundation.dart';

class Genie {
const Genie({
@required this.image,
@required this.title,
required this.image,
required this.title,
});

final String image;
Expand Down
6 changes: 2 additions & 4 deletions lib/models/indian_food.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:flutter/foundation.dart';

class IndianFood {
const IndianFood({
@required this.image,
@required this.name,
required this.image,
required this.name,
});

final String image;
Expand Down
49 changes: 35 additions & 14 deletions lib/models/popular_brands.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:flutter/foundation.dart';

class PopularBrands {
const PopularBrands({
@required this.image,
@required this.name,
@required this.minutes,
required this.image,
required this.name,
required this.minutes,
});

final String image;
Expand All @@ -13,15 +11,38 @@ class PopularBrands {

static List<PopularBrands> getPopularBrands() {
return const [
PopularBrands(image: 'assets/images/food5.jpg', name: 'Sangeetha', minutes: '42 mins'),
PopularBrands(image: 'assets/images/food4.jpg', name: 'Thalappakati', minutes: '32 mins'),
PopularBrands(image: 'assets/images/food1.jpg', name: 'Subway', minutes: '26 mins'),
PopularBrands(image: 'assets/images/food2.jpg', name: 'Chai Kings', minutes: '38 mins'),
PopularBrands(image: 'assets/images/food3.jpg', name: 'BBQ Nation', minutes: '53 mins'),
PopularBrands(image: 'assets/images/food4.jpg', name: 'A2B Chennai', minutes: '22 mins'),
PopularBrands(image: 'assets/images/food6.jpg', name: 'KFC', minutes: '13 mins'),
PopularBrands(image: 'assets/images/food7.jpg', name: 'Aasife Biryani', minutes: '31 mins'),
PopularBrands(image: 'assets/images/food8.jpg', name: 'Chennai Biryani', minutes: '44 mins'),
PopularBrands(
image: 'assets/images/food5.jpg',
name: 'Sangeetha',
minutes: '42 mins'),
PopularBrands(
image: 'assets/images/food4.jpg',
name: 'Thalappakati',
minutes: '32 mins'),
PopularBrands(
image: 'assets/images/food1.jpg', name: 'Subway', minutes: '26 mins'),
PopularBrands(
image: 'assets/images/food2.jpg',
name: 'Chai Kings',
minutes: '38 mins'),
PopularBrands(
image: 'assets/images/food3.jpg',
name: 'BBQ Nation',
minutes: '53 mins'),
PopularBrands(
image: 'assets/images/food4.jpg',
name: 'A2B Chennai',
minutes: '22 mins'),
PopularBrands(
image: 'assets/images/food6.jpg', name: 'KFC', minutes: '13 mins'),
PopularBrands(
image: 'assets/images/food7.jpg',
name: 'Aasife Biryani',
minutes: '31 mins'),
PopularBrands(
image: 'assets/images/food8.jpg',
name: 'Chennai Biryani',
minutes: '44 mins'),
];
}
}
6 changes: 2 additions & 4 deletions lib/models/popular_category.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:flutter/foundation.dart';

class PopularCategory {
const PopularCategory({
@required this.image,
@required this.name,
required this.image,
required this.name,
});

final String image;
Expand Down
21 changes: 12 additions & 9 deletions lib/models/restaurant_detail.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:flutter/foundation.dart';

class RestaurantDetail {
const RestaurantDetail({
@required this.title,
@required this.price,
required this.title,
required this.price,
this.image = '',
this.desc = '',
});
Expand All @@ -19,7 +17,8 @@ class 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',
desc:
'A healthy breakfast item and an authentic south indian delicacy! Steamed and fluffy rice cake..more',
),
RestaurantDetail(
title: 'Sambar Idly (2Pcs)',
Expand All @@ -30,7 +29,8 @@ class 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',
desc:
'Cute, button idlis with authentic. South Indian sambar and coconut chutney gives the per..more',
),
RestaurantDetail(
title: 'Boori (1Set)',
Expand All @@ -46,7 +46,8 @@ class 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',
desc:
'Cute, button idlis with authentic. South Indian sambar and coconut chutney gives the per..more',
),
];
}
Expand All @@ -56,7 +57,8 @@ class RestaurantDetail {
RestaurantDetail(
title: 'Plain Dosa',
price: 'Rs30',
desc: 'A healthy breakfast item and an authentic south indian delicacy!',
desc:
'A healthy breakfast item and an authentic south indian delicacy!',
),
RestaurantDetail(
title: 'Rava Dosa',
Expand All @@ -65,7 +67,8 @@ class RestaurantDetail {
RestaurantDetail(
title: 'Onion Dosa',
price: 'Rs85',
desc: 'Cute, button dosas with authentic. South Indian sambar and coconut chutney gives the per..more',
desc:
'Cute, button dosas with authentic. South Indian sambar and coconut chutney gives the per..more',
),
RestaurantDetail(
title: 'Onion Uttapam',
Expand Down
12 changes: 5 additions & 7 deletions lib/models/spotlight_best_top_food.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import 'package:flutter/foundation.dart';

class SpotlightBestTopFood {
const SpotlightBestTopFood({
@required this.image,
@required this.name,
@required this.desc,
@required this.coupon,
@required this.ratingTimePrice,
required this.image,
required this.name,
required this.desc,
required this.coupon,
required this.ratingTimePrice,
});

final String image;
Expand Down
5 changes: 2 additions & 3 deletions lib/models/tab_desktop/menu.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

class Menu {
const Menu({
@required this.icon,
@required this.title,
required this.icon,
required this.title,
});

final IconData icon;
Expand Down
10 changes: 4 additions & 6 deletions lib/models/tab_desktop/order_menu.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'package:flutter/foundation.dart';

class OrderMenu {
const OrderMenu({
@required this.image,
@required this.title,
@required this.quantity,
@required this.price,
required this.image,
required this.title,
required this.quantity,
required this.price,
});

final String image;
Expand Down
58 changes: 43 additions & 15 deletions lib/models/top_picks_food.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:flutter/foundation.dart';

class TopPicksFood {
const TopPicksFood({
@required this.image,
@required this.name,
@required this.minutes,
required this.image,
required this.name,
required this.minutes,
});

final String image;
Expand All @@ -13,16 +11,46 @@ class TopPicksFood {

static List<TopPicksFood> getTopPicksfoods() {
return const [
TopPicksFood(image: 'assets/images/food5.jpg', name: 'Murugan Idli Shop', minutes: '42 mins'),
TopPicksFood(image: 'assets/images/food4.jpg', name: 'Thalappakati Biryani Hotel', minutes: '32 mins'),
TopPicksFood(image: 'assets/images/food1.jpg', name: 'Sangeetha', minutes: '26 mins'),
TopPicksFood(image: 'assets/images/food2.jpg', name: 'Hotel Chennai', minutes: '38 mins'),
TopPicksFood(image: 'assets/images/food3.jpg', name: 'Shri Balaajee', minutes: '53 mins'),
TopPicksFood(image: 'assets/images/food4.jpg', name: 'Namma Veedu Vasantha', minutes: '22 mins'),
TopPicksFood(image: 'assets/images/food6.jpg', name: 'SK Parota Stall', minutes: '13 mins'),
TopPicksFood(image: 'assets/images/food7.jpg', name: 'Aasife Biryani', minutes: '31 mins'),
TopPicksFood(image: 'assets/images/food8.jpg', name: 'Jesus Fast Food', minutes: '44 mins'),
TopPicksFood(image: 'assets/images/food9.jpg', name: 'Ananda Bhavan', minutes: '55 mins'),
TopPicksFood(
image: 'assets/images/food5.jpg',
name: 'Murugan Idli Shop',
minutes: '42 mins'),
TopPicksFood(
image: 'assets/images/food4.jpg',
name: 'Thalappakati Biryani Hotel',
minutes: '32 mins'),
TopPicksFood(
image: 'assets/images/food1.jpg',
name: 'Sangeetha',
minutes: '26 mins'),
TopPicksFood(
image: 'assets/images/food2.jpg',
name: 'Hotel Chennai',
minutes: '38 mins'),
TopPicksFood(
image: 'assets/images/food3.jpg',
name: 'Shri Balaajee',
minutes: '53 mins'),
TopPicksFood(
image: 'assets/images/food4.jpg',
name: 'Namma Veedu Vasantha',
minutes: '22 mins'),
TopPicksFood(
image: 'assets/images/food6.jpg',
name: 'SK Parota Stall',
minutes: '13 mins'),
TopPicksFood(
image: 'assets/images/food7.jpg',
name: 'Aasife Biryani',
minutes: '31 mins'),
TopPicksFood(
image: 'assets/images/food8.jpg',
name: 'Jesus Fast Food',
minutes: '44 mins'),
TopPicksFood(
image: 'assets/images/food9.jpg',
name: 'Ananda Bhavan',
minutes: '55 mins'),
];
}
}
4 changes: 2 additions & 2 deletions lib/utils/app_colors.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';

const Color appColor = Colors.orange;
Color darkOrange = Colors.deepOrange[800];
Color swiggyOrange = Colors.orange[900];
Color? darkOrange = Colors.deepOrange[800];
Color? swiggyOrange = Colors.orange[900];
Loading

0 comments on commit 687c47d

Please sign in to comment.