update loading favourite

parent 6b35189b
......@@ -61,7 +61,21 @@ class _FavoriteState extends State<Favorite> {
),
child: Container(
child: presenter.favoriteModel == null
? Container()
? Container(
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
child: CircularProgressIndicator( valueColor: new AlwaysStoppedAnimation<Color>(
Color.fromRGBO(69, 85, 79, 1),
),),
height: 30.0,
width: 30.0,
),]
))
)
: ListView.builder(
itemCount: presenter.favoriteModel.wishListItem.length,
itemBuilder: (context, i) {
......
import 'package:feelverapp/model/favorite/delete_favorite_Model.dart';
import 'package:feelverapp/model/favorite/favorite_Model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/favorite/favorite.dart';
......@@ -15,11 +16,11 @@ class FavoritePresenter extends BasePresenter<Favorite> {
FavoritePresenter(State<Favorite> state) : super(state);
Favoriteitem() async {
var _id = await AccountUtil.getID();
print(_id);
print("555555555555");
_api = Api<FavoriteModel>();
var res = await _api.favorite({
"customer_id": _id,
});
......@@ -34,11 +35,13 @@ class FavoritePresenter extends BasePresenter<Favorite> {
}
Deletefavoriteitem(String id) async {
LoadingView(state.context).show();
_api = Api<DeletefavoriteModel>();
var res = await _api.deletefavorite({
"id": id,
});
LoadingView(state.context).hide();
if (res.fail == null) {
setState(() {
deletefavoriteModel = res.success;
......
......@@ -155,7 +155,7 @@ class _NavDrawerState extends State<NavDrawer> with TickerProviderStateMixin {
left: SizeConfig.getPadding(30)),
alignment: Alignment.topLeft,
child: Text(
'My order Status',
'My order ',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
......@@ -164,165 +164,166 @@ class _NavDrawerState extends State<NavDrawer> with TickerProviderStateMixin {
),
),
),
GestureDetector(
onTap: () {},
child: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(12),
left: SizeConfig.getPadding(30)),
alignment: Alignment.topLeft,
child: Text(
'รายการสั่งซื้อที่สำเร็จ',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
),
GestureDetector(
onTap: () {},
child: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(12),
left: SizeConfig.getPadding(30)),
alignment: Alignment.topLeft,
child: Text(
'จองแล้ว',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
),
GestureDetector(
onTap: () {},
child: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(12),
left: SizeConfig.getPadding(30)),
alignment: Alignment.topLeft,
child: Text(
'ยังไม่ได้จอง',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
),
GestureDetector(
onTap: () {},
child: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(12),
left: SizeConfig.getPadding(30)),
alignment: Alignment.topLeft,
child: Text(
'รายการสั่งซื้อไม่สำเร็จ',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
),
Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(30),
left: SizeConfig.getPadding(30)),
alignment: Alignment.topLeft,
child: Text(
'language',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(30),
top: SizeConfig.getPadding(16)),
child: Image.asset(
'assets/images/ic_th.png',
width: SizeConfig.getWidth(50),
height: SizeConfig.getWidth(50),
),
),
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(30),
top: SizeConfig.getPadding(16)),
child: Image.asset(
'assets/images/ic_en.png',
width: SizeConfig.getWidth(50),
height: SizeConfig.getWidth(50),
),
),
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(30),
top: SizeConfig.getPadding(16)),
child: Image.asset(
'assets/images/ic_ch.png',
width: SizeConfig.getWidth(50),
height: SizeConfig.getWidth(50),
),
),
],
),
Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(
top: 0, left: SizeConfig.getPadding(42)),
alignment: Alignment.topLeft,
child: Text(
'TH',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
Container(
padding: EdgeInsets.only(
top: 0, left: SizeConfig.getPadding(60)),
alignment: Alignment.topLeft,
child: Text(
'EN',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
Container(
padding: EdgeInsets.only(
top: 0, left: SizeConfig.getPadding(60)),
alignment: Alignment.topLeft,
child: Text(
'CH',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w600),
),
),
],
),
// GestureDetector(
// onTap: () {},
// child: Container(
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(12),
// left: SizeConfig.getPadding(30)),
// alignment: Alignment.topLeft,
// child: Text(
// 'รายการสั่งซื้อที่สำเร็จ',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// ),
// GestureDetector(
// onTap: () {},
// child: Container(
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(12),
// left: SizeConfig.getPadding(30)),
// alignment: Alignment.topLeft,
// child: Text(
// 'จองแล้ว',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// ),
// GestureDetector(
// onTap: () {},
// child: Container(
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(12),
// left: SizeConfig.getPadding(30)),
// alignment: Alignment.topLeft,
// child: Text(
// 'ยังไม่ได้จอง',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// ),
// GestureDetector(
// onTap: () {},
// child: Container(
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(12),
// left: SizeConfig.getPadding(30)),
// alignment: Alignment.topLeft,
// child: Text(
// 'รายการสั่งซื้อไม่สำเร็จ',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(30),
// left: SizeConfig.getPadding(30)),
// alignment: Alignment.topLeft,
// child: Text(
// 'language',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// Row(
// children: <Widget>[
// Container(
// padding: EdgeInsets.only(
// left: SizeConfig.getPadding(30),
// top: SizeConfig.getPadding(16)),
// child: Image.asset(
// 'assets/images/ic_th.png',
// width: SizeConfig.getWidth(50),
// height: SizeConfig.getWidth(50),
// ),
// ),
// Container(
// padding: EdgeInsets.only(
// left: SizeConfig.getPadding(30),
// top: SizeConfig.getPadding(16)),
// child: Image.asset(
// 'assets/images/ic_en.png',
// width: SizeConfig.getWidth(50),
// height: SizeConfig.getWidth(50),
// ),
// ),
// Container(
// padding: EdgeInsets.only(
// left: SizeConfig.getPadding(30),
// top: SizeConfig.getPadding(16)),
// child: Image.asset(
// 'assets/images/ic_ch.png',
// width: SizeConfig.getWidth(50),
// height: SizeConfig.getWidth(50),
// ),
// ),
// ],
// ),
// Row(
// children: <Widget>[
// Container(
// padding: EdgeInsets.only(
// top: 0, left: SizeConfig.getPadding(42)),
// alignment: Alignment.topLeft,
// child: Text(
// 'TH',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// Container(
// padding: EdgeInsets.only(
// top: 0, left: SizeConfig.getPadding(60)),
// alignment: Alignment.topLeft,
// child: Text(
// 'EN',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// Container(
// padding: EdgeInsets.only(
// top: 0, left: SizeConfig.getPadding(60)),
// alignment: Alignment.topLeft,
// child: Text(
// 'CH',
// style: TextStyle(
// color: Colors.black,
// fontSize: SizeConfig.getFontSize(16),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w600),
// ),
// ),
// ],
// ),
SizedBox(height:50),
Row(
children: <Widget>[
Container(
......
......@@ -571,6 +571,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
),
alignment: Alignment.topLeft,
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
itemCount: presenter.model.result[0].openHour.length,
itemBuilder: (context, i) {
return Text(
......
......@@ -92,6 +92,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.1"
firebase_crashlytics:
dependency: "direct main"
description:
name: firebase_crashlytics
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4+1"
flutter:
dependency: "direct main"
description: flutter
......
......@@ -37,6 +37,7 @@ dependencies:
date_format: ^1.0.8
flutter_datetime_picker: ^1.4.0
carousel_slider: ^2.2.1
firebase_crashlytics: ^0.1.4+1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment