refactor: remove unused files
parent
433a758771
commit
9cb7907ab7
|
|
@ -28,3 +28,7 @@ linter:
|
|||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
|
||||
analyzer:
|
||||
errors:
|
||||
unused_import: error
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
class AddressModel {
|
||||
late int id;
|
||||
late String title;
|
||||
late String recipientName;
|
||||
late String phoneNumber;
|
||||
late String addressLine1;
|
||||
late String addressLine2;
|
||||
late String state;
|
||||
late String postalCode;
|
||||
late bool defaultAddress;
|
||||
|
||||
AddressModel({required this.id, required this.title, required this.recipientName, required this.phoneNumber, required this.addressLine1, required this.addressLine2, required this.state, required this.postalCode, required this.defaultAddress});
|
||||
}
|
||||
|
||||
List<AddressModel> addressData = [
|
||||
AddressModel(
|
||||
id: 1,
|
||||
title: 'Home Address',
|
||||
recipientName: 'Robert Steven',
|
||||
phoneNumber: '0811888999',
|
||||
addressLine1: '6019 Madison St',
|
||||
addressLine2: 'West New York, NJ',
|
||||
state: 'USA',
|
||||
postalCode: '07093',
|
||||
defaultAddress: true
|
||||
),
|
||||
AddressModel(
|
||||
id: 2,
|
||||
title: 'Apartment Address',
|
||||
recipientName: 'Robert Steven',
|
||||
phoneNumber: '0811888999',
|
||||
addressLine1: 'Meridia Park Avenue Apartments',
|
||||
addressLine2: '6035 Park Ave, West New York, NJ',
|
||||
state: 'USA',
|
||||
postalCode: '07093',
|
||||
defaultAddress: false
|
||||
),
|
||||
AddressModel(
|
||||
id: 3,
|
||||
title: 'Office Address',
|
||||
recipientName: 'Robert Steven',
|
||||
phoneNumber: '0811888999',
|
||||
addressLine1: '6015 Van Buren Pl',
|
||||
addressLine2: 'West New York, NJ',
|
||||
state: 'USA',
|
||||
postalCode: '07093',
|
||||
defaultAddress: false
|
||||
),
|
||||
AddressModel(
|
||||
id: 4,
|
||||
title: 'Mom Address',
|
||||
recipientName: 'Stephanie',
|
||||
phoneNumber: '0811564855',
|
||||
addressLine1: '7503 2nd Ave',
|
||||
addressLine2: 'North Bergen, NJ',
|
||||
state: 'USA',
|
||||
postalCode: '07047',
|
||||
defaultAddress: false
|
||||
),
|
||||
AddressModel(
|
||||
id: 5,
|
||||
title: 'Anthony Address',
|
||||
recipientName: 'Anthony Daniel',
|
||||
phoneNumber: '0811118997',
|
||||
addressLine1: '223-201 62nd St',
|
||||
addressLine2: 'West New York, NJ',
|
||||
state: 'USA',
|
||||
postalCode: '07093',
|
||||
defaultAddress: false
|
||||
),
|
||||
];
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class CategoryAllProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
late int sale;
|
||||
late String location;
|
||||
|
||||
CategoryAllProductModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review,
|
||||
required this.sale,
|
||||
required this.location});
|
||||
}
|
||||
|
||||
List<CategoryAllProductModel> categoryAllProductData = [
|
||||
CategoryAllProductModel(
|
||||
id: 1,
|
||||
name: 'New imac 2017 MNEA2 5K retina /3,5GHZ/i5/8GB/1TB/RP575',
|
||||
price: 1643,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/44.jpg',
|
||||
rating: 5,
|
||||
review: 2,
|
||||
sale: 3,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 2,
|
||||
name: 'iPhone SE 2020',
|
||||
price: 399,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/78.png',
|
||||
rating: 5,
|
||||
review: 219,
|
||||
sale: 23,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 3,
|
||||
name: 'IWO 8 Smart Watch Apple iWatch Mirror For Android iPhone',
|
||||
price: 62,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/46.jpg',
|
||||
rating: 5,
|
||||
review: 42,
|
||||
sale: 69,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 4,
|
||||
name: 'ipad Pro 2020 11-inch 128GB Wi-Fi Only - Silver',
|
||||
price: 866,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/49.jpg',
|
||||
rating: 5,
|
||||
review: 22,
|
||||
sale: 468,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 5,
|
||||
name:
|
||||
'APPLE AIRPODS PRO WITH WIRELESS CHARGING ORIGINAL - AIRPOD - Free Silicone',
|
||||
price: 219,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/61.jpg',
|
||||
rating: 5,
|
||||
review: 934,
|
||||
sale: 1881,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 6,
|
||||
name:
|
||||
'Original 100% 60W Magsafe 1 Power Adapter Charger Macbook Pro - Air',
|
||||
price: 22.66,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/42.jpg',
|
||||
rating: 5,
|
||||
review: 131,
|
||||
sale: 466,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 7,
|
||||
name: 'iPod Touch 2019 7th Generation - 32GB SpaceGrey MVHW2',
|
||||
price: 242,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/79.jpg',
|
||||
rating: 5,
|
||||
review: 11,
|
||||
sale: 17,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 8,
|
||||
name: 'NEW Apple Magic Trackpad 2 Space Grey MRMF2 Gray',
|
||||
price: 189,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/73.jpg',
|
||||
rating: 5,
|
||||
review: 36,
|
||||
sale: 112,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 9,
|
||||
name: 'NEW Original Apple TV 4K 64GB 5th Generation',
|
||||
price: 261,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/29.jpg',
|
||||
rating: 5,
|
||||
review: 98,
|
||||
sale: 23,
|
||||
location: 'Brooklyn'),
|
||||
CategoryAllProductModel(
|
||||
id: 10,
|
||||
name:
|
||||
'Mac Mini 3.0GHz 6-Core Processor with Turbo Boost up to 4.1GHz 512GB Storage',
|
||||
price: 1099,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/77.jpg',
|
||||
rating: 5,
|
||||
review: 78,
|
||||
sale: 132,
|
||||
location: 'Brooklyn')
|
||||
];
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class CategoryBannerModel {
|
||||
late int id;
|
||||
late String image;
|
||||
|
||||
CategoryBannerModel({required this.id, required this.image});
|
||||
}
|
||||
|
||||
List<CategoryBannerModel> categoryBannerData = [
|
||||
CategoryBannerModel(
|
||||
id: 1, image: GLOBAL_URL + '/apps/ecommerce/category_banner/1.jpg'),
|
||||
CategoryBannerModel(
|
||||
id: 2, image: GLOBAL_URL + '/apps/ecommerce/category_banner/2.jpg'),
|
||||
CategoryBannerModel(
|
||||
id: 3, image: GLOBAL_URL + '/apps/ecommerce/category_banner/3.jpg'),
|
||||
];
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class CategoryForYouModel {
|
||||
late int id;
|
||||
late String image;
|
||||
|
||||
CategoryForYouModel({required this.id, required this.image});
|
||||
}
|
||||
|
||||
List<CategoryForYouModel> categoryForYouData = [
|
||||
CategoryForYouModel(
|
||||
id: 7,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category_for_you/1.jpg',
|
||||
),
|
||||
CategoryForYouModel(
|
||||
id: 3, image: GLOBAL_URL + '/apps/ecommerce/category_for_you/2.jpg'),
|
||||
CategoryForYouModel(
|
||||
id: 5, image: GLOBAL_URL + '/apps/ecommerce/category_for_you/3.jpg'),
|
||||
CategoryForYouModel(
|
||||
id: 2, image: GLOBAL_URL + '/apps/ecommerce/category_for_you/4.jpg'),
|
||||
CategoryForYouModel(
|
||||
id: 8, image: GLOBAL_URL + '/apps/ecommerce/category_for_you/5.jpg'),
|
||||
];
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class CategoryModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late String image;
|
||||
|
||||
CategoryModel({required this.id, required this.name, required this.image});
|
||||
}
|
||||
|
||||
/*
|
||||
Category Data Information
|
||||
width = 110px
|
||||
height = 110px
|
||||
*/
|
||||
List<CategoryModel> categoryData = [
|
||||
CategoryModel(
|
||||
id: 1,
|
||||
name: 'Fashion',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/fashion.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 2,
|
||||
name: 'Smartphone & Tablets',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/smartphone.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 3,
|
||||
name: 'Electronic',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/electronic.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 4,
|
||||
name: 'Otomotif',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/otomotif.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 5,
|
||||
name: 'Sport',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/sport.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 6,
|
||||
name: 'Food',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/food.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 7,
|
||||
name: 'Voucher\nGame',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/voucher_game.png',
|
||||
),
|
||||
CategoryModel(
|
||||
id: 8,
|
||||
name: 'Health & Care',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/category/health.png',
|
||||
),
|
||||
];
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class CategoryNewProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
|
||||
CategoryNewProductModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review});
|
||||
}
|
||||
|
||||
List<CategoryNewProductModel> categoryNewProductData = [
|
||||
CategoryNewProductModel(
|
||||
id: 1,
|
||||
name:
|
||||
'Converter APPLE USB-C To 3.5 mm Headphone Jack Adapter New Ipad Pro',
|
||||
price: 10,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/71.jpg',
|
||||
rating: 5,
|
||||
review: 54),
|
||||
CategoryNewProductModel(
|
||||
id: 2,
|
||||
name:
|
||||
'Charger adapter New Macbook Pro Retina 13 inch Apple 2017 2018 61w ori',
|
||||
price: 46,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/72.jpg',
|
||||
rating: 5,
|
||||
review: 4),
|
||||
CategoryNewProductModel(
|
||||
id: 3,
|
||||
name: 'NEW Apple Magic Trackpad 2 Space Grey MRMF2 Gray',
|
||||
price: 189,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/73.jpg',
|
||||
rating: 5,
|
||||
review: 24),
|
||||
CategoryNewProductModel(
|
||||
id: 4,
|
||||
name: 'Apple iMac 2020 4K 21.5" inch i3 3.6GHz /8GB/256GB MHK23',
|
||||
price: 1369,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/74.jpg',
|
||||
rating: 0,
|
||||
review: 0),
|
||||
CategoryNewProductModel(
|
||||
id: 5,
|
||||
name: 'Leather Sleeve for 13-inch MacBook Air and MacBook Pro - Black',
|
||||
price: 179,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/75.jpg',
|
||||
rating: 5,
|
||||
review: 120),
|
||||
CategoryNewProductModel(
|
||||
id: 6,
|
||||
name: 'Magic Mouse 2 - Space Gray',
|
||||
price: 99,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/76.jpg',
|
||||
rating: 5,
|
||||
review: 174),
|
||||
CategoryNewProductModel(
|
||||
id: 7,
|
||||
name:
|
||||
'Mac Mini 3.0GHz 6-Core Processor with Turbo Boost up to 4.1GHz 512GB Storage',
|
||||
price: 1099,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/77.jpg',
|
||||
rating: 5,
|
||||
review: 78),
|
||||
CategoryNewProductModel(
|
||||
id: 8,
|
||||
name: 'iPhone SE 2020',
|
||||
price: 399,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/78.png',
|
||||
rating: 5,
|
||||
review: 219),
|
||||
];
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class CategoryTrendingProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
|
||||
CategoryTrendingProductModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review});
|
||||
}
|
||||
|
||||
List<CategoryTrendingProductModel> categoryTrendingProductData = [
|
||||
CategoryTrendingProductModel(
|
||||
id: 1,
|
||||
name: 'IWO 8 Smart Watch Apple iWatch Mirror For Android iPhone',
|
||||
price: 62,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/46.jpg',
|
||||
rating: 5,
|
||||
review: 42,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 2,
|
||||
name: 'ipad Pro 2020 11-inch 128GB Wi-Fi Only - Silver',
|
||||
price: 866,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/49.jpg',
|
||||
rating: 5,
|
||||
review: 22,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 3,
|
||||
name: 'iphone 7 Plus / 7+ 128GB',
|
||||
price: 433,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/28.jpg',
|
||||
rating: 5,
|
||||
review: 129,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 4,
|
||||
name: 'New imac 2017 MNEA2 5K retina /3,5GHZ/i5/8GB/1TB/RP575',
|
||||
price: 1643,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/44.jpg',
|
||||
rating: 5,
|
||||
review: 2,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 5,
|
||||
name:
|
||||
'APPLE AIRPODS PRO WITH WIRELESS CHARGING ORIGINAL - AIRPOD - Free Silicone',
|
||||
price: 219,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/61.jpg',
|
||||
rating: 5,
|
||||
review: 934,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 6,
|
||||
name: 'Original 100% 60W Magsafe 1 Power Adapter Charger Macbook Pro - Air',
|
||||
price: 22.66,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/42.jpg',
|
||||
rating: 5,
|
||||
review: 131,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 7,
|
||||
name: 'NEW Original Apple TV 4K 64GB 5th Generation',
|
||||
price: 261,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/29.jpg',
|
||||
rating: 5,
|
||||
review: 98,
|
||||
),
|
||||
CategoryTrendingProductModel(
|
||||
id: 8,
|
||||
name: 'Apple Pencil 1 - Original Apple Garansi Resmi Inter',
|
||||
price: 99,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/70.jpg',
|
||||
rating: 5,
|
||||
review: 8)
|
||||
];
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
In this model, we give example about using private variable
|
||||
*/
|
||||
|
||||
class ChatModel {
|
||||
int _id;
|
||||
String? _type;
|
||||
String _isTextImageDate;
|
||||
String _message;
|
||||
String? _date;
|
||||
bool? _read;
|
||||
|
||||
ChatModel(this._id, this._type, this._isTextImageDate, this._message, this._date, this._read);
|
||||
|
||||
int get getId{
|
||||
return _id;
|
||||
}
|
||||
|
||||
String? get getType{
|
||||
return _type;
|
||||
}
|
||||
|
||||
String get getTextImageDate{
|
||||
return _isTextImageDate;
|
||||
}
|
||||
|
||||
String get getMessage{
|
||||
return _message;
|
||||
}
|
||||
|
||||
String? get getDate{
|
||||
return _date;
|
||||
}
|
||||
|
||||
bool? get getRead{
|
||||
return _read;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
class CouponModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late String day;
|
||||
late String term;
|
||||
|
||||
CouponModel({required this.id, required this.name, required this.day, required this.term});
|
||||
}
|
||||
|
||||
List<CouponModel> couponData =[
|
||||
CouponModel(
|
||||
id: 1,
|
||||
name: 'FASHION50',
|
||||
day: '2',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 2,
|
||||
name: 'EVERY20',
|
||||
day: '6',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 3,
|
||||
name: 'COC40',
|
||||
day: '3',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 4,
|
||||
name: 'PUBG70',
|
||||
day: '1',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 5,
|
||||
name: 'HEADSET10',
|
||||
day: '1',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 6,
|
||||
name: 'ENDOFMONTH',
|
||||
day: '5',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 7,
|
||||
name: 'LUCKYPRIZED',
|
||||
day: '7',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 8,
|
||||
name: 'RANDOMSALE',
|
||||
day: '14',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 9,
|
||||
name: 'HEALTH15',
|
||||
day: '3',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
CouponModel(
|
||||
id: 10,
|
||||
name: 'RIDER35',
|
||||
day: '4',
|
||||
term: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n'+
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n'+
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n'+
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'
|
||||
),
|
||||
];
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class FlashsaleModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late int discount;
|
||||
late double countItem;
|
||||
late int sale;
|
||||
|
||||
FlashsaleModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.discount,
|
||||
required this.countItem,
|
||||
required this.sale});
|
||||
}
|
||||
|
||||
/*
|
||||
Flashsale Data Information
|
||||
width = 700px
|
||||
height = 700px
|
||||
*/
|
||||
List<FlashsaleModel> flashsaleData = [
|
||||
FlashsaleModel(
|
||||
id: 1,
|
||||
name:
|
||||
'BARDI Smart IP Camera CCTV Wifi IoT HomeAutomation Support iOS Android',
|
||||
price: 32.3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/1.jpg',
|
||||
discount: 35,
|
||||
countItem: 20,
|
||||
sale: 17),
|
||||
FlashsaleModel(
|
||||
id: 2,
|
||||
name: 'TEROPONG MINI 30 X 60 BINOCULARS HD NIGHT VERSION 30 X 60',
|
||||
price: 9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/2.jpg',
|
||||
discount: 20,
|
||||
countItem: 20,
|
||||
sale: 19),
|
||||
FlashsaleModel(
|
||||
id: 3,
|
||||
name:
|
||||
'CAFELE Premium Light Glass Case - iPhone 11 Pro iPhone 11 Pro Max - iP 11 Pro Max',
|
||||
price: 12.85,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/3.jpg',
|
||||
discount: 30,
|
||||
countItem: 60,
|
||||
sale: 13),
|
||||
FlashsaleModel(
|
||||
id: 4,
|
||||
name:
|
||||
'Logitech G502 Hero / Mouse Logitech G 502 Hero Original Garansi Resmi',
|
||||
price: 68.25,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/4.jpg',
|
||||
discount: 20,
|
||||
countItem: 130,
|
||||
sale: 70),
|
||||
FlashsaleModel(
|
||||
id: 5,
|
||||
name: 'Pioneer SE-C5TW TWS Bluetooth Truly Wireless Earphones - Hitam',
|
||||
price: 56.85,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/5.jpg',
|
||||
discount: 15,
|
||||
countItem: 20,
|
||||
sale: 10),
|
||||
FlashsaleModel(
|
||||
id: 6,
|
||||
name:
|
||||
'Anker SoundCore Life Note Wireless Earbuds Bluetooth Earphones A3908 - Hitam',
|
||||
price: 76.6,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/6.jpg',
|
||||
discount: 40,
|
||||
countItem: 130,
|
||||
sale: 99),
|
||||
FlashsaleModel(
|
||||
id: 7,
|
||||
name:
|
||||
'Audio Technica AT-LP60X Fully Automatic Belt-Drive Stereo Turntable',
|
||||
price: 215.58,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/7.jpg',
|
||||
discount: 20,
|
||||
countItem: 40,
|
||||
sale: 30),
|
||||
FlashsaleModel(
|
||||
id: 8,
|
||||
name: 'Xiaomi Deerma CM800 UV Anti Mite Vacuum Cleaner Dust Bed Sofa',
|
||||
price: 44.28,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/8.jpg',
|
||||
discount: 30,
|
||||
countItem: 20,
|
||||
sale: 15),
|
||||
FlashsaleModel(
|
||||
id: 9,
|
||||
name:
|
||||
'Sony SRS- XB12 / XB 12 Extra Bass Portable Bluetooth Speaker - Black',
|
||||
price: 53.33,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/9.jpg',
|
||||
discount: 10,
|
||||
countItem: 41,
|
||||
sale: 2),
|
||||
FlashsaleModel(
|
||||
id: 10,
|
||||
name:
|
||||
'Changhong Google certified Android Smart TV 32 inch 32H4 LED TV-L32H4',
|
||||
price: 240.61,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/10.jpg',
|
||||
discount: 46,
|
||||
countItem: 20,
|
||||
sale: 18),
|
||||
FlashsaleModel(
|
||||
id: 11,
|
||||
name: 'READY DJI Mavic Air Fly More Combo',
|
||||
price: 776.67,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/11.jpg',
|
||||
discount: 10,
|
||||
countItem: 20,
|
||||
sale: 20),
|
||||
FlashsaleModel(
|
||||
id: 12,
|
||||
name:
|
||||
'gopro hero 8 black garansi resmi TAM / go pro hero8 black / 8black',
|
||||
price: 391.76,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/12.jpg',
|
||||
discount: 15,
|
||||
countItem: 20,
|
||||
sale: 19),
|
||||
FlashsaleModel(
|
||||
id: 13,
|
||||
name:
|
||||
'QZSD Q-202F - Flat Lay Tripod - Transverse Center Column FREE Holder U',
|
||||
price: 40.74,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/13.jpg',
|
||||
discount: 10,
|
||||
countItem: 20,
|
||||
sale: 7),
|
||||
FlashsaleModel(
|
||||
id: 14,
|
||||
name:
|
||||
'WD My Passport 2TB Hardisk Eksternal 2.5" USB 3.0 HDD External Baru - 1TB, Merah',
|
||||
price: 63.3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/14.jpg',
|
||||
discount: 40,
|
||||
countItem: 14,
|
||||
sale: 10),
|
||||
FlashsaleModel(
|
||||
id: 15,
|
||||
name:
|
||||
'SanDisk 128GB Kartu Memori 100MB/S Ultra Microsd SD With Adapter Card',
|
||||
price: 12,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/15.jpg',
|
||||
discount: 40,
|
||||
countItem: 140,
|
||||
sale: 96),
|
||||
FlashsaleModel(
|
||||
id: 16,
|
||||
name: 'SanDisk Extreme Pro USB 3.1 Solid State Flash Drive 256GB',
|
||||
price: 120,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/16.png',
|
||||
discount: 40,
|
||||
countItem: 20,
|
||||
sale: 4),
|
||||
FlashsaleModel(
|
||||
id: 17,
|
||||
name: 'Harley Davidson Skull & Flames Nylon Bomber Jacket',
|
||||
price: 104.16,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/17.jpg',
|
||||
discount: 20,
|
||||
countItem: 60,
|
||||
sale: 50),
|
||||
FlashsaleModel(
|
||||
id: 18,
|
||||
name:
|
||||
'video intercom doorbell Wireless wifi HD Res - Cloud Storage ESCAM V6',
|
||||
price: 55.825,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/18.jpg',
|
||||
discount: 20,
|
||||
countItem: 20,
|
||||
sale: 17),
|
||||
FlashsaleModel(
|
||||
id: 19,
|
||||
name:
|
||||
'DEADBOLT DOOR LOCK SMART DOOR LOCK / SMART LOCK DOOR MEREK SEYVEN - EZ-TTLOCK',
|
||||
price: 150,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/19.jpg',
|
||||
discount: 20,
|
||||
countItem: 20,
|
||||
sale: 6),
|
||||
FlashsaleModel(
|
||||
id: 20,
|
||||
name: 'BT-RIDER" GPS NAVIGATION ANDROID 6.0, 5 in WATERPROOF',
|
||||
price: 191.66,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/20.jpg',
|
||||
discount: 20,
|
||||
countItem: 20,
|
||||
sale: 15),
|
||||
];
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class HomeBannerModel {
|
||||
late int id;
|
||||
late String image;
|
||||
|
||||
HomeBannerModel({required this.id, required this.image});
|
||||
}
|
||||
|
||||
/*
|
||||
Banner Data Information
|
||||
width = 800px
|
||||
height = 600px
|
||||
*/
|
||||
List<HomeBannerModel> homeBannerData = [
|
||||
HomeBannerModel(
|
||||
id: 1, image: GLOBAL_URL + '/apps/ecommerce/home_banner/1.jpg'),
|
||||
HomeBannerModel(
|
||||
id: 2, image: GLOBAL_URL + '/apps/ecommerce/home_banner/2.jpg'),
|
||||
HomeBannerModel(
|
||||
id: 3, image: GLOBAL_URL + '/apps/ecommerce/home_banner/3.jpg'),
|
||||
HomeBannerModel(
|
||||
id: 4, image: GLOBAL_URL + '/apps/ecommerce/home_banner/4.jpg'),
|
||||
HomeBannerModel(
|
||||
id: 5, image: GLOBAL_URL + '/apps/ecommerce/home_banner/5.jpg'),
|
||||
];
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class HomeTrendingModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late String image;
|
||||
late String sale;
|
||||
|
||||
HomeTrendingModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.image,
|
||||
required this.sale});
|
||||
}
|
||||
|
||||
/*
|
||||
Home Trending Data Information
|
||||
width = 700px
|
||||
height = 700px
|
||||
*/
|
||||
List<HomeTrendingModel> homeTrendingData = [
|
||||
HomeTrendingModel(
|
||||
id: 1,
|
||||
name: 'Adidas Shirt',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/21.jpg',
|
||||
sale: '12.7k'),
|
||||
HomeTrendingModel(
|
||||
id: 2,
|
||||
name: 'iPhone SE 2020',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/22.jpg',
|
||||
sale: '8k'),
|
||||
HomeTrendingModel(
|
||||
id: 3,
|
||||
name: 'Macbook Air 2020',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/23.jpg',
|
||||
sale: '31.4k'),
|
||||
HomeTrendingModel(
|
||||
id: 4,
|
||||
name: 'Gaming Chair',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/24.jpg',
|
||||
sale: '11.9k'),
|
||||
];
|
||||
|
|
@ -1,219 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class LastSearchModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
late int sale;
|
||||
late String location;
|
||||
|
||||
LastSearchModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review,
|
||||
required this.sale,
|
||||
required this.location});
|
||||
}
|
||||
|
||||
/*
|
||||
Last Search Data Information
|
||||
width = 700px
|
||||
height = 700px
|
||||
*/
|
||||
List<LastSearchModel> lastSearchData = [
|
||||
LastSearchModel(
|
||||
id: 1,
|
||||
name: 'Delta Boots Import 8 Inch',
|
||||
price: 18.3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/25.jpg',
|
||||
rating: 5,
|
||||
review: 212,
|
||||
sale: 735,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 2,
|
||||
name: 'Fimi X8 SE Black',
|
||||
price: 567,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/26.jpg',
|
||||
rating: 5,
|
||||
review: 63,
|
||||
sale: 115,
|
||||
location: 'Brooklyn',
|
||||
),
|
||||
LastSearchModel(
|
||||
id: 3,
|
||||
name: 'Guess Collection Watch Ceramic Type GC 6004 ',
|
||||
price: 52,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/27.jpg',
|
||||
rating: 5,
|
||||
review: 7,
|
||||
sale: 7,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 4,
|
||||
name: 'Adidas Football Predator 19.3 FG F35594 Original',
|
||||
price: 9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/45.jpg',
|
||||
rating: 5,
|
||||
review: 30,
|
||||
sale: 70,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 5,
|
||||
name: 'NEW Original Apple TV 4K 64GB 5th Generation',
|
||||
price: 261,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/29.jpg',
|
||||
rating: 5,
|
||||
review: 98,
|
||||
sale: 263,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 6,
|
||||
name: 'SAMSUNG GALAXY S20 PLUS RAM 8/128GB',
|
||||
price: 751,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/30.jpg',
|
||||
rating: 5,
|
||||
review: 14,
|
||||
sale: 17,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 7,
|
||||
name:
|
||||
'Changhong Google certified Android Smart TV 32 inch 32H4 LED TV-L32H4',
|
||||
price: 129.9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/31.jpg',
|
||||
rating: 5,
|
||||
review: 701,
|
||||
sale: 1558,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 8,
|
||||
name: 'Adidas EQT Adv Premium Original',
|
||||
price: 28.67,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/32.jpg',
|
||||
rating: 5,
|
||||
review: 146,
|
||||
sale: 398,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 9,
|
||||
name:
|
||||
'Xiaomi Air Purifier 3 Mijia OLED Touch Sterilization Air Ionizer - 3',
|
||||
price: 139,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/33.jpg',
|
||||
rating: 5,
|
||||
review: 275,
|
||||
sale: 1055,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 10,
|
||||
name: 'Spatula Set Stainless Kitchen Tools',
|
||||
price: 2.5,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/34.jpg',
|
||||
rating: 5,
|
||||
review: 302,
|
||||
sale: 752,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 11,
|
||||
name:
|
||||
'DATA CABLE TYPE-C TO TYPE-C BASEUS HALO DATA CABLE PD 2.0 60W - 0.5 M',
|
||||
price: 3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/35.jpg',
|
||||
rating: 5,
|
||||
review: 636,
|
||||
sale: 2087,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 12,
|
||||
name: 'BASEUS QUICK CHARGER HEAD QC3.0/4.0 TYPE-C+USB 30W PD 5A - USB TC',
|
||||
price: 10.6,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/36.jpg',
|
||||
rating: 5,
|
||||
review: 2802,
|
||||
sale: 7052,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 13,
|
||||
name: 'Xiaomi Powerbank MI2C 20000mAh Mi Power Bank 20000 mAh PLM06ZM',
|
||||
price: 19.9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/37.jpg',
|
||||
rating: 5,
|
||||
review: 105,
|
||||
sale: 227,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 14,
|
||||
name:
|
||||
'3D FASHION MASK WITH BREATHING VALVE / MASKER PM 2.5 KARBON / WASHABLE - BLACK NEW MODEL',
|
||||
price: 2.33,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/38.jpg',
|
||||
rating: 5,
|
||||
review: 503,
|
||||
sale: 3645,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 15,
|
||||
name:
|
||||
'Robot RT-US04 Table Phone Holder Stand Aluminium Alloy Universal - Pink',
|
||||
price: 5.3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/39.jpg',
|
||||
rating: 5,
|
||||
review: 1095,
|
||||
sale: 3400,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 16,
|
||||
name: 'Tactical Pants Blackhawk Helikon ',
|
||||
price: 10,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/40.jpg',
|
||||
rating: 5,
|
||||
review: 63,
|
||||
sale: 131,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 17,
|
||||
name:
|
||||
'Sony SRS- XB12 / XB 12 Extra Bass Portable Bluetooth Speaker - Black',
|
||||
price: 48,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/41.jpg',
|
||||
rating: 5,
|
||||
review: 182,
|
||||
sale: 427,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 18,
|
||||
name:
|
||||
'Original 100% 60W Magsafe 1 Power Adapter Charger Macbook Pro - Air',
|
||||
price: 22.66,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/42.jpg',
|
||||
rating: 5,
|
||||
review: 131,
|
||||
sale: 466,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 19,
|
||||
name:
|
||||
'Macbook Pro 2019 TouchBar MV912 15" 16GB 512GB 2.3GHz 8-core i9 Gray',
|
||||
price: 2212,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/43.jpg',
|
||||
rating: 5,
|
||||
review: 16,
|
||||
sale: 37,
|
||||
location: 'Brooklyn'),
|
||||
LastSearchModel(
|
||||
id: 20,
|
||||
name: 'New imac 2017 MNEA2 5K retina /3,5GHZ/i5/8GB/1TB/RP575',
|
||||
price: 1643,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/44.jpg',
|
||||
rating: 5,
|
||||
review: 2,
|
||||
sale: 3,
|
||||
location: 'Brooklyn')
|
||||
];
|
||||
|
|
@ -1,215 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class LastSeenModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
late int sale;
|
||||
late String location;
|
||||
|
||||
LastSeenModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review,
|
||||
required this.sale,
|
||||
required this.location});
|
||||
}
|
||||
|
||||
List<LastSeenModel> lastSeenData = [
|
||||
LastSeenModel(
|
||||
id: 1,
|
||||
name:
|
||||
'BARDI Smart IP Camera CCTV Wifi IoT HomeAutomation Support iOS Android',
|
||||
price: 21,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/1.jpg',
|
||||
rating: 4,
|
||||
review: 462,
|
||||
sale: 1543,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 2,
|
||||
name: 'iphone 7 Plus / 7+ 128GB',
|
||||
price: 433,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/28.jpg',
|
||||
rating: 5,
|
||||
review: 129,
|
||||
sale: 310,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 3,
|
||||
name:
|
||||
'gopro hero 8 black garansi resmi TAM / go pro hero8 black / 8black',
|
||||
price: 333,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/12.jpg',
|
||||
rating: 5,
|
||||
review: 13,
|
||||
sale: 33,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 4,
|
||||
name: 'TEROPONG MINI 30 X 60 BINOCULARS HD NIGHT VERSION 30 X 60',
|
||||
price: 7.2,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/2.jpg',
|
||||
rating: 5,
|
||||
review: 1,
|
||||
sale: 2,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 5,
|
||||
name:
|
||||
'WD My Passport 2TB Hardisk Eksternal 2.5" USB 3.0 HDD External Baru - 1TB, Merah',
|
||||
price: 9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/14.jpg',
|
||||
rating: 4,
|
||||
review: 71,
|
||||
sale: 152,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 6,
|
||||
name:
|
||||
'SanDisk 128GB Kartu Memori 100MB/S Ultra Microsd SD With Adapter Card',
|
||||
price: 7.2,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/15.jpg',
|
||||
rating: 4,
|
||||
review: 656,
|
||||
sale: 1760,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 7,
|
||||
name:
|
||||
'BARDI Smart UNIVERSAL IR REMOTE Wifi Wireless IoT For Home Automation',
|
||||
price: 11.5,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/60.jpg',
|
||||
rating: 5,
|
||||
review: 1438,
|
||||
sale: 4956,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 8,
|
||||
name:
|
||||
'APPLE AIRPODS PRO WITH WIRELESS CHARGING ORIGINAL - AIRPOD - Free Silicone',
|
||||
price: 219,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/61.jpg',
|
||||
rating: 5,
|
||||
review: 934,
|
||||
sale: 1881,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 9,
|
||||
name:
|
||||
'DATA CABLE TYPE-C TO TYPE-C BASEUS HALO DATA CABLE PD 2.0 60W - 0.5 M',
|
||||
price: 3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/35.jpg',
|
||||
rating: 5,
|
||||
review: 636,
|
||||
sale: 2087,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 10,
|
||||
name:
|
||||
'Original 100% 60W Magsafe 1 Power Adapter Charger Macbook Pro - Air',
|
||||
price: 22.66,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/42.jpg',
|
||||
rating: 5,
|
||||
review: 131,
|
||||
sale: 466,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 11,
|
||||
name:
|
||||
'iPhone XS Max / XS / X / XR Case Spigen Clear Anti Shock Ultra Hybrid - Matte Black, XS Max',
|
||||
price: 16.6,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/62.jpg',
|
||||
rating: 5,
|
||||
review: 2201,
|
||||
sale: 5154,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 12,
|
||||
name: 'TORCH WAIST BAG VALLEJO TOSCA',
|
||||
price: 4.1,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/63.jpg',
|
||||
rating: 5,
|
||||
review: 130,
|
||||
sale: 302,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 13,
|
||||
name: 'Bushnell Speed Gun Velocity 101911',
|
||||
price: 180,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/64.jpg',
|
||||
rating: 5,
|
||||
review: 4,
|
||||
sale: 14,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 14,
|
||||
name: 'Iphone XR - COPPER Tempered Glass Full Glue PREMIUM Glossy',
|
||||
price: 3.1,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/65.jpg',
|
||||
rating: 5,
|
||||
review: 130,
|
||||
sale: 460,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 15,
|
||||
name: 'Digital Thermometer infrared Termometer Gun',
|
||||
price: 9.9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/66.jpg',
|
||||
rating: 5,
|
||||
review: 270,
|
||||
sale: 1287,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 16,
|
||||
name: "L'Oreal Paris Fall Resist Hair Mask",
|
||||
price: 9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/67.jpg',
|
||||
rating: 5,
|
||||
review: 947,
|
||||
sale: 3750,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 17,
|
||||
name:
|
||||
'Samyang Noodle Wholesaler 1 Box (40 Pcs) Hot Spicy Chicken - Original Jan 21',
|
||||
price: 26,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/68.jpg',
|
||||
rating: 5,
|
||||
review: 4,
|
||||
sale: 22,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 18,
|
||||
name: 'IWO 8 Smart Watch Apple iWatch Mirror For Android iPhone',
|
||||
price: 62,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/46.jpg',
|
||||
rating: 5,
|
||||
review: 42,
|
||||
sale: 69,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 19,
|
||||
name: 'Asus Rog Phone 3 Rogphone III Ram 12Gb 512Gb Snapdragon 865+ Plus',
|
||||
price: 1152,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/48.jpg',
|
||||
rating: 5,
|
||||
review: 1,
|
||||
sale: 2,
|
||||
location: 'Brooklyn'),
|
||||
LastSeenModel(
|
||||
id: 20,
|
||||
name: 'Nitendo Switch Console New HAC-001(-01) Neon Blue - Neon Red',
|
||||
price: 349,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/52.jpg',
|
||||
rating: 5,
|
||||
review: 30,
|
||||
sale: 86,
|
||||
location: 'Brooklyn')
|
||||
];
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class OrderListModel {
|
||||
late int id;
|
||||
late String invoice;
|
||||
late String date;
|
||||
late String status;
|
||||
late String name;
|
||||
late String image;
|
||||
late double payment;
|
||||
|
||||
OrderListModel(
|
||||
{required this.id,
|
||||
required this.invoice,
|
||||
required this.date,
|
||||
required this.status,
|
||||
required this.name,
|
||||
required this.image,
|
||||
required this.payment});
|
||||
}
|
||||
|
||||
List<OrderListModel> orderListData = [
|
||||
OrderListModel(
|
||||
id: 1,
|
||||
invoice: 'INV385739475',
|
||||
date: '12 August 2020',
|
||||
status: 'On Process',
|
||||
name: 'Logitech G502 Hero / Mouse Logitech G 502 Hero Original',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/4.jpg',
|
||||
payment: 80,
|
||||
),
|
||||
OrderListModel(
|
||||
id: 2,
|
||||
invoice: 'INV385714262',
|
||||
date: '3 September 2020',
|
||||
status: 'Order Completed',
|
||||
name: 'Delta Boots Import 8 Inch',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/25.jpg',
|
||||
payment: 36,
|
||||
),
|
||||
OrderListModel(
|
||||
id: 3,
|
||||
invoice: 'INV385776588',
|
||||
date: '9 September 2020',
|
||||
status: 'On Delivery',
|
||||
name: 'Spatula Set Stainless Kitchen Tools',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/34.jpg',
|
||||
payment: 9.6,
|
||||
),
|
||||
OrderListModel(
|
||||
id: 4,
|
||||
invoice: 'INV385798021',
|
||||
date: '13 September 2020',
|
||||
status: 'Waiting for payment',
|
||||
name: 'Original 100% 60W Magsafe 1 Power Adapter Charger Macbook Pro - Air',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/42.jpg',
|
||||
payment: 38,
|
||||
),
|
||||
];
|
||||
|
|
@ -1,215 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class RecomendedProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
late int sale;
|
||||
late String location;
|
||||
|
||||
RecomendedProductModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review,
|
||||
required this.sale,
|
||||
required this.location});
|
||||
}
|
||||
|
||||
/*
|
||||
Recomended Product Data Information
|
||||
width = 700px
|
||||
height = 700px
|
||||
*/
|
||||
List<RecomendedProductModel> recomendedProductData = [
|
||||
RecomendedProductModel(
|
||||
id: 1,
|
||||
name: 'iphone 7 Plus / 7+ 128GB',
|
||||
price: 433,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/28.jpg',
|
||||
rating: 5,
|
||||
review: 129,
|
||||
sale: 310,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 2,
|
||||
name:
|
||||
'Macbook Pro 2019 TouchBar MV912 15" 16GB 512GB 2.3GHz 8-core i9 Gray',
|
||||
price: 2212,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/43.jpg',
|
||||
rating: 5,
|
||||
review: 16,
|
||||
sale: 37,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 3,
|
||||
name: 'New imac 2017 MNEA2 5K retina /3,5GHZ/i5/8GB/1TB/RP575',
|
||||
price: 1643,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/44.jpg',
|
||||
rating: 5,
|
||||
review: 2,
|
||||
sale: 3,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 4,
|
||||
name:
|
||||
'DEADBOLT DOOR LOCK SMART DOOR LOCK / SMART LOCK DOOR MEREK SEYVEN - EZ-TTLOCK',
|
||||
price: 120,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/19.jpg',
|
||||
rating: 5,
|
||||
review: 4,
|
||||
sale: 6,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 5,
|
||||
name: 'IWO 8 Smart Watch Apple iWatch Mirror For Android iPhone',
|
||||
price: 62,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/46.jpg',
|
||||
rating: 5,
|
||||
review: 42,
|
||||
sale: 69,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 6,
|
||||
name: 'SAMSUNG GALAXY S20 PLUS RAM 8/128GB',
|
||||
price: 751,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/30.jpg',
|
||||
rating: 5,
|
||||
review: 14,
|
||||
sale: 17,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 7,
|
||||
name: 'Garmin Instinct Tactical - Black',
|
||||
price: 290,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/47.jpg',
|
||||
rating: 5,
|
||||
review: 13,
|
||||
sale: 23,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 8,
|
||||
name: 'Asus Rog Phone 3 Rogphone III Ram 12Gb 512Gb Snapdragon 865+ Plus',
|
||||
price: 1152,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/48.jpg',
|
||||
rating: 5,
|
||||
review: 1,
|
||||
sale: 2,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 9,
|
||||
name: 'ipad Pro 2020 11-inch 128GB Wi-Fi Only - Silver',
|
||||
price: 866,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/49.jpg',
|
||||
rating: 5,
|
||||
review: 22,
|
||||
sale: 468,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 10,
|
||||
name: 'Folding Bike 20 GENIO BY United Bike',
|
||||
price: 173,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/50.jpg',
|
||||
rating: 5,
|
||||
review: 9,
|
||||
sale: 23,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 11,
|
||||
name: 'XBOX 360 SLIM 500 GB RGH FULL GAME & KINECT',
|
||||
price: 183,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/51.jpg',
|
||||
rating: 4,
|
||||
review: 3,
|
||||
sale: 9,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 12,
|
||||
name: 'Nitendo Switch Console New HAC-001(-01) Neon Blue - Neon Red',
|
||||
price: 349,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/52.jpg',
|
||||
rating: 5,
|
||||
review: 30,
|
||||
sale: 86,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 13,
|
||||
name: 'TP-Link TL-WR840N (V4.0) : 300Mbps TPLink WiFi Wireless N Router',
|
||||
price: 11,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/53.jpg',
|
||||
rating: 5,
|
||||
review: 1075,
|
||||
sale: 3247,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 14,
|
||||
name: 'Google Chromecast 3 Chrome Cast 3rd HDMI Streaming',
|
||||
price: 38,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/54.jpg',
|
||||
rating: 5,
|
||||
review: 160,
|
||||
sale: 574,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 15,
|
||||
name: 'PRINTER CANON PIXMA MG2570S / PRINTER ALL IN ONE MG 2570 S',
|
||||
price: 35,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/55.jpg',
|
||||
rating: 5,
|
||||
review: 126,
|
||||
sale: 285,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 16,
|
||||
name: 'Air Jordan 1 Mid Chicago Black Toe 554724-069 100% Authentic - 43',
|
||||
price: 220,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/56.jpg',
|
||||
rating: 5,
|
||||
review: 15,
|
||||
sale: 24,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 17,
|
||||
name: 'ADIDAS ICE DIVE PARFUM ORIGINAL 100ML',
|
||||
price: 4.9,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/57.jpg',
|
||||
rating: 5,
|
||||
review: 251,
|
||||
sale: 751,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 18,
|
||||
name:
|
||||
'BARDI Smart Light Bulb Lamp Bohlam LED WIFI RGBWW 12W 12 watt Home IoT',
|
||||
price: 8.6,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/58.jpg',
|
||||
rating: 5,
|
||||
review: 354,
|
||||
sale: 540,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 19,
|
||||
name:
|
||||
'Xiaomi Yi Dash Camera Nightscape 1080P 60FPS ADAS Night Vision Dashcam',
|
||||
price: 46.6,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/59.jpg',
|
||||
rating: 5,
|
||||
review: 47,
|
||||
sale: 146,
|
||||
location: 'Brooklyn'),
|
||||
RecomendedProductModel(
|
||||
id: 20,
|
||||
name:
|
||||
'gopro hero 8 black garansi resmi TAM / go pro hero8 black / 8black',
|
||||
price: 333,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/12.jpg',
|
||||
rating: 5,
|
||||
review: 13,
|
||||
sale: 33,
|
||||
location: 'Brooklyn')
|
||||
];
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class RelatedProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
|
||||
RelatedProductModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review});
|
||||
}
|
||||
|
||||
List<RelatedProductModel> relatedProductData = [
|
||||
RelatedProductModel(
|
||||
id: 1,
|
||||
name:
|
||||
'Converter APPLE USB-C To 3.5 mm Headphone Jack Adapter New Ipad Pro',
|
||||
price: 10,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/71.jpg',
|
||||
rating: 5,
|
||||
review: 54),
|
||||
RelatedProductModel(
|
||||
id: 2,
|
||||
name:
|
||||
'Charger adapter New Macbook Pro Retina 13 inch Apple 2017 2018 61w ori',
|
||||
price: 46,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/72.jpg',
|
||||
rating: 5,
|
||||
review: 4),
|
||||
RelatedProductModel(
|
||||
id: 3,
|
||||
name: 'NEW Apple Magic Trackpad 2 Space Grey MRMF2 Gray',
|
||||
price: 189,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/73.jpg',
|
||||
rating: 5,
|
||||
review: 24),
|
||||
RelatedProductModel(
|
||||
id: 4,
|
||||
name: 'Apple iMac 2020 4K 21.5" inch i3 3.6GHz /8GB/256GB MHK23',
|
||||
price: 1369,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/74.jpg',
|
||||
rating: 0,
|
||||
review: 0),
|
||||
RelatedProductModel(
|
||||
id: 5,
|
||||
name: 'Leather Sleeve for 13-inch MacBook Air and MacBook Pro - Black',
|
||||
price: 179,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/75.jpg',
|
||||
rating: 5,
|
||||
review: 120),
|
||||
RelatedProductModel(
|
||||
id: 6,
|
||||
name: 'Magic Mouse 2 - Space Gray',
|
||||
price: 99,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/76.jpg',
|
||||
rating: 5,
|
||||
review: 174),
|
||||
RelatedProductModel(
|
||||
id: 7,
|
||||
name:
|
||||
'Mac Mini 3.0GHz 6-Core Processor with Turbo Boost up to 4.1GHz 512GB Storage',
|
||||
price: 1099,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/77.jpg',
|
||||
rating: 5,
|
||||
review: 78),
|
||||
RelatedProductModel(
|
||||
id: 8,
|
||||
name: 'iPhone SE 2020',
|
||||
price: 399,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/78.png',
|
||||
rating: 5,
|
||||
review: 219),
|
||||
];
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
class ReviewModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late String date;
|
||||
late double rating;
|
||||
late String review;
|
||||
|
||||
ReviewModel({required this.id, required this.name, required this.date, required this.rating, required this.review});
|
||||
}
|
||||
|
||||
List<ReviewModel> reviewData =[
|
||||
ReviewModel(
|
||||
id: 1,
|
||||
name: 'A*******i',
|
||||
date: '11 September 2020',
|
||||
rating: 5,
|
||||
review: 'Everything came in time. Very well packed. Quality is excellent. Thank you!'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 2,
|
||||
name: 'L***a',
|
||||
date: '10 September 2020',
|
||||
rating: 5,
|
||||
review: 'The goods came very quickly, in perfect condition, everything is packed, nothing is damaged! Excellent, visibility super, I recommend the seller, the store, the goods!!!'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 3,
|
||||
name: 'R******i',
|
||||
date: '8 September 2020',
|
||||
rating: 5,
|
||||
review: 'Before Moscow 3 weeks, asked the seller that there would be no pictogram, made without them. The packaging is definitely good'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 4,
|
||||
name: 'D***s',
|
||||
date: '7 September 2020',
|
||||
rating: 4,
|
||||
review: 'The goods arrived 21 days before perm. Packing on the photo. the box inside is crumpled. Thank you seller'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 5,
|
||||
name: 'S*******a',
|
||||
date: '7 September 2020',
|
||||
rating: 5,
|
||||
review: 'An excellent device, its money costs. Packed perfectly, no damage. To the seller 5 +++.'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 6,
|
||||
name: 'B*******g',
|
||||
date: '6 September 2020',
|
||||
rating: 5,
|
||||
review: 'The goods are satisfied'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 7,
|
||||
name: 'H*********a',
|
||||
date: '4 September 2020',
|
||||
rating: 3,
|
||||
review: 'Good product, seller recommend'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 8,
|
||||
name: 'P***u',
|
||||
date: '4 September 2020',
|
||||
rating: 3,
|
||||
review: 'Not as good as they write but still worth'
|
||||
),
|
||||
ReviewModel(
|
||||
id: 9,
|
||||
name: 'O**********a',
|
||||
date: '3 September 2020',
|
||||
rating: 4,
|
||||
review: "Perfect. Immediately turned up in flight. I can't give you 5 stars for the parcel. And arrived very deteriorated, but fortunately the drone works"
|
||||
),
|
||||
ReviewModel(
|
||||
id: 10,
|
||||
name: 'D********l',
|
||||
date: '1 September 2020',
|
||||
rating: 5,
|
||||
review: 'All OK. Although well packed, the box crushed'
|
||||
),
|
||||
];
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
class ProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
double? price;
|
||||
late String image;
|
||||
double? rating;
|
||||
int? review;
|
||||
late int sale;
|
||||
int? stock;
|
||||
String? location;
|
||||
|
||||
ProductModel({required this.id, required this.name, this.price, required this.image, this.rating, this.review, required this.sale, this.stock, this.location});
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
class SearchModel {
|
||||
late int id;
|
||||
late String words;
|
||||
|
||||
SearchModel({required this.id, required this.words});
|
||||
}
|
||||
|
||||
List<SearchModel> searchData = [
|
||||
SearchModel(
|
||||
id: 1,
|
||||
words: 'adidas shirt'
|
||||
),
|
||||
SearchModel(
|
||||
id: 2,
|
||||
words: 'led tv'
|
||||
),
|
||||
SearchModel(
|
||||
id: 3,
|
||||
words: 'apple mac'
|
||||
),
|
||||
SearchModel(
|
||||
id: 4,
|
||||
words: 'iphone'
|
||||
),
|
||||
SearchModel(
|
||||
id: 5,
|
||||
words: 'asus'
|
||||
),
|
||||
];
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class SearchProductModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late double price;
|
||||
late String image;
|
||||
late double rating;
|
||||
late int review;
|
||||
late int sale;
|
||||
late String location;
|
||||
|
||||
SearchProductModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.image,
|
||||
required this.rating,
|
||||
required this.review,
|
||||
required this.sale,
|
||||
required this.location});
|
||||
}
|
||||
|
||||
List<SearchProductModel> searchProductData = [
|
||||
SearchProductModel(
|
||||
id: 1,
|
||||
name: 'iphone 7 Plus / 7+ 128GB',
|
||||
price: 433,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/28.jpg',
|
||||
rating: 5,
|
||||
review: 129,
|
||||
sale: 310,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 2,
|
||||
name: 'IWO 8 Smart Watch Apple iWatch Mirror For Android iPhone',
|
||||
price: 62,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/46.jpg',
|
||||
rating: 5,
|
||||
review: 42,
|
||||
sale: 69,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 3,
|
||||
name: 'New imac 2017 MNEA2 5K retina /3,5GHZ/i5/8GB/1TB/RP575',
|
||||
price: 1643,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/44.jpg',
|
||||
rating: 5,
|
||||
review: 2,
|
||||
sale: 3,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 4,
|
||||
name:
|
||||
'APPLE AIRPODS PRO WITH WIRELESS CHARGING ORIGINAL - AIRPOD - Free Silicone',
|
||||
price: 219,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/61.jpg',
|
||||
rating: 5,
|
||||
review: 934,
|
||||
sale: 1881,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 5,
|
||||
name: 'NEW Apple Magic Trackpad 2 Space Grey MRMF2 Gray',
|
||||
price: 189,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/73.jpg',
|
||||
rating: 5,
|
||||
review: 36,
|
||||
sale: 112,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 6,
|
||||
name: 'NEW Original Apple TV 4K 64GB 5th Generation',
|
||||
price: 261,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/29.jpg',
|
||||
rating: 5,
|
||||
review: 98,
|
||||
sale: 23,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 7,
|
||||
name: 'Asus Rog Phone 3 Rogphone III Ram 12Gb 512Gb Snapdragon 865+ Plus',
|
||||
price: 1152,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/48.jpg',
|
||||
rating: 5,
|
||||
review: 1,
|
||||
sale: 2,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 8,
|
||||
name: 'Garmin Instinct Tactical - Black',
|
||||
price: 290,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/47.jpg',
|
||||
rating: 5,
|
||||
review: 13,
|
||||
sale: 23,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 9,
|
||||
name: 'XBOX 360 SLIM 500 GB RGH FULL GAME & KINECT',
|
||||
price: 183,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/51.jpg',
|
||||
rating: 4,
|
||||
review: 3,
|
||||
sale: 9,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 10,
|
||||
name: 'TP-Link TL-WR840N (V4.0) : 300Mbps TPLink WiFi Wireless N Router',
|
||||
price: 11,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/53.jpg',
|
||||
rating: 5,
|
||||
review: 1075,
|
||||
sale: 3247,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 11,
|
||||
name:
|
||||
'gopro hero 8 black garansi resmi TAM / go pro hero8 black / 8black',
|
||||
price: 333,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/12.jpg',
|
||||
rating: 5,
|
||||
review: 13,
|
||||
sale: 33,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 12,
|
||||
name: 'Leather Sleeve for 13-inch MacBook Air and MacBook Pro - Black',
|
||||
price: 179,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/75.jpg',
|
||||
rating: 5,
|
||||
review: 120,
|
||||
sale: 131,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 13,
|
||||
name: 'Apple iMac 2020 4K 21.5" inch i3 3.6GHz /8GB/256GB MHK23',
|
||||
price: 1369,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/74.jpg',
|
||||
rating: 0,
|
||||
review: 0,
|
||||
sale: 2,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 14,
|
||||
name: 'Fimi X8 SE Black',
|
||||
price: 567,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/26.jpg',
|
||||
rating: 5,
|
||||
review: 63,
|
||||
sale: 115,
|
||||
location: 'Brooklyn',
|
||||
),
|
||||
SearchProductModel(
|
||||
id: 15,
|
||||
name: 'SAMSUNG GALAXY S20 PLUS RAM 8/128GB',
|
||||
price: 751,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/30.jpg',
|
||||
rating: 5,
|
||||
review: 14,
|
||||
sale: 17,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 16,
|
||||
name:
|
||||
'BARDI Smart Light Bulb Lamp Bohlam LED WIFI RGBWW 12W 12 watt Home IoT',
|
||||
price: 8.6,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/58.jpg',
|
||||
rating: 5,
|
||||
review: 354,
|
||||
sale: 540,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 17,
|
||||
name:
|
||||
'KABEL DATA TYPE-C TO TYPE-C BASEUS HALO DATA CABLE PD 2.0 60W - 0.5 M',
|
||||
price: 3,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/35.jpg',
|
||||
rating: 5,
|
||||
review: 636,
|
||||
sale: 2087,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 18,
|
||||
name:
|
||||
'gopro hero 8 black garansi resmi TAM / go pro hero8 black / 8black',
|
||||
price: 333,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/12.jpg',
|
||||
rating: 5,
|
||||
review: 13,
|
||||
sale: 33,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 19,
|
||||
name:
|
||||
'Samyang Noodle Wholesaler 1 Box (40 Pcs) Hot Spicy Chicken - Original Jan 21',
|
||||
price: 26,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/68.jpg',
|
||||
rating: 5,
|
||||
review: 4,
|
||||
sale: 22,
|
||||
location: 'Brooklyn'),
|
||||
SearchProductModel(
|
||||
id: 20,
|
||||
name: 'SAMSUNG LED TV 32 Inch HD Digital - 32N4003',
|
||||
price: 116,
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/80.jpg',
|
||||
rating: 5,
|
||||
review: 380,
|
||||
sale: 866,
|
||||
location: 'Brooklyn')
|
||||
];
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
|
||||
class ShoppingCartModel {
|
||||
late int id;
|
||||
late String name;
|
||||
late String image;
|
||||
late double price;
|
||||
late int qty;
|
||||
|
||||
ShoppingCartModel(
|
||||
{required this.id,
|
||||
required this.image,
|
||||
required this.name,
|
||||
required this.price,
|
||||
required this.qty});
|
||||
|
||||
void setQty(int i) {
|
||||
if (i < 1) {
|
||||
qty = 1;
|
||||
} else {
|
||||
qty = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<ShoppingCartModel> shoppingCartData = [
|
||||
ShoppingCartModel(
|
||||
id: 1,
|
||||
name:
|
||||
'BARDI Smart Light Bulb Lamp Bohlam LED WIFI RGBWW 12W 12 watt Home IoT',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/58.jpg',
|
||||
price: 8.6,
|
||||
qty: 2,
|
||||
),
|
||||
ShoppingCartModel(
|
||||
id: 2,
|
||||
name:
|
||||
'BARDI Smart UNIVERSAL IR REMOTE Wifi Wireless IoT For Home Automation',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/60.jpg',
|
||||
price: 11.5,
|
||||
qty: 1,
|
||||
),
|
||||
ShoppingCartModel(
|
||||
id: 3,
|
||||
name: 'BARDI Smart PLUG WiFi Wireless Colokan - IoT Smart Home',
|
||||
image: GLOBAL_URL + '/apps/ecommerce/product/69.jpg',
|
||||
price: 11.46,
|
||||
qty: 1,
|
||||
),
|
||||
];
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
import 'dart:convert';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:mobdr/old/login.dart';
|
||||
|
||||
class LocalStorage {
|
||||
// static Future<SharedPreferences> get securePref async =>
|
||||
// await SharedPreferences.getInstance();
|
||||
|
||||
//static FlutterSecureStorage get securePref => FlutterSecureStorage();
|
||||
/*
|
||||
static Future eraseProfileData() async {
|
||||
var loginData = (await getLoginData());
|
||||
loginData?.guid = '';
|
||||
//await saveLoginData(LoginModel: loginData);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
static Future<LoginModel?> getLoginData() async {
|
||||
try {
|
||||
//var loginData = await securePref.read(key: 'loginData');
|
||||
//return LoginModel.fromJson(json.decode(loginData!));
|
||||
return null;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
static Future<LoginModel?> getLoginData() async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
Map<String, dynamic> loginMap = {};
|
||||
final String? loginStr = prefs.getString('loginData');
|
||||
if (loginStr != null) {
|
||||
loginMap = jsonDecode(loginStr) as Map<String, dynamic>;
|
||||
}
|
||||
|
||||
final LoginModel login = LoginModel.fromJson(loginMap);
|
||||
print(login);
|
||||
return login;
|
||||
}
|
||||
|
||||
static Future saveLoginData(LoginModel loginModel) async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
bool result = await prefs.setString('loginData', jsonEncode(loginModel));
|
||||
print(result);
|
||||
}
|
||||
|
||||
/*
|
||||
static Future saveLoginData(LoginModel loginModel) async {
|
||||
return securePref.write(
|
||||
key: 'loginData', value: json.encode(loginModel.toJson()));
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
static Future<UserProfileModel?> getProfileData() async {
|
||||
try {
|
||||
var profileData = await securePref.read(key: 'profileData');
|
||||
return UserProfileModel.fromJson(json.decode(profileData!));
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future saveProfileData(UserProfileModel profileModel) async {
|
||||
try {
|
||||
return securePref.write(
|
||||
key: 'profileData', value: json.encode(profileModel.toJson()));
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future saveItem({@required item, @required key}) async {
|
||||
securePref.write(key: key.toString(), value: item);
|
||||
}
|
||||
|
||||
static Future eraseItem({@required key}) async {
|
||||
securePref.delete(key: '$key');
|
||||
}
|
||||
|
||||
static Future<bool> keyExists(String key) async {
|
||||
return securePref.containsKey(key: key);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
static eraseAll() async {
|
||||
var savedData = await getSavedBooks();
|
||||
for (var item in savedData) {
|
||||
try {
|
||||
await File(await downloadDir(item.id)).delete();
|
||||
} catch (e) {}
|
||||
}
|
||||
securePref.deleteAll();
|
||||
(await prefs).clear();
|
||||
return;
|
||||
}
|
||||
|
||||
static Future<dynamic> getItemData({@required key}) async {
|
||||
return await securePref.containsKey(key: '$key')
|
||||
? securePref.read(key: '$key')
|
||||
: null;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
class LoginModel {
|
||||
int idUtilisateur;
|
||||
String email;
|
||||
int expire;
|
||||
String guid;
|
||||
String langage;
|
||||
String lastTraduction;
|
||||
String login;
|
||||
String nom;
|
||||
String prenom;
|
||||
String version;
|
||||
String photo;
|
||||
|
||||
LoginModel(
|
||||
this.idUtilisateur,
|
||||
this.email,
|
||||
this.expire,
|
||||
this.guid,
|
||||
this.langage,
|
||||
this.lastTraduction,
|
||||
this.login,
|
||||
this.nom,
|
||||
this.prenom,
|
||||
this.version,
|
||||
this.photo);
|
||||
|
||||
LoginModel.fromJson(Map<String, dynamic> json)
|
||||
: idUtilisateur = json['id_utilisateur'],
|
||||
email = json['email'],
|
||||
expire = json['expire'],
|
||||
guid = json['guid'],
|
||||
langage = json['langage'],
|
||||
lastTraduction = json['last_traduction'],
|
||||
login = json['login'],
|
||||
nom = json['nom'],
|
||||
prenom = json['prenom'],
|
||||
version = json['version'],
|
||||
photo = json['photo'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
|
||||
data['id_utilisateur'] = this.idUtilisateur;
|
||||
data['email'] = this.email;
|
||||
data['expire'] = this.expire;
|
||||
data['guid'] = this.guid;
|
||||
data['langage'] = this.langage;
|
||||
data['last_traduction'] = this.lastTraduction;
|
||||
data['login'] = this.login;
|
||||
data['nom'] = this.nom;
|
||||
data['prenom'] = this.prenom;
|
||||
data['version'] = this.version;
|
||||
data['photo'] = this.photo;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
class UserProfileModel {
|
||||
final String name;
|
||||
final String accessToken;
|
||||
final int age;
|
||||
|
||||
UserProfileModel({this.name = '', this.accessToken = '', this.age = 0});
|
||||
|
||||
UserProfileModel.fromJson(Map<String, dynamic> json)
|
||||
: name = json['name'],
|
||||
accessToken = json['accessToken'],
|
||||
age = json['age'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['name'] = this.name;
|
||||
data['accessToken'] = this.accessToken;
|
||||
data['age'] = this.age;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/last_seen_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LastSeenProductPage extends StatefulWidget {
|
||||
@override
|
||||
_LastSeenProductPageState createState() => _LastSeenProductPageState();
|
||||
}
|
||||
|
||||
class _LastSeenProductPageState extends State<LastSeenProductPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 4);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Last Seen Product',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: lastSeenData.length,
|
||||
// Add one more item for progress indicator
|
||||
padding: EdgeInsets.symmetric(vertical: 0),
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildItem(index, boxImageSize);
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildItem(index, boxImageSize) {
|
||||
return Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: lastSeenData[index].name,
|
||||
image: lastSeenData[index].image,
|
||||
price: lastSeenData[index].price,
|
||||
rating: lastSeenData[index].rating,
|
||||
review: lastSeenData[index].review,
|
||||
sale: lastSeenData[index].sale)));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 6, 12, 6),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(4)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: lastSeenData[index].image)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
lastSeenData[index].name,
|
||||
style: GlobalStyle.productName.copyWith(fontSize: 13),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
lastSeenData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.location_on,
|
||||
color: SOFT_GREY, size: 12),
|
||||
Text(' ' + lastSeenData[index].location,
|
||||
style: GlobalStyle.productLocation)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: lastSeenData[index].rating, size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
lastSeenData[index].review.toString() +
|
||||
')',
|
||||
style: GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
lastSeenData[index].sale.toString() + ' Sale',
|
||||
style: GlobalStyle.productSale),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
(index == lastSeenData.length - 1)
|
||||
? Wrap()
|
||||
: Divider(
|
||||
height: 0,
|
||||
color: Colors.grey[400],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,479 +0,0 @@
|
|||
// ignore_for_file: prefer_const_constructors, prefer_interpolation_to_compose_strings, avoid_unnecessary_containers, use_key_in_widget_constructors
|
||||
|
||||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/account/order/order_status.dart';
|
||||
import 'package:mobdr/ui/general/chat_us.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OrderDetailPage extends StatefulWidget {
|
||||
@override
|
||||
_OrderDetailPageState createState() => _OrderDetailPageState();
|
||||
}
|
||||
|
||||
class _OrderDetailPageState extends State<OrderDetailPage> {
|
||||
// initialize global function
|
||||
final _globalFunction = GlobalFunction();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 6);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: 2,
|
||||
title: Text(
|
||||
'Order Detail',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
_createOrderStatus(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 6),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildItemCard(boxImageSize, 1),
|
||||
_buildItemCard(boxImageSize, 2),
|
||||
_buildItemCard(boxImageSize, 3),
|
||||
],
|
||||
),
|
||||
),
|
||||
_createDeliveryDetail(),
|
||||
_createPaymentInformation(),
|
||||
Container(
|
||||
margin: EdgeInsets.all(32),
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor:
|
||||
MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
child: Text(
|
||||
'Chat Us',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
))),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createOrderStatus() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
offset: Offset(0.0, 1.0), //(x,y)
|
||||
blurRadius: 3.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Status', style: TextStyle(color: BLACK_GREY, fontSize: 13)),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Order Completed',
|
||||
style: TextStyle(
|
||||
color: PRIMARY_COLOR,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => OrderStatusPage()));
|
||||
},
|
||||
child: Text('View Status',
|
||||
style: TextStyle(color: PRIMARY_COLOR, fontSize: 13)),
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Order Date',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 13)),
|
||||
Text('3 September 2019 11:32 UTC',
|
||||
style: TextStyle(
|
||||
color: BLACK_GREY,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold))
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('INV385714262',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 13)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildItemCard(boxImageSize, id) {
|
||||
// create local data
|
||||
String name = 'Delta Boots Import 8 Inch';
|
||||
String image = GLOBAL_URL + '/product/25.jpg';
|
||||
int countItem = 1;
|
||||
int weight = 800;
|
||||
double price = 18.3;
|
||||
double totalPrice = 18.3;
|
||||
if (id == 2) {
|
||||
name =
|
||||
'DATA CABLE TYPE-C TO TYPE-C BASEUS HALO DATA CABLE PD 2.0 60W - 0.5 M';
|
||||
image = GLOBAL_URL + '/product/35.jpg';
|
||||
countItem = 2;
|
||||
weight = 100;
|
||||
price = 3;
|
||||
totalPrice = 6;
|
||||
} else if (id == 3) {
|
||||
name = 'TEROPONG MINI 30 X 60 BINOCULARS HD NIGHT VERSION 30 X 60';
|
||||
image = GLOBAL_URL + '/product/2.jpg';
|
||||
countItem = 1;
|
||||
weight = 400;
|
||||
price = 7.2;
|
||||
totalPrice = 7.2;
|
||||
}
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 6, 12, 0),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: name,
|
||||
image: image,
|
||||
price: price,
|
||||
rating: 5,
|
||||
review: 23,
|
||||
sale: 40)));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: image)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
name,
|
||||
style: GlobalStyle.productName.copyWith(
|
||||
fontSize: 14, fontWeight: FontWeight.bold),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
countItem.toString() +
|
||||
' item (' +
|
||||
weight.toString() +
|
||||
' gr)',
|
||||
style: GlobalStyle.shoppingCartOtherProduct
|
||||
.copyWith(color: Colors.grey[400]))),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
'\$' +
|
||||
_globalFunction
|
||||
.removeDecimalZeroFormat(price),
|
||||
style: GlobalStyle.productPrice),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 0,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Total Price', style: TextStyle(fontSize: 12)),
|
||||
Container(
|
||||
child: Text(
|
||||
'\$' +
|
||||
_globalFunction
|
||||
.removeDecimalZeroFormat(totalPrice),
|
||||
style: GlobalStyle.productPrice),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createDeliveryDetail() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
offset: Offset(0.0, 1.0), //(x,y)
|
||||
blurRadius: 3.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Delivery Details',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Table(
|
||||
children: [
|
||||
TableRow(children: [
|
||||
Container(
|
||||
child: Text('Courier Delivery',
|
||||
style: TextStyle(
|
||||
color: BLACK_GREY,
|
||||
fontSize: 13,
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
child: Text('DHL Express',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
)
|
||||
]),
|
||||
TableRow(children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Text('AWB Number',
|
||||
style: TextStyle(
|
||||
color: BLACK_GREY,
|
||||
fontSize: 13,
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Text('5614571226',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
)
|
||||
]),
|
||||
TableRow(children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Text('Delivery Address',
|
||||
style: TextStyle(
|
||||
color: BLACK_GREY,
|
||||
fontSize: 13,
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: Text('Robert Steven',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
child: Text('0811888999',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
child: Text('6019 Madison St',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
child: Text('West New York, NJ 07093',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
child: Text('USA',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
],
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createPaymentInformation() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
offset: Offset(0.0, 1.0), //(x,y)
|
||||
blurRadius: 3.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Payment Information',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Payment Method',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 13)),
|
||||
Text('Visa card ending in 4392',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold))
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Total Price (4 item)',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 13)),
|
||||
Text('\$31.5', style: GlobalStyle.productPrice)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Total Delivery (1.3 Kg)',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 13)),
|
||||
Text('\$19', style: GlobalStyle.productPrice)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Total Payment',
|
||||
style:
|
||||
TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
Text('\$50.5', style: GlobalStyle.productPrice)
|
||||
],
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/order_list_model.dart';
|
||||
import 'package:mobdr/ui/account/order/order_detail.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OrderListPage extends StatefulWidget {
|
||||
@override
|
||||
_OrderListPageState createState() => _OrderListPageState();
|
||||
}
|
||||
|
||||
class _OrderListPageState extends State<OrderListPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 6);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Order List',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: orderListData.length,
|
||||
// Add one more item for progress indicator
|
||||
padding: EdgeInsets.symmetric(vertical: 0),
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildOrderListCard(index, boxImageSize);
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildOrderListCard(index, boxImageSize) {
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 6, 12, 0),
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => OrderDetailPage()));
|
||||
},
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(12),
|
||||
child: Text(orderListData[index].status,
|
||||
style: TextStyle(color: SOFT_BLUE, fontSize: 12)),
|
||||
),
|
||||
Divider(
|
||||
height: 0,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 12, 12, 0),
|
||||
child: Text(orderListData[index].date,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[400])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 8, 12, 0),
|
||||
child: Text(orderListData[index].invoice,
|
||||
style:
|
||||
TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: orderListData[index].image)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
orderListData[index].name,
|
||||
style: GlobalStyle.productName.copyWith(
|
||||
fontSize: 14, fontWeight: FontWeight.bold),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('+2 other product',
|
||||
style: GlobalStyle.shoppingCartOtherProduct
|
||||
.copyWith(color: Colors.grey[400])))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 0,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
alignment: Alignment.topRight,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text('Total Payment', style: TextStyle(fontSize: 12)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
'\$' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
orderListData[index].payment),
|
||||
style: GlobalStyle.productPrice),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OrderStatusPage extends StatefulWidget {
|
||||
@override
|
||||
_OrderStatusPageState createState() => _OrderStatusPageState();
|
||||
}
|
||||
|
||||
class _OrderStatusPageState extends State<OrderStatusPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Order Status',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: Container(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.all(32),
|
||||
children: [
|
||||
_createPathTop('11 Sep 2019 08:40', 'Order Completed',
|
||||
'Your order is completed'),
|
||||
_createPath('11 Sep 2019 08:39', 'Order Arrived',
|
||||
'Your order has arrived'),
|
||||
_createPath('9 Sep 2019 14:12', 'Order Sent',
|
||||
'Your order is being shipped by courier'),
|
||||
_createPath('9 Sep 2019 14:12', 'Ready to Pickup',
|
||||
'Your order is ready to be picked up by the courier'),
|
||||
_createPath('9 Sep 2019 12:12', 'Order Processed',
|
||||
'Your order is being processed'),
|
||||
_createPath('9 Sep 2019 11:52', 'Payment Received',
|
||||
'Payment has been received'),
|
||||
_createPath('9 Sep 2019 11:32', 'Waiting for Payment',
|
||||
'We are waiting for your payment'),
|
||||
_createPathDown('9 Sep 2019 11:32', 'Order Placed',
|
||||
'We have received your order'),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createPathTop(
|
||||
String date, String orderStatus, String orderDescription) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 0),
|
||||
width: 16,
|
||||
height: 16,
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape
|
||||
.circle, // You can use like this way or like the below line
|
||||
//borderRadius: new BorderRadius.circular(30.0),
|
||||
color: PRIMARY_COLOR,
|
||||
),
|
||||
),
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 7.5, right: 7.5),
|
||||
child: Container(
|
||||
width: 1,
|
||||
color: PRIMARY_COLOR,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 32, right: 32),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(orderStatus,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: CHARCOAL)),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(date,
|
||||
style:
|
||||
TextStyle(color: Colors.grey[400], fontSize: 11)),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(orderDescription,
|
||||
style: TextStyle(color: BLACK_GREY)),
|
||||
SizedBox(
|
||||
height: 24,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createPath(String date, String orderStatus, String orderDescription) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 0),
|
||||
width: 16,
|
||||
height: 16,
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape
|
||||
.circle, // You can use like this way or like the below line
|
||||
//borderRadius: new BorderRadius.circular(30.0),
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 7.5, right: 7.5),
|
||||
child: Container(
|
||||
width: 1,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 32, right: 32),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(orderStatus,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: CHARCOAL)),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(date,
|
||||
style:
|
||||
TextStyle(color: Colors.grey[400], fontSize: 11)),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(orderDescription,
|
||||
style: TextStyle(color: BLACK_GREY)),
|
||||
SizedBox(
|
||||
height: 24,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createPathDown(
|
||||
String date, String orderStatus, String orderDescription) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 0),
|
||||
width: 16,
|
||||
height: 16,
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape
|
||||
.circle, // You can use like this way or like the below line
|
||||
//borderRadius: new BorderRadius.circular(30.0),
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 48, right: 48),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(orderStatus,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: CHARCOAL)),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(date,
|
||||
style:
|
||||
TextStyle(color: Colors.grey[400], fontSize: 11)),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(orderDescription,
|
||||
style: TextStyle(color: BLACK_GREY)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,351 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AddPaymentMethodPage extends StatefulWidget {
|
||||
@override
|
||||
_AddPaymentMethodPageState createState() => _AddPaymentMethodPageState();
|
||||
}
|
||||
|
||||
class _AddPaymentMethodPageState extends State<AddPaymentMethodPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
List<String> _monthList = [];
|
||||
List<String> _yearList = [];
|
||||
String? _expiredMonth;
|
||||
String? _expiredYear;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_initForLang();
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _initForLang() {
|
||||
setState(() {
|
||||
_expiredMonth = 'Month';
|
||||
_expiredYear = 'Year';
|
||||
// select box data for month of credit card
|
||||
_monthList.add('Month');
|
||||
_monthList.add("01");
|
||||
_monthList.add('02');
|
||||
_monthList.add('03');
|
||||
_monthList.add('04');
|
||||
_monthList.add('05');
|
||||
_monthList.add('06');
|
||||
_monthList.add('07');
|
||||
_monthList.add('08');
|
||||
_monthList.add('09');
|
||||
_monthList.add('10');
|
||||
_monthList.add('11');
|
||||
_monthList.add('12');
|
||||
|
||||
// select box data for year of credit card
|
||||
_yearList.add('Year');
|
||||
_yearList.add("2020");
|
||||
_yearList.add('2021');
|
||||
_yearList.add('2022');
|
||||
_yearList.add('2023');
|
||||
_yearList.add('2024');
|
||||
_yearList.add('2025');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Add Payment Method',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
Text('Credit Card Information',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: Image.asset('assets/images/visa.png', height: 10),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child:
|
||||
Image.asset('assets/images/mastercard.png', height: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Credit Card Number *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Name of Cardholder *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text('Expired Date *',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 12)),
|
||||
Row(
|
||||
children: [
|
||||
_buildExpiredMonth(),
|
||||
SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
_buildExpiredYear(),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
),
|
||||
Text('Billing Information',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Full Name *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Company Name',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 1 *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 2',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'City *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'State / Province / Region *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Postal Code *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Recipient\'s Phone Number *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Container(
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
_reusableWidget.startLoading(
|
||||
context, 'Add Payment Method Success', 1);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
// dropdown menu
|
||||
DropdownButton<String> _buildExpiredMonth() {
|
||||
return DropdownButton<String>(
|
||||
value: _expiredMonth,
|
||||
icon: Icon(Icons.arrow_drop_down),
|
||||
iconSize: 24,
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Colors.grey[700], fontSize: 16),
|
||||
underline: Container(
|
||||
height: 1,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
onChanged: (String? data) {
|
||||
setState(() {
|
||||
_expiredMonth = data!;
|
||||
});
|
||||
},
|
||||
items: _monthList.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Container(
|
||||
child: Text(value),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
DropdownButton<String> _buildExpiredYear() {
|
||||
return DropdownButton<String>(
|
||||
value: _expiredYear,
|
||||
icon: Icon(Icons.arrow_drop_down),
|
||||
iconSize: 24,
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Colors.grey[700], fontSize: 16),
|
||||
underline: Container(
|
||||
height: 1,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
onChanged: (String? data) {
|
||||
setState(() {
|
||||
_expiredYear = data!;
|
||||
});
|
||||
},
|
||||
items: _yearList.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Container(
|
||||
child: Text(value),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,381 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EditPaymentMethodPage extends StatefulWidget {
|
||||
@override
|
||||
_EditPaymentMethodPageState createState() => _EditPaymentMethodPageState();
|
||||
}
|
||||
|
||||
class _EditPaymentMethodPageState extends State<EditPaymentMethodPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
TextEditingController _etCreditCardNumber = TextEditingController();
|
||||
TextEditingController _etCreditCardName = TextEditingController();
|
||||
TextEditingController _etFullName = TextEditingController();
|
||||
TextEditingController _etAddressLine1 = TextEditingController();
|
||||
TextEditingController _etAddressLine2 = TextEditingController();
|
||||
TextEditingController _etCity = TextEditingController();
|
||||
TextEditingController _etState = TextEditingController();
|
||||
TextEditingController _etPostalCode = TextEditingController();
|
||||
TextEditingController _etPhoneNumber = TextEditingController();
|
||||
|
||||
List<String> _monthList = [];
|
||||
List<String> _yearList = [];
|
||||
String _expiredMonth = "04";
|
||||
String _expiredYear = "2023";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_etCreditCardNumber = TextEditingController(text: '4485653755194392');
|
||||
_etCreditCardName = TextEditingController(text: 'Robert Steven');
|
||||
_etFullName = TextEditingController(text: 'Robert Steven');
|
||||
_etAddressLine1 = TextEditingController(
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
|
||||
_etAddressLine2 = TextEditingController(
|
||||
text:
|
||||
'Quisque tortor tortor, ultrices id scelerisque a, elementum id elit.');
|
||||
_etCity = TextEditingController(text: 'New York City');
|
||||
_etState = TextEditingController(text: 'New York');
|
||||
_etPostalCode = TextEditingController(text: '10010');
|
||||
_etPhoneNumber = TextEditingController(text: '0811888999');
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_initForLang();
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _initForLang() {
|
||||
setState(() {
|
||||
// select box data for month of credit card
|
||||
_monthList.add('Month');
|
||||
_monthList.add("01");
|
||||
_monthList.add('02');
|
||||
_monthList.add('03');
|
||||
_monthList.add('04');
|
||||
_monthList.add('05');
|
||||
_monthList.add('06');
|
||||
_monthList.add('07');
|
||||
_monthList.add('08');
|
||||
_monthList.add('09');
|
||||
_monthList.add('10');
|
||||
_monthList.add('11');
|
||||
_monthList.add('12');
|
||||
|
||||
// select box data for year of credit card
|
||||
_yearList.add('Year');
|
||||
_yearList.add("2020");
|
||||
_yearList.add('2021');
|
||||
_yearList.add('2022');
|
||||
_yearList.add('2023');
|
||||
_yearList.add('2024');
|
||||
_yearList.add('2025');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Edit Payment Method',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
Text('Credit Card Information',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: Image.asset('assets/images/visa.png', height: 10),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child:
|
||||
Image.asset('assets/images/mastercard.png', height: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _etCreditCardNumber,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Credit Card Number *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etCreditCardName,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Name of Cardholder *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text('Expired Date *',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 12)),
|
||||
Row(
|
||||
children: [
|
||||
_buildExpiredMonth(),
|
||||
SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
_buildExpiredYear(),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
),
|
||||
Text('Billing Information',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
|
||||
TextField(
|
||||
controller: _etFullName,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Full Name *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Company Name',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etAddressLine1,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 1 *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etAddressLine2,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 2',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etCity,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'City *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etState,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'State / Province / Region *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etPostalCode,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Postal Code *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etPhoneNumber,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Phone Number *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Container(
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
_reusableWidget.startLoading(
|
||||
context, 'Edit Payment Method Success', 1);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
// dropdown menu
|
||||
DropdownButton<String> _buildExpiredMonth() {
|
||||
return DropdownButton<String>(
|
||||
value: _expiredMonth,
|
||||
icon: Icon(Icons.arrow_drop_down),
|
||||
iconSize: 24,
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Colors.grey[700], fontSize: 16),
|
||||
underline: Container(
|
||||
height: 1,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
onChanged: (String? data) {
|
||||
setState(() {
|
||||
_expiredMonth = data!;
|
||||
});
|
||||
},
|
||||
items: _monthList.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Container(
|
||||
child: Text(value),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
DropdownButton<String> _buildExpiredYear() {
|
||||
return DropdownButton<String>(
|
||||
value: _expiredYear,
|
||||
icon: Icon(Icons.arrow_drop_down),
|
||||
iconSize: 24,
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Colors.grey[700], fontSize: 16),
|
||||
underline: Container(
|
||||
height: 1,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
onChanged: (String? data) {
|
||||
setState(() {
|
||||
_expiredYear = data!;
|
||||
});
|
||||
},
|
||||
items: _yearList.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Container(
|
||||
child: Text(value),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AddAddressPage extends StatefulWidget {
|
||||
@override
|
||||
_AddAddressPageState createState() => _AddAddressPageState();
|
||||
}
|
||||
|
||||
class _AddAddressPageState extends State<AddAddressPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Add Address',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Title *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Recipient\'s Name *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Recipient\'s Phone Number',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 1 *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 2',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'State / Province / Region *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Postal Code *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Container(
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
_reusableWidget.startLoading(
|
||||
context, 'Add Address Success', 1);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EditAddressPage extends StatefulWidget {
|
||||
@override
|
||||
_EditAddressPageState createState() => _EditAddressPageState();
|
||||
}
|
||||
|
||||
class _EditAddressPageState extends State<EditAddressPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
// create controller to edit text field
|
||||
TextEditingController _etAddressTitle = TextEditingController();
|
||||
TextEditingController _etRecipientName = TextEditingController();
|
||||
TextEditingController _etRecipientPhoneNumber = TextEditingController();
|
||||
TextEditingController _etAddressLine1 = TextEditingController();
|
||||
TextEditingController _etAddressLine2 = TextEditingController();
|
||||
TextEditingController _etPostalCode = TextEditingController();
|
||||
TextEditingController _etState = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_etAddressTitle = TextEditingController(text: 'Home Address');
|
||||
_etRecipientName = TextEditingController(text: 'Robert Steven');
|
||||
_etRecipientPhoneNumber = TextEditingController(text: '0811888999');
|
||||
_etAddressLine1 = TextEditingController(text: '6019 Madison St');
|
||||
_etAddressLine2 = TextEditingController(text: 'West New York, NJ');
|
||||
_etPostalCode = TextEditingController(text: '07093');
|
||||
_etState = TextEditingController(text: 'USA');
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Edit Address',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
TextField(
|
||||
controller: _etAddressTitle,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Title *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etRecipientName,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Recipient\'s Name *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etRecipientPhoneNumber,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Recipient\'s Phone Number',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etAddressLine1,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 1 *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etAddressLine2,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Address Line 2',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etState,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'State / Province / Region *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextField(
|
||||
controller: _etPostalCode,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC)),
|
||||
),
|
||||
labelText: 'Postal Code *',
|
||||
labelStyle: TextStyle(color: BLACK_GREY)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Container(
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
_reusableWidget.startLoading(
|
||||
context, 'Edit Address Success', 1);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,260 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/address_model.dart';
|
||||
import 'package:mobdr/ui/account/set_address/add_address.dart';
|
||||
import 'package:mobdr/ui/account/set_address/edit_address.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class SetAddressPage extends StatefulWidget {
|
||||
@override
|
||||
_SetAddressPageState createState() => _SetAddressPageState();
|
||||
}
|
||||
|
||||
class _SetAddressPageState extends State<SetAddressPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Set Address',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 20.0),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AddAddressPage()));
|
||||
},
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
size: 26.0,
|
||||
),
|
||||
)),
|
||||
],
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: addressData.length,
|
||||
// Add one more item for progress indicator
|
||||
padding: EdgeInsets.symmetric(vertical: 0),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildAddressCard(index);
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildAddressCard(int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 6, 12, 0),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// if default address == true, add default label
|
||||
addressData[index].defaultAddress == true
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(addressData[index].title,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 16)),
|
||||
_reusableWidget.createDefaultLabel(context)
|
||||
],
|
||||
)
|
||||
: Text(addressData[index].title,
|
||||
style: GlobalStyle.addressTitle),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
child: Text(addressData[index].recipientName,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(addressData[index].phoneNumber,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(addressData[index].addressLine1,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
addressData[index].addressLine2 +
|
||||
' ' +
|
||||
addressData[index].postalCode,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(addressData[index].state,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
addressData[index].defaultAddress == false
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
_showPopupMakeDefault();
|
||||
},
|
||||
child: Text('Make Default',
|
||||
style: GlobalStyle.addressAction),
|
||||
)
|
||||
: Wrap(),
|
||||
index != 0
|
||||
? SizedBox(
|
||||
width: 12,
|
||||
)
|
||||
: Wrap(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => EditAddressPage()));
|
||||
},
|
||||
child: Text('Edit', style: GlobalStyle.addressAction),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_showPopupDeleteAddress(index);
|
||||
},
|
||||
child: Text('Delete', style: GlobalStyle.addressAction),
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showPopupDeleteAddress(int index) {
|
||||
// set up the buttons
|
||||
Widget cancelButton = TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('No', style: TextStyle(color: SOFT_BLUE)));
|
||||
Widget continueButton = TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
if (index == 0) {
|
||||
Fluttertoast.showToast(
|
||||
msg:
|
||||
'Please change default address if you want to delete this address',
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
} else {
|
||||
setState(() {
|
||||
addressData.removeAt(index);
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Text('Yes', style: TextStyle(color: SOFT_BLUE)));
|
||||
|
||||
// set up the AlertDialog
|
||||
AlertDialog alert = AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
title: Text(
|
||||
'Delete Address',
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
content: Text('Are you sure to delete this address ?',
|
||||
style: TextStyle(fontSize: 13, color: BLACK_GREY)),
|
||||
actions: [
|
||||
cancelButton,
|
||||
continueButton,
|
||||
],
|
||||
);
|
||||
|
||||
// show the dialog
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _showPopupMakeDefault() {
|
||||
// set up the buttons
|
||||
Widget cancelButton = TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('No', style: TextStyle(color: SOFT_BLUE)));
|
||||
Widget continueButton = TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
_reusableWidget.startLoading(context, 'Success', 0);
|
||||
},
|
||||
child: Text('Yes', style: TextStyle(color: SOFT_BLUE)));
|
||||
|
||||
// set up the AlertDialog
|
||||
AlertDialog alert = AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
title: Text(
|
||||
'Make Default',
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
content: Text('Are you sure to make this address as a default address ?',
|
||||
style: TextStyle(fontSize: 13, color: BLACK_GREY)),
|
||||
actions: [
|
||||
cancelButton,
|
||||
continueButton,
|
||||
],
|
||||
);
|
||||
|
||||
// show the dialog
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,11 +8,8 @@ import 'package:mobdr/config/global_style.dart';
|
|||
import 'package:mobdr/service/shared_prefs.dart';
|
||||
import 'package:mobdr/ui/account/about.dart';
|
||||
import 'package:mobdr/ui/account/account_information/account_information.dart';
|
||||
import 'package:mobdr/ui/account/last_seen_product.dart';
|
||||
import 'package:mobdr/ui/account/notification_setting.dart';
|
||||
import 'package:mobdr/ui/account/order/order_list.dart';
|
||||
import 'package:mobdr/ui/account/log.dart';
|
||||
import 'package:mobdr/ui/account/set_address/set_address.dart';
|
||||
import 'package:mobdr/ui/general/notification.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -76,12 +73,6 @@ class _TabAccountPageState extends State<TabAccountPage>
|
|||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
_createAccountInformation(),
|
||||
_createListMenu('Set Address for Delivery', SetAddressPage()),
|
||||
_reusableWidget.divider1(),
|
||||
_createListMenu('Order List', OrderListPage()),
|
||||
_reusableWidget.divider1(),
|
||||
_createListMenu('Last Seen Product', LastSeenProductPage()),
|
||||
_reusableWidget.divider1(),
|
||||
_createListMenu('Notification Setting', NotificationSettingPage()),
|
||||
_reusableWidget.divider1(),
|
||||
_createListMenu('About', AboutPage()),
|
||||
|
|
|
|||
|
|
@ -1,345 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/chat_model.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ChatUsPage extends StatefulWidget {
|
||||
@override
|
||||
_ChatUsPageState createState() => _ChatUsPageState();
|
||||
}
|
||||
|
||||
class _ChatUsPageState extends State<ChatUsPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
TextEditingController _etChat = TextEditingController();
|
||||
|
||||
String _lastDate = '13 Sep 2019';
|
||||
|
||||
List<ChatModel> _chatList = [];
|
||||
List<ChatModel> _chatListReversed = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_initForLang();
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _initForLang() {
|
||||
setState(() {
|
||||
// set chat dummy data
|
||||
_chatList.add(new ChatModel(1, null, 'date', '9 Sep 2019', null, null));
|
||||
_chatList.add(
|
||||
new ChatModel(2, 'buyer', 'text', 'Good morning', '13:59', true));
|
||||
_chatList.add(new ChatModel(
|
||||
3, 'buyer', 'image', GLOBAL_URL + '/product/80.jpg', null, null));
|
||||
_chatList.add(new ChatModel(4, 'buyer', 'text',
|
||||
'I want to ask about the samsung tv product', '13:59', true));
|
||||
_chatList.add(new ChatModel(5, 'buyer', 'text',
|
||||
'Is the Samsung LED TV 32 Inch is still on sale ?', '14:01', true));
|
||||
_chatList.add(new ChatModel(6, 'seller', 'text',
|
||||
'Hello, thank you for contacting us', '14:18', true));
|
||||
_chatList.add(new ChatModel(
|
||||
7,
|
||||
'seller',
|
||||
'text',
|
||||
'We are sorry, but the promotion for Samsung LED TV 32 Inch has ended. Don\'t forget to turn on notification setting for promotion so you will get the news about our product',
|
||||
'14:20',
|
||||
null));
|
||||
_chatList.add(new ChatModel(8, 'buyer', 'text',
|
||||
'Ok, thank you for your information.', '14:22', true));
|
||||
_chatList.add(new ChatModel(9, null, 'date', '13 Sep 2019', null, null));
|
||||
_chatList.add(new ChatModel(
|
||||
10, 'buyer', 'image', GLOBAL_URL + '/product/21.jpg', null, null));
|
||||
_chatList.add(new ChatModel(
|
||||
11,
|
||||
'buyer',
|
||||
'text',
|
||||
'Hi, is Adidas Polo Shirt size L is ready ? For the black color.',
|
||||
'08:58',
|
||||
true));
|
||||
_chatList.add(new ChatModel(
|
||||
12, 'buyer', 'text', 'I want to order for 2 pcs.', '09:00', true));
|
||||
_chatList.add(new ChatModel(
|
||||
13,
|
||||
'buyer',
|
||||
'text',
|
||||
'And can I change it if the size doesn\'t fit my body?',
|
||||
'09:00',
|
||||
true));
|
||||
_chatList.add(new ChatModel(
|
||||
14,
|
||||
'seller',
|
||||
'text',
|
||||
'Hello, good morning. The product is ready and you can change if the size is not fit your body',
|
||||
'09:14',
|
||||
null));
|
||||
|
||||
// reverse the list
|
||||
_chatListReversed = _chatList.reversed.toList();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_etChat.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _addDate(String currentDate) {
|
||||
_chatListReversed.insert(
|
||||
0, new ChatModel(15, null, 'date', currentDate, null, null));
|
||||
}
|
||||
|
||||
void _addMessage(String message) {
|
||||
DateTime now = DateTime.now();
|
||||
String _currentTime = DateFormat('kk:mm').format(now);
|
||||
_chatListReversed.insert(
|
||||
0, new ChatModel(16, 'buyer', 'text', message, _currentTime, false));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Chat',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView.builder(
|
||||
reverse: true,
|
||||
itemCount: _chatListReversed.length,
|
||||
padding: EdgeInsets.all(16),
|
||||
itemBuilder: (context, index) {
|
||||
if (_chatListReversed[index].getTextImageDate == 'date') {
|
||||
return _buildDate(_chatListReversed[index].getMessage);
|
||||
} else if (_chatListReversed[index].getTextImageDate ==
|
||||
'image') {
|
||||
return _buildImage(_chatListReversed[index].getMessage);
|
||||
} else {
|
||||
if (_chatListReversed[index].getType == 'buyer') {
|
||||
return _buildChatBuyer(
|
||||
_chatListReversed[index].getMessage,
|
||||
_chatListReversed[index].getDate!,
|
||||
_chatListReversed[index].getRead!);
|
||||
} else {
|
||||
return _buildChatSeller(
|
||||
_chatListReversed[index].getMessage,
|
||||
_chatListReversed[index].getDate!);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: TextFormField(
|
||||
controller: _etChat,
|
||||
minLines: 1,
|
||||
maxLines: 4,
|
||||
textAlignVertical: TextAlignVertical.bottom,
|
||||
style: TextStyle(fontSize: 16, color: Colors.grey[600]),
|
||||
onChanged: (textValue) {
|
||||
setState(() {});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.grey[200],
|
||||
filled: true,
|
||||
hintText: 'Write Message',
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Colors.grey[200]!)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Colors.grey[200]!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (_etChat.text != '') {
|
||||
print('send message : ' + _etChat.text);
|
||||
setState(() {
|
||||
DateTime now = DateTime.now();
|
||||
String currentDate =
|
||||
DateFormat('d MMM yyyy').format(now);
|
||||
if (_lastDate != currentDate) {
|
||||
_lastDate = currentDate;
|
||||
_addDate(currentDate);
|
||||
}
|
||||
_addMessage(_etChat.text);
|
||||
_etChat.text = '';
|
||||
});
|
||||
}
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Container(
|
||||
color: SOFT_BLUE,
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Icon(Icons.send, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildDate(String date) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Center(
|
||||
child: Text(date, style: TextStyle(color: SOFT_GREY, fontSize: 11)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildChatBuyer(String message, String time, bool read) {
|
||||
final double boxChatSize = MediaQuery.of(context).size.width / 1.3;
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
constraints: BoxConstraints(maxWidth: boxChatSize),
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 1, color: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(5),
|
||||
bottomLeft: Radius.circular(5),
|
||||
bottomRight: Radius.circular(12),
|
||||
),
|
||||
color: Colors.grey[300]),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(message, style: TextStyle(color: CHARCOAL)),
|
||||
),
|
||||
Wrap(
|
||||
children: [
|
||||
SizedBox(width: 4),
|
||||
Icon(Icons.done_all,
|
||||
color: read == true ? PRIMARY_COLOR : SOFT_GREY,
|
||||
size: 11),
|
||||
SizedBox(width: 2),
|
||||
Text(time, style: TextStyle(color: SOFT_GREY, fontSize: 9)),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildChatSeller(String message, String date) {
|
||||
final double boxChatSize = MediaQuery.of(context).size.width / 1.3;
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Wrap(
|
||||
children: [
|
||||
Container(
|
||||
constraints: BoxConstraints(maxWidth: boxChatSize),
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 1, color: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(5),
|
||||
bottomLeft: Radius.circular(12),
|
||||
bottomRight: Radius.circular(5),
|
||||
)),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(message, style: TextStyle(color: CHARCOAL)),
|
||||
),
|
||||
Wrap(
|
||||
children: [
|
||||
SizedBox(width: 2),
|
||||
Text(date,
|
||||
style: TextStyle(color: SOFT_GREY, fontSize: 9)),
|
||||
],
|
||||
)
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildImage(String imageUrl) {
|
||||
final double boxChatSize = MediaQuery.of(context).size.width / 1.3;
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 6);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
constraints: BoxConstraints(maxWidth: boxChatSize),
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 1, color: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(5),
|
||||
bottomLeft: Radius.circular(5),
|
||||
bottomRight: Radius.circular(12),
|
||||
)),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: imageUrl)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,6 @@ import 'dart:async';
|
|||
|
||||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/account/order/order_status.dart';
|
||||
import 'package:mobdr/ui/home/flashsale.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
|
@ -47,61 +45,7 @@ class _NotificationPageState extends State<NotificationPage> {
|
|||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: Container(
|
||||
child: ListView(children: <Widget>[
|
||||
_createItem(
|
||||
notifDate: '11 Sep 2019 08:40',
|
||||
notifTitle: 'Order Completed',
|
||||
notifMessage: 'Your order is completed',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '11 Sep 2019 08:39',
|
||||
notifTitle: 'Order Arrived',
|
||||
notifMessage: 'Your order has arrived',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '10 Sep 2019 10:00',
|
||||
notifTitle: 'Flash Sale',
|
||||
notifMessage:
|
||||
'Hi Robert Steven, Flash Sale is open in 10 minutes. Grab your favorite product on sale',
|
||||
page: FlashSalePage()),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 14:12',
|
||||
notifTitle: 'Order Sent',
|
||||
notifMessage: 'Your order is being shipped by courier',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 14:12',
|
||||
notifTitle: 'Ready to Pickup',
|
||||
notifMessage:
|
||||
'Your order is ready to be picked up by the courier',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 13:00',
|
||||
notifTitle: 'Trending Product',
|
||||
notifMessage:
|
||||
'Hi Robert Steven, there is a trending product for you, check it out now'),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 12:12',
|
||||
notifTitle: 'Order Processed',
|
||||
notifMessage: 'Your order is being processed',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 11:52',
|
||||
notifTitle: 'Payment Received',
|
||||
notifMessage: 'Payment has been received',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 11:32',
|
||||
notifTitle: 'Waiting for Payment',
|
||||
notifMessage: 'We are waiting for your payment',
|
||||
page: OrderStatusPage()),
|
||||
_createItem(
|
||||
notifDate: '9 Sep 2019 11:32',
|
||||
notifTitle: 'Order Placed',
|
||||
notifMessage: 'We have received your order',
|
||||
page: OrderStatusPage()),
|
||||
])),
|
||||
child: Container(child: ListView(children: <Widget>[])),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,269 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DeliveryEstimatedPage extends StatefulWidget {
|
||||
@override
|
||||
_DeliveryEstimatedPageState createState() => _DeliveryEstimatedPageState();
|
||||
}
|
||||
|
||||
class _DeliveryEstimatedPageState extends State<DeliveryEstimatedPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Delivery Estimated',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
children: [_createLocationInformation(), _createCourierInformation()],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createLocationInformation() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Location',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Text('Delivery from :',
|
||||
style: TextStyle(color: SOFT_GREY, fontSize: 14)),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text('Brooklyn, NY 11204, USA',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Text('Delivery to :',
|
||||
style: TextStyle(color: SOFT_GREY, fontSize: 14)),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Container(
|
||||
child: Text('Robert Steven',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('0811888999',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('6019 Madison St',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('West New York, NJ 07093',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('USA', style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createCourierInformation() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Courier', style: GlobalStyle.chooseCourier),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text('Courier price based on weight per 1000gr',
|
||||
style: TextStyle(color: SOFT_GREY, fontSize: 14)),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('DHL', style: GlobalStyle.courierTitle),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$13', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$22', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('FedEx', style: GlobalStyle.courierTitle),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 1', style: GlobalStyle.courierTitle),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 2', style: GlobalStyle.courierTitle),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 3', style: GlobalStyle.courierTitle),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 4', style: GlobalStyle.courierTitle),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProductDescriptionPage extends StatefulWidget {
|
||||
final String name, image;
|
||||
|
||||
const ProductDescriptionPage({Key? key, this.name = '', this.image = ''})
|
||||
: super(key: key);
|
||||
@override
|
||||
_ProductDescriptionPageState createState() => _ProductDescriptionPageState();
|
||||
}
|
||||
|
||||
class _ProductDescriptionPageState extends State<ProductDescriptionPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 4);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Product Description',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
_createProductImageAndTitle(boxImageSize),
|
||||
Divider(height: 0, color: Colors.grey[400]),
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales. Nulla at cursus eros. Integer porttitor ac ipsum quis sollicitudin. Sed mollis sapien massa, et dignissim turpis vulputate et. Ut ac odio porta, blandit velit in, pharetra lacus. Integer aliquam dolor nec augue porttitor hendrerit. Vestibulum aliquam urna finibus, luctus felis nec, hendrerit augue. Fusce eget lacinia leo. Vivamus porttitor, lacus eget rutrum tempus, odio magna tincidunt elit, ut vulputate nibh velit eu lectus. Morbi felis mi, efficitur sed diam in, elementum ullamcorper leo. Ut bibendum lorem consectetur pellentesque gravida. Sed est orci, consectetur id nunc quis, volutpat consectetur nisi.\n\n' +
|
||||
'Donec est neque, accumsan sit amet imperdiet porta, suscipit eu ex. Phasellus lobortis mollis pharetra. Donec maximus rhoncus elit, sed pellentesque justo pretium vel. Integer vitae facilisis lectus. Suspendisse potenti. Mauris iaculis placerat feugiat. Integer commodo dui sit amet finibus congue. Nulla egestas lacus vel elit aliquet, at pulvinar ex venenatis. Vivamus eget maximus libero, quis vulputate diam. Pellentesque vel justo vel lectus viverra aliquet ut eget metus.\n\n' +
|
||||
'Vivamus malesuada velit pretium laoreet pulvinar. Duis non dignissim sapien, vitae viverra purus. Curabitur a gravida mauris. Nullam turpis odio, ultricies sed ultricies non, sodales eget purus. Donec pulvinar bibendum metus vitae ornare. Phasellus eleifend orci eget blandit sollicitudin. Sed sed urna in magna dignissim eleifend.\n\n' +
|
||||
'Vestibulum vitae erat maximus, laoreet ex quis, laoreet nunc. Sed porttitor massa eget cursus rhoncus. Suspendisse et tellus et enim ullamcorper semper eget in nisl. Nam metus mauris, sollicitudin in venenatis at, pretium at nulla. Sed a accumsan dui. Quisque fermentum mollis erat, ac fringilla eros auctor eu. Donec placerat mi ut sem ullamcorper tempor. Pellentesque ut nulla sollicitudin, tempus arcu quis, vulputate dolor. Sed ultrices cursus nisl, nec tempor neque tempus at. Pellentesque nec dolor faucibus, porttitor quam sed, vehicula est. Vestibulum placerat placerat neque eu posuere. Pellentesque id mauris hendrerit, placerat lacus id, auctor eros. Praesent vestibulum mattis est, non facilisis urna accumsan et. Vestibulum scelerisque ornare sapien, nec blandit purus rhoncus mollis. Sed faucibus, augue consequat rhoncus rutrum, sapien mauris dictum quam, nec tempus orci urna vitae lorem. Curabitur sit amet nisl et lacus fringilla pulvinar.'),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createProductImageAndTitle(boxImageSize) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(24),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(4)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: widget.image)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: GlobalStyle.productName
|
||||
.copyWith(fontSize: 14, fontWeight: FontWeight.bold),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,792 +0,0 @@
|
|||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/related_product_model.dart';
|
||||
import 'package:mobdr/model/review_model.dart';
|
||||
import 'package:mobdr/ui/general/chat_us.dart';
|
||||
import 'package:mobdr/ui/general/notification.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/delivery_estimated.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_description.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_review.dart';
|
||||
import 'package:mobdr/ui/home/product_category.dart';
|
||||
import 'package:mobdr/ui/home/search.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/shopping_cart/tab_shopping_cart.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class ProductDetailPage extends StatefulWidget {
|
||||
final String name;
|
||||
final String image;
|
||||
final double price;
|
||||
final int photo;
|
||||
final double rating;
|
||||
final int review;
|
||||
final int sale;
|
||||
final String date;
|
||||
|
||||
const ProductDetailPage(
|
||||
{Key? key,
|
||||
this.name = '',
|
||||
this.image = '',
|
||||
this.price = 24,
|
||||
this.photo = 1,
|
||||
this.rating = 4,
|
||||
this.review = 45,
|
||||
this.sale = 63,
|
||||
this.date = ''})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_ProductDetailPageState createState() => _ProductDetailPageState();
|
||||
}
|
||||
|
||||
class _ProductDetailPageState extends State<ProductDetailPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
final List<String> _imgProductSlider = [];
|
||||
int _currentImageSlider = 0;
|
||||
|
||||
// size data
|
||||
List<String> _sizeList = ['XS', 'S', 'M', 'L', 'XL', 'XXL'];
|
||||
int _sizeIndex = 0;
|
||||
|
||||
// color data
|
||||
List<String> _colorList = [
|
||||
'Red',
|
||||
'Black',
|
||||
'Green',
|
||||
'White',
|
||||
'Blue',
|
||||
'Yellow',
|
||||
'Pink'
|
||||
];
|
||||
int _colorIndex = 0;
|
||||
|
||||
// wishlist
|
||||
bool _isLove = false;
|
||||
|
||||
// shopping cart count
|
||||
int _shoppingCartCount = 3;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// image slider for the product
|
||||
_imgProductSlider.add(widget.image);
|
||||
_imgProductSlider.add(widget.image);
|
||||
_imgProductSlider.add(widget.image);
|
||||
_imgProductSlider.add(widget.image);
|
||||
_imgProductSlider.add(widget.image);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 3);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
titleSpacing: 0.0,
|
||||
// create search text field in the app bar
|
||||
title: Container(
|
||||
margin: EdgeInsets.only(right: 16),
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => Colors.grey[100]!,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => SearchPage()));
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 8),
|
||||
Icon(Icons.search, color: Colors.grey[500], size: 18),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'Search Product',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.normal),
|
||||
)
|
||||
],
|
||||
)),
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
actions: [
|
||||
IconButton(
|
||||
padding: EdgeInsets.all(0),
|
||||
constraints: BoxConstraints(),
|
||||
icon: _customShoppingCart(_shoppingCartCount),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TabShoppingCartPage()));
|
||||
}),
|
||||
IconButton(
|
||||
icon: _reusableWidget.customNotifIcon(
|
||||
count: 8, notifColor: BLACK_GREY),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => NotificationPage()));
|
||||
}),
|
||||
],
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
_createProductSlider(),
|
||||
_createProductPriceTitleEtc(),
|
||||
_createProductVariant(),
|
||||
_createDeliveryEstimated(),
|
||||
_createProductInformation(),
|
||||
_createProductDescription(),
|
||||
_createProductRelated(boxImageSize),
|
||||
_createProductReview(),
|
||||
SizedBox(height: 16)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
offset: Offset(0.0, 1.0), //(x,y)
|
||||
blurRadius: 2.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChatUsPage()));
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Container(
|
||||
color: SOFT_BLUE,
|
||||
padding: EdgeInsets.all(9),
|
||||
child: Icon(Icons.chat,
|
||||
color: Colors.white, size: 16)),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_shoppingCartCount++;
|
||||
});
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Item has been added to Shopping Cart',
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(width: 1, color: SOFT_BLUE),
|
||||
borderRadius: BorderRadius.all(Radius.circular(
|
||||
10) // <--- border radius here
|
||||
)),
|
||||
child: Text('Add to Shopping Cart',
|
||||
style: TextStyle(
|
||||
color: SOFT_BLUE,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _customShoppingCart(int count) {
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
Icon(Icons.shopping_cart, color: BLACK_GREY),
|
||||
Positioned(
|
||||
right: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(1),
|
||||
decoration: BoxDecoration(
|
||||
color: ASSENT_COLOR,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 14,
|
||||
minHeight: 14,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
count.toString(),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 8,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createProductSlider() {
|
||||
return Stack(
|
||||
children: [
|
||||
CarouselSlider(
|
||||
items: _imgProductSlider
|
||||
.map((item) => Container(
|
||||
child:
|
||||
buildCacheNetworkImage(width: 0, height: 0, url: item),
|
||||
))
|
||||
.toList(),
|
||||
options: CarouselOptions(
|
||||
aspectRatio: 1,
|
||||
viewportFraction: 1.0,
|
||||
autoPlay: false,
|
||||
enlargeCenterPage: false,
|
||||
onPageChanged: (index, reason) {
|
||||
setState(() {
|
||||
_currentImageSlider = index;
|
||||
});
|
||||
}),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 16,
|
||||
left: 16,
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE, borderRadius: BorderRadius.circular(4)),
|
||||
child: Text(
|
||||
(_currentImageSlider + 1).toString() +
|
||||
'/' +
|
||||
_imgProductSlider.length.toString(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 11)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createProductPriceTitleEtc() {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(widget.photo.toString() + ' photo(s)',
|
||||
style: GlobalStyle.detailProductPrice),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if (_isLove == true) {
|
||||
_isLove = false;
|
||||
Fluttertoast.showToast(
|
||||
msg: "La photo n'est plus taguée comme favorite",
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg: "La photo est taguée comme favorite",
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
_isLove = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Icon(Icons.favorite,
|
||||
color: _isLove == true ? ASSENT_COLOR : BLACK_GREY,
|
||||
size: 28),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
Text(widget.name,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
)),
|
||||
SizedBox(height: 12),
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(widget.date,
|
||||
style: TextStyle(fontSize: 13, color: BLACK_GREY)),
|
||||
VerticalDivider(
|
||||
width: 30,
|
||||
thickness: 1,
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
Icon(Icons.location_on, color: SOFT_GREY, size: 16),
|
||||
Text('Brooklyn',
|
||||
style: TextStyle(fontSize: 13, color: SOFT_GREY))
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createProductVariant() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Variant', style: GlobalStyle.sectionTitle),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('Size : ',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 14)),
|
||||
Text(_sizeList[_sizeIndex],
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
Wrap(
|
||||
children: List.generate(_sizeList.length, (index) {
|
||||
return radioSize(_sizeList[index], index);
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('Color : ',
|
||||
style: TextStyle(color: BLACK_GREY, fontSize: 14)),
|
||||
Text(_colorList[_colorIndex],
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
Wrap(
|
||||
children: List.generate(_colorList.length, (index) {
|
||||
return radioColor(_colorList[index], index);
|
||||
}),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget radioSize(String txt, int index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_sizeIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8, top: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _sizeIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: _sizeIndex == index ? SOFT_BLUE : Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: Text(txt,
|
||||
style: TextStyle(
|
||||
color: _sizeIndex == index ? Colors.white : CHARCOAL)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget radioColor(String txt, int index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_colorIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8, top: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _colorIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: _colorIndex == index ? SOFT_BLUE : Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: Text(txt,
|
||||
style: TextStyle(
|
||||
color: _colorIndex == index ? Colors.white : CHARCOAL)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createDeliveryEstimated() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => DeliveryEstimatedPage()));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Delivery', style: GlobalStyle.sectionTitle),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
RichText(
|
||||
text: new TextSpan(
|
||||
// Note: Styles for TextSpans must be explicitly defined.
|
||||
// Child text spans will inherit styles from parent
|
||||
style: new TextStyle(
|
||||
fontSize: 15.5,
|
||||
color: BLACK_GREY,
|
||||
),
|
||||
children: <TextSpan>[
|
||||
new TextSpan(
|
||||
text:
|
||||
'Calculate the estimated cost for shipping goods to '),
|
||||
new TextSpan(
|
||||
text: 'West New York, NJ',
|
||||
style:
|
||||
new TextStyle(fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(Icons.chevron_right, size: 36, color: CHARCOAL)
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createProductInformation() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Information', style: GlobalStyle.sectionTitle),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Weight', style: TextStyle(color: BLACK_GREY)),
|
||||
Text('300 Gram', style: TextStyle(color: BLACK_GREY))
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Condition', style: TextStyle(color: BLACK_GREY)),
|
||||
Text('Second', style: TextStyle(color: BLACK_GREY))
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Category', style: TextStyle(color: BLACK_GREY)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductCategoryPage(
|
||||
categoryId: 3, categoryName: 'Electronic')));
|
||||
},
|
||||
child: Text('Electronic', style: TextStyle(color: SOFT_BLUE)),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createProductDescription() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Description',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Text(
|
||||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nQuisque tortor tortor, ultrices id scelerisque a, elementum id elit. Maecenas feugiat tellus sed augue malesuada, id tempus ex sodales.'),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDescriptionPage(
|
||||
name: widget.name, image: widget.image)));
|
||||
},
|
||||
child: Center(
|
||||
child: Text('Read More', style: TextStyle(color: SOFT_BLUE)),
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createProductRelated(boxImageSize) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.only(bottom: 16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Text('Related Product', style: GlobalStyle.sectionTitle),
|
||||
),
|
||||
Container(
|
||||
height: boxImageSize *
|
||||
GlobalStyle.horizontalProductHeightMultiplication,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: relatedProductData.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
width: boxImageSize + 10,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: relatedProductData[index].name,
|
||||
image: relatedProductData[index].image,
|
||||
price: relatedProductData[index].price,
|
||||
rating: relatedProductData[index].rating,
|
||||
review: relatedProductData[index].review,
|
||||
sale: 36)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize + 10,
|
||||
height: boxImageSize + 10,
|
||||
url: relatedProductData[index].image)),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
relatedProductData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
'\$ ' +
|
||||
_globalFunction
|
||||
.removeDecimalZeroFormat(
|
||||
relatedProductData[index]
|
||||
.price),
|
||||
style: GlobalStyle.productPrice),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: relatedProductData[index]
|
||||
.rating,
|
||||
size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
relatedProductData[index]
|
||||
.review
|
||||
.toString() +
|
||||
')',
|
||||
style:
|
||||
GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createProductReview() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Review', style: GlobalStyle.sectionTitle),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductReviewPage()));
|
||||
},
|
||||
child: Text('View All',
|
||||
style: GlobalStyle.viewAll.copyWith(color: SOFT_BLUE),
|
||||
textAlign: TextAlign.end),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: widget.rating, size: 12),
|
||||
Text('(' + widget.review.toString() + ')',
|
||||
style: TextStyle(fontSize: 11, color: SOFT_GREY))
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: List.generate(reviewData.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(reviewData[index].date,
|
||||
style: TextStyle(fontSize: 13, color: SOFT_GREY)),
|
||||
SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(reviewData[index].name,
|
||||
style: TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: reviewData[index].rating, size: 12),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Text(reviewData[index].review)
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
})),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/review_model.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProductReviewPage extends StatefulWidget {
|
||||
@override
|
||||
_ProductReviewPageState createState() => _ProductReviewPageState();
|
||||
}
|
||||
|
||||
class _ProductReviewPageState extends State<ProductReviewPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
List<String> starList = ['All Review', '1', '2', '3', '4', '5'];
|
||||
int starIndex = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Product Review',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: List.generate(starList.length, (index) {
|
||||
return radioStar(starList[index], index);
|
||||
}),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Container(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
itemCount: reviewData.length,
|
||||
// Add one more item for progress indicator
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildReviewCard(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget radioStar(String txt, int index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
starIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: starIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: starIndex == index ? SOFT_BLUE : Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(Radius.circular(10))),
|
||||
child: index == 0
|
||||
? Text(txt,
|
||||
style: TextStyle(
|
||||
color: starIndex == index ? Colors.white : CHARCOAL))
|
||||
: Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
Text(txt,
|
||||
style: TextStyle(
|
||||
color:
|
||||
starIndex == index ? Colors.white : CHARCOAL)),
|
||||
SizedBox(width: 2),
|
||||
Icon(Icons.star,
|
||||
color: starIndex == index
|
||||
? Colors.white
|
||||
: Colors.yellow[700],
|
||||
size: 12),
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReviewCard(index) {
|
||||
return Card(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(reviewData[index].date,
|
||||
style: TextStyle(fontSize: 13, color: SOFT_GREY)),
|
||||
SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(reviewData[index].name,
|
||||
style:
|
||||
TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: reviewData[index].rating, size: 12)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Text(reviewData[index].review)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/coupon_model.dart';
|
||||
import 'package:mobdr/ui/home/coupon_detail.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class CouponPage extends StatefulWidget {
|
||||
@override
|
||||
_CouponPageState createState() => _CouponPageState();
|
||||
}
|
||||
|
||||
class _CouponPageState extends State<CouponPage> {
|
||||
TextEditingController _etSearch = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_etSearch.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Coupon',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: PreferredSize(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey[100]!,
|
||||
width: 1.0,
|
||||
)),
|
||||
),
|
||||
padding: EdgeInsets.fromLTRB(16, 0, 16, 12),
|
||||
height: kToolbarHeight,
|
||||
child: TextFormField(
|
||||
controller: _etSearch,
|
||||
textAlignVertical: TextAlignVertical.bottom,
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 16, color: Colors.grey[600]),
|
||||
onChanged: (textValue) {
|
||||
setState(() {});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.grey[100],
|
||||
filled: true,
|
||||
hintText: 'Enter promo code',
|
||||
prefixIcon: Icon(Icons.search, color: Colors.grey[500]),
|
||||
suffixIcon: (_etSearch.text == '')
|
||||
? null
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_etSearch = TextEditingController(text: '');
|
||||
});
|
||||
},
|
||||
child: Icon(Icons.close, color: Colors.grey[500])),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Colors.grey[200]!)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Colors.grey[200]!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
preferredSize: Size.fromHeight(kToolbarHeight),
|
||||
),
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: ListView.builder(
|
||||
itemCount: couponData.length,
|
||||
padding: EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
// Add one more item for progress indicator
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildCouponCard(couponData[index]);
|
||||
},
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildCouponCard(CouponModel couponData) {
|
||||
return Card(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
CouponDetailPage(couponData: couponData)));
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE, borderRadius: BorderRadius.circular(5)),
|
||||
child: Text('Limited Offer',
|
||||
style: GlobalStyle.couponLimitedOffer),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
Text(couponData.name, style: GlobalStyle.couponName),
|
||||
SizedBox(height: 12),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
GlobalStyle.iconTime,
|
||||
SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
Text('Expiring in ' + couponData.day + ' days',
|
||||
style: GlobalStyle.couponExpired),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Coupon applied',
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('Use Now',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: SOFT_BLUE,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/coupon_model.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class CouponDetailPage extends StatefulWidget {
|
||||
final bool fromList;
|
||||
final CouponModel couponData;
|
||||
|
||||
const CouponDetailPage(
|
||||
{Key? key, required this.couponData, this.fromList = false})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_CouponDetailPageState createState() => _CouponDetailPageState();
|
||||
}
|
||||
|
||||
class _CouponDetailPageState extends State<CouponDetailPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Coupon Detail',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.fromLTRB(24, 20, 24, 24),
|
||||
children: [
|
||||
_buildCouponCard(widget.couponData),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 24),
|
||||
child: Text('Terms and Conditions',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
child: Text(widget.couponData.term),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Coupon applied', toastLength: Toast.LENGTH_LONG);
|
||||
Navigator.pop(context);
|
||||
if (!widget.fromList) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Text(
|
||||
'Use',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildCouponCard(CouponModel couponData) {
|
||||
return Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(24),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(couponData.name,
|
||||
style: GlobalStyle.couponName.copyWith(fontSize: 18)),
|
||||
SizedBox(height: 12),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE,
|
||||
borderRadius: BorderRadius.circular(5)), //
|
||||
child: Text('Limited Offer',
|
||||
style: GlobalStyle.couponLimitedOffer),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
GlobalStyle.iconTime,
|
||||
SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
Text('Expiring in ' + couponData.day + ' days',
|
||||
style: GlobalStyle.couponExpired),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,344 +0,0 @@
|
|||
import 'dart:async';
|
||||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/flashsale_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/home/search.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FlashSalePage extends StatefulWidget {
|
||||
final int seconds;
|
||||
|
||||
const FlashSalePage({Key? key, this.seconds = 0}) : super(key: key);
|
||||
@override
|
||||
_FlashSalePageState createState() => _FlashSalePageState();
|
||||
}
|
||||
|
||||
class _FlashSalePageState extends State<FlashSalePage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
Timer? _flashsaleTimer;
|
||||
late int _flashsaleSecond;
|
||||
|
||||
void _startFlashsaleTimer() {
|
||||
const period = const Duration(seconds: 1);
|
||||
_flashsaleTimer = Timer.periodic(period, (timer) {
|
||||
setState(() {
|
||||
_flashsaleSecond--;
|
||||
});
|
||||
if (_flashsaleSecond == 0) {
|
||||
_cancelFlashsaleTimer();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _cancelFlashsaleTimer() {
|
||||
if (_flashsaleTimer != null) {
|
||||
_flashsaleTimer?.cancel();
|
||||
_flashsaleTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_flashsaleSecond = widget.seconds;
|
||||
if (_flashsaleSecond != 0) {
|
||||
_startFlashsaleTimer();
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_cancelFlashsaleTimer();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Flash Sale',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.search, color: BLACK_GREY),
|
||||
onPressed: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => SearchPage()));
|
||||
}),
|
||||
],
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: ListView(
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
children: [
|
||||
buildCacheNetworkImage(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.width / 2,
|
||||
url: GLOBAL_URL + '/flashsale/1.jpg'),
|
||||
Container(
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Flash sale end in :',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
color: CHARCOAL)),
|
||||
_buildFlashsaleTime(),
|
||||
],
|
||||
),
|
||||
),
|
||||
CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio:
|
||||
GlobalStyle.gridDelegateFlashsaleRatio,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return _buildFlashsaleCard(index);
|
||||
},
|
||||
childCount: flashsaleData.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildFlashsaleTime() {
|
||||
int hour = _flashsaleSecond ~/ 3600;
|
||||
int minute = _flashsaleSecond % 3600 ~/ 60;
|
||||
int second = _flashsaleSecond % 60;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(3, 4, 3, 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red, borderRadius: BorderRadius.circular(5)), //
|
||||
child: Text(_globalFunction.formatTime(hour),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Text(' : ',
|
||||
style: TextStyle(
|
||||
color: Colors.red, fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(3, 4, 3, 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red, borderRadius: BorderRadius.circular(5)), //
|
||||
child: Text(_globalFunction.formatTime(minute),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Text(' : ',
|
||||
style: TextStyle(
|
||||
color: Colors.red, fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(3, 4, 3, 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red, borderRadius: BorderRadius.circular(5)), //
|
||||
child: Text(_globalFunction.formatTime(second),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold)),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFlashsaleCard(index) {
|
||||
final double boxImageSize =
|
||||
((MediaQuery.of(context).size.width) - 24) / 2 - 12;
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: flashsaleData[index].name,
|
||||
image: flashsaleData[index].image,
|
||||
price: flashsaleData[index].price,
|
||||
rating: 4,
|
||||
review: 45,
|
||||
sale: flashsaleData[index].sale)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: flashsaleData[index].image)),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 10,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(6),
|
||||
bottomLeft: Radius.circular(6))),
|
||||
padding: EdgeInsets.fromLTRB(12, 6, 12, 6),
|
||||
child: Text(
|
||||
flashsaleData[index].discount.toString() + '%',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
flashsaleData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
(100 - flashsaleData[index].discount) *
|
||||
flashsaleData[index].price /
|
||||
100),
|
||||
style: GlobalStyle.productPrice),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
flashsaleData[index].price),
|
||||
style: GlobalStyle.productPriceDiscounted,
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
_createAvailableBar(flashsaleData[index].sale.toDouble(),
|
||||
flashsaleData[index].countItem),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
flashsaleData[index].countItem -
|
||||
flashsaleData[index].sale ==
|
||||
0
|
||||
? 'Sold out'
|
||||
: 'Available',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createAvailableBar(double sale, double total) {
|
||||
final double availableWidth =
|
||||
((MediaQuery.of(context).size.width) - 24) / 2 - 28;
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: sale / total * (availableWidth),
|
||||
height: 5,
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
bottomLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(sale == total ? 10 : 0),
|
||||
bottomRight: Radius.circular(sale == total ? 10 : 0)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: (total - sale) / total * (availableWidth),
|
||||
height: 5,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[300],
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(sale == 0 ? 10 : 0),
|
||||
bottomLeft: Radius.circular(sale == 0 ? 10 : 0),
|
||||
topRight: Radius.circular(10),
|
||||
bottomRight: Radius.circular(10)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/last_search_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/home/search.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LastSearchPage extends StatefulWidget {
|
||||
@override
|
||||
_LastSearchPageState createState() => _LastSearchPageState();
|
||||
}
|
||||
|
||||
class _LastSearchPageState extends State<LastSearchPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Last Search',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.search, color: BLACK_GREY),
|
||||
onPressed: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => SearchPage()));
|
||||
}),
|
||||
],
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio: GlobalStyle.gridDelegateRatio,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return _buildLastSearchCard(index);
|
||||
},
|
||||
childCount: lastSearchData.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildLastSearchCard(index) {
|
||||
final double boxImageSize =
|
||||
((MediaQuery.of(context).size.width) - 24) / 2 - 12;
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: lastSearchData[index].name,
|
||||
image: lastSearchData[index].image,
|
||||
price: lastSearchData[index].price,
|
||||
rating: lastSearchData[index].rating,
|
||||
review: lastSearchData[index].review,
|
||||
sale: lastSearchData[index].sale)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: lastSearchData[index].image)),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
lastSearchData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
lastSearchData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
Text(lastSearchData[index].sale.toString() + ' Sale',
|
||||
style: GlobalStyle.productSale)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.location_on, color: SOFT_GREY, size: 12),
|
||||
Text(' ' + lastSearchData[index].location,
|
||||
style: GlobalStyle.productLocation)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: lastSearchData[index].rating, size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
lastSearchData[index].review.toString() +
|
||||
')',
|
||||
style: GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,453 +0,0 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/category_all_product_model.dart';
|
||||
import 'package:mobdr/model/category_banner_model.dart';
|
||||
import 'package:mobdr/model/category_new_product_model.dart';
|
||||
import 'package:mobdr/model/category_trending_product_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/home/search.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProductCategoryPage extends StatefulWidget {
|
||||
final int categoryId;
|
||||
final String categoryName;
|
||||
|
||||
const ProductCategoryPage(
|
||||
{Key? key, this.categoryId = 0, required this.categoryName})
|
||||
: super(key: key);
|
||||
@override
|
||||
_ProductCategoryPageState createState() => _ProductCategoryPageState();
|
||||
}
|
||||
|
||||
class _ProductCategoryPageState extends State<ProductCategoryPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
int _currentImageSlider = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 3);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
widget.categoryName.replaceAll('\n', ' '),
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.search, color: BLACK_GREY),
|
||||
onPressed: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => SearchPage()));
|
||||
}),
|
||||
],
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: ListView(
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
children: [
|
||||
_createCategorySlider(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20, left: 16, right: 16),
|
||||
child:
|
||||
Text('Trending Product', style: GlobalStyle.sectionTitle),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
height: boxImageSize *
|
||||
GlobalStyle.horizontalProductHeightMultiplication,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: categoryTrendingProductData.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildTrendingProductCard(index, boxImageSize);
|
||||
},
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20, left: 16, right: 16),
|
||||
child: Text('New Product', style: GlobalStyle.sectionTitle),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
height: boxImageSize *
|
||||
GlobalStyle.horizontalProductHeightMultiplication,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: categoryNewProductData.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildNewProductCard(index, boxImageSize);
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20, left: 16, right: 16),
|
||||
child: Text('All Product', style: GlobalStyle.sectionTitle),
|
||||
),
|
||||
CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio: GlobalStyle.gridDelegateRatio,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return _buildAllProductCard(index);
|
||||
},
|
||||
childCount: categoryAllProductData.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createCategorySlider() {
|
||||
return Stack(
|
||||
children: [
|
||||
CarouselSlider(
|
||||
items: categoryBannerData
|
||||
.map((item) => Container(
|
||||
child: buildCacheNetworkImage(
|
||||
width: 0, height: 0, url: item.image),
|
||||
))
|
||||
.toList(),
|
||||
options: CarouselOptions(
|
||||
aspectRatio: 2,
|
||||
viewportFraction: 1.0,
|
||||
autoPlay: true,
|
||||
autoPlayInterval: Duration(seconds: 6),
|
||||
autoPlayAnimationDuration: Duration(milliseconds: 300),
|
||||
enlargeCenterPage: false,
|
||||
onPageChanged: (index, reason) {
|
||||
setState(() {
|
||||
_currentImageSlider = index;
|
||||
});
|
||||
}),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: categoryBannerData.map((item) {
|
||||
int index = categoryBannerData.indexOf(item);
|
||||
return Container(
|
||||
width: 8.0,
|
||||
height: 8.0,
|
||||
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: _currentImageSlider == index
|
||||
? SOFT_BLUE
|
||||
: Colors.grey[300],
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTrendingProductCard(index, boxImageSize) {
|
||||
return Container(
|
||||
width: boxImageSize + 10,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: categoryTrendingProductData[index].name,
|
||||
image: categoryTrendingProductData[index].image,
|
||||
price: categoryTrendingProductData[index].price,
|
||||
rating: categoryTrendingProductData[index].rating,
|
||||
review: categoryTrendingProductData[index].review,
|
||||
sale: 44)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize + 10,
|
||||
height: boxImageSize + 10,
|
||||
url: categoryTrendingProductData[index].image)),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
categoryTrendingProductData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
categoryTrendingProductData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: categoryTrendingProductData[index].rating,
|
||||
size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
categoryTrendingProductData[index]
|
||||
.review
|
||||
.toString() +
|
||||
')',
|
||||
style: GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNewProductCard(index, boxImageSize) {
|
||||
return Container(
|
||||
width: boxImageSize + 10,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: categoryNewProductData[index].name,
|
||||
image: categoryNewProductData[index].image,
|
||||
price: categoryNewProductData[index].price,
|
||||
rating: categoryNewProductData[index].rating,
|
||||
review: categoryNewProductData[index].review,
|
||||
sale: 36)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize + 10,
|
||||
height: boxImageSize + 10,
|
||||
url: categoryNewProductData[index].image)),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
categoryNewProductData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
categoryNewProductData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: categoryNewProductData[index].rating,
|
||||
size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
categoryNewProductData[index]
|
||||
.review
|
||||
.toString() +
|
||||
')',
|
||||
style: GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAllProductCard(index) {
|
||||
final double boxImageSize =
|
||||
((MediaQuery.of(context).size.width) - 24) / 2 - 12;
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: categoryAllProductData[index].name,
|
||||
image: categoryAllProductData[index].image,
|
||||
price: categoryAllProductData[index].price,
|
||||
rating: categoryAllProductData[index].rating,
|
||||
review: categoryAllProductData[index].review,
|
||||
sale: categoryAllProductData[index].sale)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: categoryAllProductData[index].image)),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
categoryAllProductData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
categoryAllProductData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
Text(
|
||||
categoryAllProductData[index].sale.toString() +
|
||||
' Sale',
|
||||
style: GlobalStyle.productSale)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.location_on, color: SOFT_GREY, size: 12),
|
||||
Text(' ' + categoryAllProductData[index].location,
|
||||
style: GlobalStyle.productLocation)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: categoryAllProductData[index].rating,
|
||||
size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
categoryAllProductData[index]
|
||||
.review
|
||||
.toString() +
|
||||
')',
|
||||
style: GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,252 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/last_seen_model.dart';
|
||||
import 'package:mobdr/model/search_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/home/search_product.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SearchPage extends StatefulWidget {
|
||||
@override
|
||||
_SearchPageState createState() => _SearchPageState();
|
||||
}
|
||||
|
||||
class _SearchPageState extends State<SearchPage> {
|
||||
TextEditingController _etSearch = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_etSearch.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 7);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0.0,
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
// create search text field in the app bar
|
||||
title: Container(
|
||||
margin: EdgeInsets.only(right: 16),
|
||||
height: kToolbarHeight - 20,
|
||||
child: TextField(
|
||||
controller: _etSearch,
|
||||
autofocus: true,
|
||||
textInputAction: TextInputAction.search,
|
||||
onChanged: (textValue) {
|
||||
setState(() {});
|
||||
},
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey[600]),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon:
|
||||
Icon(Icons.search, color: Colors.grey[500], size: 18),
|
||||
suffixIcon: (_etSearch.text == '')
|
||||
? null
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_etSearch = TextEditingController(text: '');
|
||||
});
|
||||
},
|
||||
child: Icon(Icons.close,
|
||||
color: Colors.grey[500], size: 18)),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5),
|
||||
),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[200],
|
||||
hintText: 'Search product',
|
||||
),
|
||||
),
|
||||
)),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
FocusScope.of(context).unfocus();
|
||||
return Future.value(true);
|
||||
},
|
||||
// if search field is empty, show history search
|
||||
// if search field not empty, show search text
|
||||
child: _etSearch.text == ''
|
||||
? _showHistorySearch(boxImageSize)
|
||||
: _showSearchText(),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _showHistorySearch(boxImageSize) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
Text('Last Seen Product',
|
||||
style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
height: boxImageSize,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(right: 12),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: lastSeenData.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildLastSeenCard(index, boxImageSize);
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 32),
|
||||
child: Text('Last Search',
|
||||
style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: searchData.length,
|
||||
// Add one more item for progress indicator
|
||||
padding: EdgeInsets.symmetric(vertical: 0),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildLastSearchList(index);
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _showSearchText() {
|
||||
return ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
int idx = searchData
|
||||
.indexWhere((data) => data.words == _etSearch.text);
|
||||
if (idx == -1) {
|
||||
if (searchData.length == 5) {
|
||||
searchData.removeLast();
|
||||
}
|
||||
searchData.insert(
|
||||
0, SearchModel(id: 1, words: _etSearch.text));
|
||||
} else {
|
||||
searchData.removeAt(idx);
|
||||
searchData.insert(
|
||||
0, SearchModel(id: 1, words: _etSearch.text));
|
||||
}
|
||||
});
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
SearchProductPage(words: _etSearch.text)));
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.access_time, color: SOFT_GREY, size: 16),
|
||||
SizedBox(width: 12),
|
||||
Text(_etSearch.text, style: TextStyle(color: CHARCOAL)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLastSeenCard(index, boxImageSize) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: index == 0 ? 0 : 12),
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: lastSeenData[index].name,
|
||||
image: lastSeenData[index].image,
|
||||
price: lastSeenData[index].price,
|
||||
rating: lastSeenData[index].rating,
|
||||
review: lastSeenData[index].review,
|
||||
sale: lastSeenData[index].sale)));
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: lastSeenData[index].image)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLastSearchList(index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
SearchProductPage(words: searchData[index].words)));
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.access_time, color: SOFT_GREY, size: 16),
|
||||
SizedBox(width: 12),
|
||||
Flexible(
|
||||
child: Text(searchData[index].words,
|
||||
style: TextStyle(color: CHARCOAL),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
searchData.removeAt(index);
|
||||
});
|
||||
},
|
||||
child: Icon(Icons.close, color: BLACK_GREY, size: 18)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,458 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/search_product_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/home/search.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SearchProductPage extends StatefulWidget {
|
||||
final String words;
|
||||
|
||||
const SearchProductPage({Key? key, this.words = ''}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SearchProductPageState createState() => _SearchProductPageState();
|
||||
}
|
||||
|
||||
class _SearchProductPageState extends State<SearchProductPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
TextEditingController _etSearch = TextEditingController();
|
||||
|
||||
// create sort filter data
|
||||
late List<String> _sortList;
|
||||
int _sortIndex = 0;
|
||||
|
||||
// create other filter 1 data
|
||||
late List<String> _otherFilterOneList;
|
||||
int _otherFilterOneIndex = 0;
|
||||
|
||||
// create other filter 2 data
|
||||
late List<String> _otherFilterTwoList;
|
||||
int _otherFilterTwoIndex = 0;
|
||||
|
||||
// create other filter 3 data
|
||||
late List<String> _otherFilterThreeList;
|
||||
int _otherFilterThreeIndex = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_etSearch.text = widget.words;
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_initForLang();
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _initForLang() {
|
||||
setState(() {
|
||||
_sortList = [
|
||||
'Relevant Product',
|
||||
'Review',
|
||||
'Newest Product',
|
||||
'Highest Price',
|
||||
'Lowest Price'
|
||||
];
|
||||
_otherFilterOneList = ['Filter 1', 'Filter 2', 'Filter 3', 'Filter 4'];
|
||||
_otherFilterTwoList = [
|
||||
'Filter 1',
|
||||
'Filter 2',
|
||||
'Filter 3',
|
||||
'Filter 4',
|
||||
'Filter 5',
|
||||
'Filter 6',
|
||||
'Filter 7'
|
||||
];
|
||||
_otherFilterThreeList = [
|
||||
'Filter 1',
|
||||
'Filter 2',
|
||||
'Filter 3',
|
||||
'Filter 4',
|
||||
'Filter 5',
|
||||
'Filter 6',
|
||||
'Filter 7',
|
||||
'Filter 8',
|
||||
'Filter 9',
|
||||
'Filter 10'
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_etSearch.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0.0,
|
||||
iconTheme: IconThemeData(
|
||||
color: Colors.black, //change your color here
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
elevation: 0,
|
||||
title: Container(
|
||||
margin: EdgeInsets.only(right: 16),
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => Colors.grey[100]!,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => SearchPage()));
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 8),
|
||||
Icon(Icons.search, color: Colors.grey[500], size: 18),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
widget.words,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.normal),
|
||||
)
|
||||
],
|
||||
)),
|
||||
),
|
||||
actions: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return _showFilterPopup();
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 16),
|
||||
child: Icon(Icons.filter_list, color: BLACK_GREY))),
|
||||
],
|
||||
),
|
||||
body: WillPopScope(
|
||||
onWillPop: () {
|
||||
Navigator.pop(context);
|
||||
return Future.value(true);
|
||||
},
|
||||
child: CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio: GlobalStyle.gridDelegateRatio,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return _buildSearchProductCard(index);
|
||||
},
|
||||
childCount: searchProductData.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _showFilterPopup() {
|
||||
// must use StateSetter to update data between main screen and popup.
|
||||
// if use default setState, the data will not update
|
||||
return StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter mystate) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 12, bottom: 12),
|
||||
width: 40,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[500],
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
child: Text('Filter',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: <Widget>[
|
||||
Text('Sort', style: GlobalStyle.filterTitle),
|
||||
Wrap(
|
||||
children: List.generate(_sortList.length, (index) {
|
||||
return _radioSort(_sortList[index], index, mystate);
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
Text('Other Filter 1', style: GlobalStyle.filterTitle),
|
||||
Wrap(
|
||||
children: List.generate(_otherFilterOneList.length, (index) {
|
||||
return _otherFilterOneSort(
|
||||
_otherFilterOneList[index], index, mystate);
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
Text('Other Filter 2', style: GlobalStyle.filterTitle),
|
||||
Wrap(
|
||||
children: List.generate(_otherFilterTwoList.length, (index) {
|
||||
return _otherFilterTwoSort(
|
||||
_otherFilterTwoList[index], index, mystate);
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
Text('Other Filter 3', style: GlobalStyle.filterTitle),
|
||||
Wrap(
|
||||
children:
|
||||
List.generate(_otherFilterThreeList.length, (index) {
|
||||
return _otherFilterThreeSort(
|
||||
_otherFilterThreeList[index], index, mystate);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _radioSort(String txt, int index, mystate) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
mystate(() {
|
||||
_sortIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8, top: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _sortIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: _sortIndex == index ? SOFT_BLUE : Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: Text(txt,
|
||||
style: TextStyle(
|
||||
color: _sortIndex == index ? Colors.white : CHARCOAL)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _otherFilterOneSort(String txt, int index, mystate) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
mystate(() {
|
||||
_otherFilterOneIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8, top: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _otherFilterOneIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: _otherFilterOneIndex == index
|
||||
? SOFT_BLUE
|
||||
: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: Text(txt,
|
||||
style: TextStyle(
|
||||
color:
|
||||
_otherFilterOneIndex == index ? Colors.white : CHARCOAL)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _otherFilterTwoSort(String txt, int index, mystate) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
mystate(() {
|
||||
_otherFilterTwoIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8, top: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _otherFilterTwoIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: _otherFilterTwoIndex == index
|
||||
? SOFT_BLUE
|
||||
: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: Text(txt,
|
||||
style: TextStyle(
|
||||
color:
|
||||
_otherFilterTwoIndex == index ? Colors.white : CHARCOAL)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _otherFilterThreeSort(String txt, int index, mystate) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
mystate(() {
|
||||
_otherFilterThreeIndex = index;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(right: 8, top: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _otherFilterThreeIndex == index ? SOFT_BLUE : Colors.white,
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: _otherFilterThreeIndex == index
|
||||
? SOFT_BLUE
|
||||
: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(Radius.circular(10))),
|
||||
child: Text(txt,
|
||||
style: TextStyle(
|
||||
color:
|
||||
_otherFilterThreeIndex == index ? Colors.white : CHARCOAL)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSearchProductCard(index) {
|
||||
final double boxImageSize =
|
||||
((MediaQuery.of(context).size.width) - 24) / 2 - 12;
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: searchProductData[index].name,
|
||||
image: searchProductData[index].image,
|
||||
price: searchProductData[index].price,
|
||||
rating: searchProductData[index].rating,
|
||||
review: searchProductData[index].review,
|
||||
sale: searchProductData[index].sale)));
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: searchProductData[index].image)),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
searchProductData[index].name,
|
||||
style: GlobalStyle.productName,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
searchProductData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
Text(
|
||||
searchProductData[index].sale.toString() +
|
||||
' Sale',
|
||||
style: GlobalStyle.productSale)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.location_on, color: SOFT_GREY, size: 12),
|
||||
Text(' ' + searchProductData[index].location,
|
||||
style: GlobalStyle.productLocation)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
_reusableWidget.createRatingBar(
|
||||
rating: searchProductData[index].rating,
|
||||
size: 12),
|
||||
Text(
|
||||
'(' +
|
||||
searchProductData[index].review.toString() +
|
||||
')',
|
||||
style: GlobalStyle.productTotalReview)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,6 @@ import 'package:mobdr/config/global_style.dart';
|
|||
import 'package:mobdr/events.dart';
|
||||
import 'package:mobdr/model/visit_model.dart';
|
||||
import 'package:mobdr/ui/visit/visit_photo_typology.dart';
|
||||
import 'package:mobdr/ui/general/chat_us.dart';
|
||||
import 'package:mobdr/ui/general/notification.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
|
|
|
|||
|
|
@ -1,835 +0,0 @@
|
|||
/*
|
||||
This function is used to add beautiful shimmer loading to the pages
|
||||
(https://pub.dev/packages/shimmer)
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
double _containerHeight = 20;
|
||||
double _spaceHeight = 10;
|
||||
Color _shimmerColor = Colors.grey[200]!;
|
||||
Color _shimmerColorDark = Colors.grey[500]!;
|
||||
|
||||
class ShimmerLoading{
|
||||
Widget buildShimmerContent(){
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
itemCount: 8,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20, 20, 20, 0),
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
child: Container(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 12.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 110,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.0),
|
||||
bottomRight: Radius.circular(10.0)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Container(
|
||||
width: 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
padding: EdgeInsets.only(left: 12.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.0),
|
||||
bottomRight: Radius.circular(10.0)),
|
||||
color: Colors.white,
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 12.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.0),
|
||||
bottomRight: Radius.circular(10.0)),
|
||||
color: Colors.white,
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 12.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
width: 100,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.0),
|
||||
bottomRight: Radius.circular(10.0)),
|
||||
color: Colors.white,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
period: Duration(milliseconds: 1000),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
color: _shimmerColor,
|
||||
height: 1),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerImageHorizontal(boxImageSize) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
itemCount: 8,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: index == 0 ? 0 : 12),
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
child: Container(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
period: Duration(milliseconds: 1000),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerHorizontalProduct(boxImageSize) {
|
||||
return ListView.builder(
|
||||
itemCount: 8,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: index == 0 ? 0 : 8),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
width: 50,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
for(int i=1;i<=5;i++) Icon(Icons.star, color: _shimmerColor, size: 12),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerProductDiscount(boxImageSize) {
|
||||
return ListView.builder(
|
||||
itemCount: 8,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: index == 0 ? 0 : 8),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
children: [
|
||||
Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top:10,
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColorDark,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: _shimmerColorDark,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(6), bottomLeft: Radius.circular(6))
|
||||
),
|
||||
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||
child: Container(
|
||||
width: 20,
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
width: 50,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
width: 50,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerProductDiscount2(boxImageSize) {
|
||||
return GridView.count(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
primary: false,
|
||||
childAspectRatio: 4/6.7,
|
||||
shrinkWrap: true,
|
||||
crossAxisSpacing: 8,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisCount: 2,
|
||||
children: List.generate(8, (index) {
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
children: [
|
||||
Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top:10,
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColorDark,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: _shimmerColorDark,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(6), bottomLeft: Radius.circular(6))
|
||||
),
|
||||
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||
child: Container(
|
||||
width: 20,
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerBannerSlider(bannerWidth, bannerHeight) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
child: Container(
|
||||
child: Container(
|
||||
width: bannerWidth,
|
||||
height: bannerHeight,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
period: Duration(milliseconds: 1000),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children : List.generate(5, (index) {
|
||||
return Container(
|
||||
width: 8.0,
|
||||
height: 8.0,
|
||||
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
);
|
||||
})
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerBanner(bannerWidth, bannerHeight) {
|
||||
return Container(
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
child: Container(
|
||||
child: Container(
|
||||
width: bannerWidth,
|
||||
height: bannerHeight,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
period: Duration(milliseconds: 1000),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerProduct(boxImageSize) {
|
||||
return GridView.count(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
primary: false,
|
||||
childAspectRatio: 5/8,
|
||||
shrinkWrap: true,
|
||||
crossAxisSpacing: 8,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisCount: 2,
|
||||
children: List.generate(8, (index) {
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)),
|
||||
child: Container(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
width: 50,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
for(int i=1;i<=5;i++) Icon(Icons.star, color: _shimmerColor, size: 12),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerTrending(boxImageSize) {
|
||||
return GridView.count(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
primary: false,
|
||||
childAspectRatio: 4/1.6,
|
||||
shrinkWrap: true,
|
||||
crossAxisSpacing: 2,
|
||||
mainAxisSpacing: 2,
|
||||
crossAxisCount: 2,
|
||||
children: List.generate(4, (index) {
|
||||
return Container(
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
|
||||
child: Container(
|
||||
width: (boxImageSize)*(1.6/4)-12-1,
|
||||
height: (boxImageSize)*(1.6/4)-12-1,
|
||||
color: _shimmerColor,
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerCategory() {
|
||||
return GridView.count(
|
||||
padding: EdgeInsets.fromLTRB(16, 16, 16, 0),
|
||||
primary: false,
|
||||
childAspectRatio: 1.1,
|
||||
shrinkWrap: true,
|
||||
crossAxisSpacing: 0,
|
||||
mainAxisSpacing: 0,
|
||||
crossAxisCount: 4,
|
||||
children: List.generate(8, (index) {
|
||||
return Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
width: 60,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
]),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerCategoryHorizontal() {
|
||||
return GridView.count(
|
||||
padding: EdgeInsets.fromLTRB(16, 16, 16, 0),
|
||||
primary: false,
|
||||
childAspectRatio: 1.07,
|
||||
shrinkWrap: true,
|
||||
crossAxisSpacing: 0,
|
||||
mainAxisSpacing: 0,
|
||||
crossAxisCount: 2,
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: List.generate(16, (index) {
|
||||
return Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: _shimmerColor,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
width: 60,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
]),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildShimmerList() {
|
||||
return Container(
|
||||
child: Shimmer.fromColors(
|
||||
highlightColor: Colors.white,
|
||||
baseColor: _shimmerColor,
|
||||
period: Duration(milliseconds: 1000),
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
),
|
||||
SizedBox(
|
||||
height: _spaceHeight,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
color: _shimmerColor,
|
||||
),
|
||||
height: _containerHeight,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/address_model.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChangeAddressPage extends StatefulWidget {
|
||||
@override
|
||||
_ChangeAddressPageState createState() => _ChangeAddressPageState();
|
||||
}
|
||||
|
||||
class _ChangeAddressPageState extends State<ChangeAddressPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Change Address',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: addressData.length,
|
||||
// Add one more item for progress indicator
|
||||
padding: EdgeInsets.symmetric(vertical: 0),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _buildAddressCard(index);
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildAddressCard(int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(12, 6, 12, 0),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
elevation: 2,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
addressData[index].defaultAddress == true
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(addressData[index].title,
|
||||
style: GlobalStyle.addressTitle),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE,
|
||||
borderRadius: BorderRadius.circular(2)),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Default',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 13)),
|
||||
SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
Icon(Icons.done, color: Colors.white, size: 11)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Text(addressData[index].title,
|
||||
style: GlobalStyle.addressTitle),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
child: Text(addressData[index].recipientName,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(addressData[index].phoneNumber,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(addressData[index].addressLine1,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
addressData[index].addressLine2 +
|
||||
' ' +
|
||||
addressData[index].postalCode,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(addressData[index].state,
|
||||
style: GlobalStyle.addressContent),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
addressData[index].defaultAddress == false
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('Use this',
|
||||
style: GlobalStyle.addressAction),
|
||||
)
|
||||
: Wrap(),
|
||||
index != 0
|
||||
? SizedBox(
|
||||
width: 12,
|
||||
)
|
||||
: Wrap(),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,662 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/shopping_cart_model.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/shopping_cart/change_address.dart';
|
||||
import 'package:mobdr/ui/shopping_cart/payment.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DeliveryPage extends StatefulWidget {
|
||||
final List<ShoppingCartModel> shoppingCartData;
|
||||
|
||||
const DeliveryPage({Key? key, required this.shoppingCartData})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_DeliveryPageState createState() => _DeliveryPageState();
|
||||
}
|
||||
|
||||
class _DeliveryPageState extends State<DeliveryPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
double _subTotal = 0;
|
||||
String _delivery = '';
|
||||
double _deliveryPrice = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
shoppingCartData = widget.shoppingCartData;
|
||||
countSubTotal();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void countSubTotal() {
|
||||
_subTotal = 0;
|
||||
for (int i = 0; i < shoppingCartData.length; i++) {
|
||||
_subTotal += shoppingCartData[i].price * shoppingCartData[i].qty;
|
||||
}
|
||||
_subTotal += _deliveryPrice;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 6);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Delivery',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
_createDeliveryInformation(),
|
||||
_createOrderListInformation(boxImageSize),
|
||||
_createChooseDeliveryInformation(),
|
||||
_createSubTotalInformation()
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createDeliveryInformation() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text('Home Address',
|
||||
style:
|
||||
TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE, borderRadius: BorderRadius.circular(2)),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Default',
|
||||
style: TextStyle(color: Colors.white, fontSize: 13)),
|
||||
SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
Icon(Icons.done, color: Colors.white, size: 11)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Container(
|
||||
child: Text('Robert Steven',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('0811888999',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('6019 Madison St',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('West New York, NJ 07093',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text('USA', style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => ChangeAddressPage()));
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.topRight,
|
||||
child: Text('Change Address',
|
||||
style: TextStyle(color: PRIMARY_COLOR, fontSize: 14)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createOrderListInformation(boxImageSize) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Order List',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
Column(
|
||||
children: List.generate(shoppingCartData.length, (index) {
|
||||
int quantity = shoppingCartData[index].qty;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
//Navigator.push(context, MaterialPageRoute(builder: (context) => ProductDetailPage(name: shoppingCartData[index].name, image: shoppingCartData[index].image, price: shoppingCartData[index].price, rating: 4, review: 23, sale: 36)));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: shoppingCartData[index].image)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
shoppingCartData[index].name,
|
||||
style: GlobalStyle.productName.copyWith(
|
||||
fontSize: 14, fontWeight: FontWeight.bold),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
quantity.toString() + ' item (150 gr)',
|
||||
style: GlobalStyle.shoppingCartOtherProduct
|
||||
.copyWith(color: Colors.grey[400]))),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
'\$' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
quantity *
|
||||
shoppingCartData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createChooseDeliveryInformation() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Delivery',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return _showDeliveryPopup();
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(bottom: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(width: 1, color: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: _delivery == ''
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.local_shipping, color: SOFT_BLUE),
|
||||
SizedBox(width: 12),
|
||||
Text('Choose Delivery',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
Icon(Icons.chevron_right, size: 20, color: SOFT_GREY),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(_delivery,
|
||||
style: TextStyle(
|
||||
color: CHARCOAL,
|
||||
fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Text('\$' + _deliveryPrice.toString(),
|
||||
style: GlobalStyle.deliveryTotalPrice),
|
||||
],
|
||||
),
|
||||
Icon(Icons.chevron_right, size: 20, color: SOFT_GREY),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _showDeliveryPopup() {
|
||||
return StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter mystate) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 12, bottom: 12),
|
||||
width: 40,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[500],
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
child: Text('Choose Courier', style: GlobalStyle.chooseCourier),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: <Widget>[
|
||||
Text('DHL', style: GlobalStyle.courierTitle),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'DHL Regular';
|
||||
_deliveryPrice = 13;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$13', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'DHL Express';
|
||||
_deliveryPrice = 22;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$22', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('FedEx', style: GlobalStyle.courierTitle),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'FedEx Regular';
|
||||
_deliveryPrice = 9;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'FedEx Express';
|
||||
_deliveryPrice = 17;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 1', style: GlobalStyle.courierTitle),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 1 Regular';
|
||||
_deliveryPrice = 9;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 1 Express';
|
||||
_deliveryPrice = 17;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 2', style: GlobalStyle.courierTitle),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 2 Regular';
|
||||
_deliveryPrice = 9;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 2 Express';
|
||||
_deliveryPrice = 17;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 3', style: GlobalStyle.courierTitle),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 3 Regular';
|
||||
_deliveryPrice = 9;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 3 Express';
|
||||
_deliveryPrice = 17;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Text('Other 4', style: GlobalStyle.courierTitle),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 4 Regular';
|
||||
_deliveryPrice = 9;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Regular', style: GlobalStyle.courierType),
|
||||
Text('\$9', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_delivery = 'Other 4 Express';
|
||||
_deliveryPrice = 17;
|
||||
});
|
||||
countSubTotal();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Express', style: GlobalStyle.courierType),
|
||||
Text('\$17', style: GlobalStyle.deliveryPrice),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _createSubTotalInformation() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Sub Total ',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 5),
|
||||
Text('\$' + _globalFunction.removeDecimalZeroFormat(_subTotal),
|
||||
style: GlobalStyle.shoppingCartTotalPrice),
|
||||
],
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => PaymentPage()));
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Text(
|
||||
'Pay',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,371 +0,0 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/ui/home.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PaymentPage extends StatefulWidget {
|
||||
final bool fromList;
|
||||
|
||||
const PaymentPage({Key? key, this.fromList = false}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PaymentPageState createState() => _PaymentPageState();
|
||||
}
|
||||
|
||||
class _PaymentPageState extends State<PaymentPage> {
|
||||
// initialize reusable widget
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Payment',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Summary',
|
||||
style:
|
||||
TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
child: Text('Total Payment',
|
||||
style: TextStyle(color: CHARCOAL, fontSize: 14)),
|
||||
),
|
||||
Container(
|
||||
child:
|
||||
Text('\$74', style: GlobalStyle.paymentTotalPrice),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Payment Method',
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return _createChoosePayment();
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Text('Change',
|
||||
style:
|
||||
TextStyle(color: PRIMARY_COLOR, fontSize: 14)),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child:
|
||||
Image.asset('assets/images/visa.png', height: 10),
|
||||
),
|
||||
Text('Visa card ending in 4392',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: CHARCOAL))
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(32),
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
showLoading(
|
||||
'Your payment is success, we will prepare your order as soon as possible');
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: Text(
|
||||
'Pay',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createChoosePayment() {
|
||||
return StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter mystate) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 12, bottom: 12),
|
||||
width: 40,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[500],
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
child: Text('Payment Method',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.all(16),
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child:
|
||||
Image.asset('assets/images/visa.png', height: 10),
|
||||
),
|
||||
Text('Visa card ending in 4392')
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: Image.asset('assets/images/mastercard.png',
|
||||
height: 20),
|
||||
),
|
||||
Text('MasterCard ending in 5309')
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xffcccccc),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child:
|
||||
Image.asset('assets/images/visa.png', height: 10),
|
||||
),
|
||||
Text('Visa card ending in 2285')
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void showLoading(String textMessage) {
|
||||
_progressDialog(context);
|
||||
Timer(Duration(seconds: 2), () {
|
||||
Navigator.pop(context);
|
||||
_buildShowDialog(context, textMessage);
|
||||
});
|
||||
}
|
||||
|
||||
Future _progressDialog(BuildContext context) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
return Future.value(false);
|
||||
},
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Future _buildShowDialog(BuildContext context, String textMessage) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
return Future.value(false);
|
||||
},
|
||||
child: Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0)), //this right here
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(20),
|
||||
margin: EdgeInsets.fromLTRB(40, 20, 40, 20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
textMessage,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14, color: BLACK_GREY),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor:
|
||||
MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
//Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route<dynamic> route) => false);
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
if (!widget.fromList) {
|
||||
Navigator.pop(context);
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => HomePage()));
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 12.0, horizontal: 16),
|
||||
child: Text(
|
||||
'OK',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,369 +0,0 @@
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/model/shopping_cart_model.dart';
|
||||
import 'package:mobdr/ui/general/product_detail/product_detail.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
import 'package:mobdr/ui/shopping_cart/delivery.dart';
|
||||
import 'package:mobdr/ui/reusable/cache_image_network.dart';
|
||||
import 'package:mobdr/ui/reusable/global_function.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class TabShoppingCartPage extends StatefulWidget {
|
||||
@override
|
||||
_TabShoppingCartPageState createState() => _TabShoppingCartPageState();
|
||||
}
|
||||
|
||||
class _TabShoppingCartPageState extends State<TabShoppingCartPage> {
|
||||
// initialize global function and reusable widget
|
||||
final _globalFunction = GlobalFunction();
|
||||
final _reusableWidget = ReusableWidget();
|
||||
|
||||
double _totalPrice = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_countTotalPrice();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _countTotalPrice() {
|
||||
_totalPrice = 0;
|
||||
for (int i = 0; i < shoppingCartData.length; i++) {
|
||||
_totalPrice += shoppingCartData[i].price * shoppingCartData[i].qty;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double boxImageSize = (MediaQuery.of(context).size.width / 5);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: GlobalStyle.appBarIconThemeColor,
|
||||
),
|
||||
elevation: GlobalStyle.appBarElevation,
|
||||
title: Text(
|
||||
'Shopping Cart',
|
||||
style: GlobalStyle.appBarTitle,
|
||||
),
|
||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||
bottom: _reusableWidget.bottomAppBar(),
|
||||
),
|
||||
body: ListView(
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: List.generate(shoppingCartData.length, (index) {
|
||||
return _buildItem(index, boxImageSize);
|
||||
}),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12),
|
||||
padding: EdgeInsets.all(16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
_createUseCoupon(),
|
||||
_createTotalPrice(),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _createUseCoupon() {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
//Navigator.push(context, MaterialPageRoute(builder: (context) => CouponPage()));
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
margin: EdgeInsets.only(bottom: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(width: 1, color: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10) // <--- border radius here
|
||||
)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.local_offer, color: SOFT_BLUE),
|
||||
SizedBox(width: 12),
|
||||
Text('Use coupons',
|
||||
style: TextStyle(
|
||||
color: CHARCOAL, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
Icon(Icons.chevron_right, size: 20, color: SOFT_GREY),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createTotalPrice() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Total',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 5),
|
||||
Text('\$' + _globalFunction.removeDecimalZeroFormat(_totalPrice),
|
||||
style: GlobalStyle.shoppingCartTotalPrice),
|
||||
],
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => PRIMARY_COLOR,
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4.0),
|
||||
)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
DeliveryPage(shoppingCartData: shoppingCartData)));
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Text(
|
||||
'Next',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Column _buildItem(index, boxImageSize) {
|
||||
int quantity = shoppingCartData[index].qty;
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
child: Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: shoppingCartData[index].name,
|
||||
image: shoppingCartData[index].image,
|
||||
price: shoppingCartData[index].price,
|
||||
rating: 4,
|
||||
review: 23,
|
||||
sale: 36)));
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(4)),
|
||||
child: buildCacheNetworkImage(
|
||||
width: boxImageSize,
|
||||
height: boxImageSize,
|
||||
url: shoppingCartData[index].image)),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ProductDetailPage(
|
||||
name: shoppingCartData[index].name,
|
||||
image: shoppingCartData[index].image,
|
||||
price: shoppingCartData[index].price,
|
||||
rating: 4,
|
||||
review: 23,
|
||||
sale: 36)));
|
||||
},
|
||||
child: Text(
|
||||
shoppingCartData[index].name,
|
||||
style: GlobalStyle.productName.copyWith(fontSize: 14),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
'\$ ' +
|
||||
_globalFunction.removeDecimalZeroFormat(
|
||||
shoppingCartData[index].price),
|
||||
style: GlobalStyle.productPrice),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
showPopupDelete(index, boxImageSize);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
width: 1, color: Colors.grey[300]!)),
|
||||
child: Icon(Icons.delete,
|
||||
color: BLACK_GREY, size: 20),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
quantity--;
|
||||
shoppingCartData[index].setQty(quantity);
|
||||
_countTotalPrice();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
|
||||
height: 28,
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE,
|
||||
borderRadius: BorderRadius.circular(8)),
|
||||
child: Icon(Icons.remove,
|
||||
color: Colors.white, size: 20),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Container(
|
||||
child: Text(quantity.toString(),
|
||||
style: TextStyle()),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
quantity++;
|
||||
shoppingCartData[index].setQty(quantity);
|
||||
_countTotalPrice();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
|
||||
height: 28,
|
||||
decoration: BoxDecoration(
|
||||
color: SOFT_BLUE,
|
||||
borderRadius: BorderRadius.circular(8)),
|
||||
child: Icon(Icons.add,
|
||||
color: Colors.white, size: 20),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
(index == shoppingCartData.length - 1)
|
||||
? Wrap()
|
||||
: Divider(
|
||||
height: 32,
|
||||
color: Colors.grey[400],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
void showPopupDelete(index, boxImageSize) {
|
||||
// set up the buttons
|
||||
Widget cancelButton = TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('No', style: TextStyle(color: SOFT_BLUE)));
|
||||
Widget continueButton = TextButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
shoppingCartData.removeAt(index);
|
||||
});
|
||||
_countTotalPrice();
|
||||
Navigator.pop(context);
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Item has been deleted from your Shopping Cart',
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
},
|
||||
child: Text('Yes', style: TextStyle(color: SOFT_BLUE)));
|
||||
|
||||
// set up the AlertDialog
|
||||
AlertDialog alert = AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
title: Text(
|
||||
'Delete from Shopping Cart',
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
content: Text(
|
||||
'Are you sure to delete this item from your Shopping Cart ?',
|
||||
style: TextStyle(fontSize: 13, color: BLACK_GREY)),
|
||||
actions: [
|
||||
cancelButton,
|
||||
continueButton,
|
||||
],
|
||||
);
|
||||
|
||||
// show the dialog
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,6 @@ import 'package:fluttertoast/fluttertoast.dart';
|
|||
import 'package:mobdr/config/constant.dart';
|
||||
import 'package:mobdr/config/global_style.dart';
|
||||
import 'package:mobdr/main.dart';
|
||||
import 'package:mobdr/ui/general/chat_us.dart';
|
||||
import 'package:mobdr/ui/visit/visit_photo_tag.dart';
|
||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||
|
||||
|
|
@ -154,10 +153,7 @@ class _VisitPhotoTypologyDetailPageState
|
|||
Container(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChatUsPage()));
|
||||
// TODO icone rond a coté copier galerie a supprimer on Tap c'est chatus()
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Container(
|
||||
|
|
|
|||
Loading…
Reference in New Issue