backup. before shop update
This commit is contained in:
27
lib/pages/attribute_selection.dart
Normal file
27
lib/pages/attribute_selection.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_attribute_selection.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
import '../models/business.dart';
|
||||
import '../models/product.dart';
|
||||
|
||||
class AttributeSelection extends StatelessWidget {
|
||||
final Product product;
|
||||
final Business business;
|
||||
final GlobalKey startKey;
|
||||
|
||||
const AttributeSelection({Key key, this.product, this.business, this.startKey}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileAttributeSelection(product: product, business: business, startKey: startKey,),
|
||||
tablet: MobileAttributeSelection(product: product, business: business, startKey: startKey,),
|
||||
desktop: MobileAttributeSelection(product: product, business: business, startKey: startKey,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
32
lib/pages/blog.dart
Normal file
32
lib/pages/blog.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../widgets/desktop/desktop_blog.dart';
|
||||
import '../widgets/mobile/mobile_blog.dart';
|
||||
|
||||
class Blog extends StatelessWidget {
|
||||
final Key key;
|
||||
final int businessId;
|
||||
|
||||
const Blog({this.key, int businessId}) :
|
||||
businessId = businessId ?? Constants.BUSINESS_ID;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileBlog(businessId: businessId,),
|
||||
tablet: DesktopBlog(businessId: businessId,),
|
||||
desktop: Scrollbar(
|
||||
isAlwaysShown: true,
|
||||
child: DesktopBlog(businessId: businessId,),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
76
lib/pages/buy_service.dart
Normal file
76
lib/pages/buy_service.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_wisetronic/utils/http_util.dart';
|
||||
import 'package:flutter_wisetronic/utils/utils.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_buy_service.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_renew_minioffice.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_buy_service.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_renew_minioffice.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../models/business.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_renew_license.dart';
|
||||
import '../widgets/mobile/mobile_renew_license.dart';
|
||||
|
||||
class BuyService extends StatefulWidget {
|
||||
final int gid;
|
||||
final String serviceName;
|
||||
|
||||
const BuyService(this.gid, this.serviceName, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => BuyServiceState();
|
||||
}
|
||||
|
||||
class BuyServiceState extends State<BuyService> {
|
||||
Map<String, dynamic> data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
if (data == null ) {
|
||||
return new Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileBuyService(data),
|
||||
tablet: DesktopBuyService(data),
|
||||
desktop: DesktopBuyService(data),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
HttpUtil.httpGet(
|
||||
'v1/get-buy-service-info/${widget.serviceName}/${widget.gid}',
|
||||
businessId: Constants.BUSINESS_ID,
|
||||
).then((value) {
|
||||
data = value;
|
||||
setState(() {});
|
||||
}).onError((error, stackTrace) {
|
||||
Utils.showMessageDialog(context, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
48
lib/pages/change_mobile_or_email.dart
Normal file
48
lib/pages/change_mobile_or_email.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_change_mobile_or_email.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_change_mobile_or_email.dart';
|
||||
|
||||
class ChangeMobileOrEmail extends StatelessWidget {
|
||||
final bool isMobile;
|
||||
|
||||
const ChangeMobileOrEmail(this.isMobile, {Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: isMobile ? S.of(context).change_mobile : S.of(context).change_email,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(isMobile ? S.of(context).change_mobile : S.of(context).change_email, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileChangeMobileOrEmail(isMobile),
|
||||
tablet: DesktopChangeMobileOrEmail(isMobile),
|
||||
desktop: DesktopChangeMobileOrEmail(isMobile),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
46
lib/pages/change_password.dart
Normal file
46
lib/pages/change_password.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_change_password.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_change_password.dart';
|
||||
|
||||
class ChangePassword extends StatelessWidget {
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).change_password,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).change_password, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileChangePassword(),
|
||||
tablet: DesktopChangePassword(),
|
||||
desktop: DesktopChangePassword(),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
31
lib/pages/checkout.dart
Normal file
31
lib/pages/checkout.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_checkout.dart';
|
||||
import '../widgets/mobile/mobile_checkout.dart';
|
||||
|
||||
class Checkout extends StatelessWidget {
|
||||
final int businessId;
|
||||
|
||||
const Checkout(this.businessId, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileCheckout(businessId),
|
||||
tablet: DesktopCheckout(businessId),
|
||||
desktop: DesktopCheckout(businessId),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
70
lib/pages/contact_us.dart
Normal file
70
lib/pages/contact_us.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../models/business.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/http_util.dart';
|
||||
import '../utils/utils.dart';
|
||||
import '../widgets/desktop/desktop_contact_us.dart';
|
||||
import '../widgets/mobile/mobile_contact_us.dart';
|
||||
|
||||
class ContactUs extends StatefulWidget {
|
||||
final int businessId;
|
||||
|
||||
const ContactUs({this.businessId, Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => ContactUsState();
|
||||
}
|
||||
|
||||
class ContactUsState extends State<ContactUs> {
|
||||
Business business;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
if (business == null) {
|
||||
return new Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileContactUs(business),
|
||||
tablet: DesktopContactUs(business),
|
||||
desktop: DesktopContactUs(business),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
loadData();
|
||||
}
|
||||
|
||||
void loadData() {
|
||||
HttpUtil.httpGet(
|
||||
'v1/get-business',
|
||||
businessId: widget.businessId,
|
||||
).then((value) {
|
||||
business = Business.fromJson(value);
|
||||
setState(() {});
|
||||
}).onError((error, stackTrace) {
|
||||
Utils.showMessageDialog(context, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
31
lib/pages/coupons.dart
Normal file
31
lib/pages/coupons.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_coupons.dart';
|
||||
import '../widgets/mobile/mobile_coupons.dart';
|
||||
|
||||
class Coupons extends StatelessWidget {
|
||||
final int contactId;
|
||||
|
||||
const Coupons(this.contactId, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileCoupons(contactId,),
|
||||
tablet: DesktopCoupons(contactId,),
|
||||
desktop: DesktopCoupons(contactId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,23 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/general/download_apps.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_download_apps.dart';
|
||||
import 'package:flutter_wisetronic/widgets/general/breadcrumbs.dart';
|
||||
import 'package:flutter_wisetronic/widgets/general/double_back_to_close_app_wrapper.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_download_apps.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../events/eventbus.dart';
|
||||
import '../events/events.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../utils/double_back_to_close_app.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/http_util.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/mobile/mobile_navigation_drawer.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_navigation_drawer.dart';
|
||||
|
||||
class Download extends StatefulWidget {
|
||||
|
||||
@@ -21,25 +30,46 @@ class Download extends StatefulWidget {
|
||||
|
||||
class DownloadState extends State<Download> {
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
Map<String, dynamic> data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
if (data == null) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(title: S.of(context).download,),
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).download,
|
||||
back: true,
|
||||
breadCrumbs: [BreadCrumb(S.of(context).downloads, null)],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? MobileNavigationDrawer() : null,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
DownloadApps(),
|
||||
],
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileDownloadApps(data),
|
||||
tablet: DesktopDownloadApps(data),
|
||||
desktop: Scrollbar(
|
||||
isAlwaysShown: true,
|
||||
child: DesktopDownloadApps(data),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: BottomNav(),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -52,6 +82,18 @@ class DownloadState extends State<Download> {
|
||||
_scaffoldKey.currentState.openDrawer();
|
||||
}
|
||||
});
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
HttpUtil.httpGet('v1/get-wisetronic-download-page')
|
||||
.then((value) {
|
||||
print('$value');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
data = value;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
34
lib/pages/edit_address.dart
Normal file
34
lib/pages/edit_address.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_edit_address.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_edit_address.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../models/address.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
|
||||
class EditAddress extends StatelessWidget {
|
||||
final Key key;
|
||||
final Address address;
|
||||
final int businessId;
|
||||
const EditAddress(this.address, {this.key, int businessId}) :
|
||||
businessId = businessId ?? Constants.BUSINESS_ID;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileEditAddress(address, businessId: businessId,),
|
||||
tablet: DesktopEditAddress(address, businessId: businessId,),
|
||||
desktop: DesktopEditAddress(address, businessId: businessId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
45
lib/pages/forgot_password.dart
Normal file
45
lib/pages/forgot_password.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_forgot_password.dart';
|
||||
import 'package:flutter_wisetronic/widgets/general/breadcrumbs.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_forgot_password.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
|
||||
class ForgotPassword extends StatelessWidget {
|
||||
const ForgotPassword({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).forgot_password,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).forgot_password, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileForgotPassword(),
|
||||
tablet: DesktopForgotPassword(),
|
||||
desktop: DesktopForgotPassword(),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +1,39 @@
|
||||
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/models/gallery.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/index_carousel.dart';
|
||||
import '../widgets/general/index_main_content_1.dart';
|
||||
import '../widgets/general/index_main_content_2.dart';
|
||||
import '../widgets/general/index_main_content_3.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
// import 'package:uni_links/uni_links.dart';
|
||||
|
||||
import '../events/eventbus.dart';
|
||||
import '../events/events.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../models/gallery.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/http_util.dart';
|
||||
import '../utils/double_back_to_close_app.dart';
|
||||
import '../utils/utils.dart';
|
||||
import '../widgets/desktop/desktop_Index_carousel.dart';
|
||||
import '../widgets/desktop/desktop_index_main_content_1.dart';
|
||||
import '../widgets/desktop/desktop_index_main_content_2.dart';
|
||||
import '../widgets/desktop/desktop_index_main_content_3.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/double_back_to_close_app_wrapper.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_index_carousel.dart';
|
||||
import '../widgets/mobile/mobile_index_main_content_1.dart';
|
||||
import '../widgets/mobile/mobile_index_main_content_2.dart';
|
||||
import '../widgets/mobile/mobile_index_main_content_3.dart';
|
||||
import '../widgets/mobile/mobile_navigation_drawer.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
Locale locale;
|
||||
final String title;
|
||||
|
||||
Home(Locale locale, {Key key, this.title}) :
|
||||
locale = locale ?? store.state.locale;
|
||||
Home({Key key, this.title = ''}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
@@ -35,36 +45,78 @@ class Home extends StatefulWidget {
|
||||
class HomeState extends State<Home> {
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
List<Gallery> galleries = [];
|
||||
String content1Message = '';
|
||||
String content1Message;
|
||||
Map<String, dynamic> content2;
|
||||
|
||||
StreamSubscription _sub;
|
||||
Uri _latestUri;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
if (content1Message == null) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(),
|
||||
drawer: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? MobileNavigationDrawer() : null,
|
||||
body: DoubleBackToCloseApp(
|
||||
snackBar: SnackBar(
|
||||
content: Text(S.of(context).tap_back_again_to_exit),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IndexCarousel(galleries),
|
||||
IndexMainContent1(content1Message),
|
||||
IndexMainContent2(content2),
|
||||
IndexMainContent3(content2),
|
||||
],
|
||||
body: DoubleBackToCloseAppWrapper(
|
||||
child: ScreenTypeLayout(
|
||||
mobile: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MobileIndexCarousel(galleries),
|
||||
MobileIndexMainContent1(content1Message),
|
||||
MobileIndexMainContent2(content2),
|
||||
MobileIndexMainContent3(content2),
|
||||
],
|
||||
),
|
||||
),
|
||||
tablet: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
DesktopIndexCarousel(galleries),
|
||||
DesktopIndexMainContent1(content1Message),
|
||||
DesktopIndexMainContent2(content2),
|
||||
DesktopIndexMainContent3(content2),
|
||||
],
|
||||
),
|
||||
),
|
||||
desktop: Scrollbar(
|
||||
isAlwaysShown: true,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
DesktopIndexCarousel(galleries),
|
||||
DesktopIndexMainContent1(content1Message),
|
||||
DesktopIndexMainContent2(content2),
|
||||
DesktopIndexMainContent3(content2),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: BottomNav(),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -72,13 +124,21 @@ class HomeState extends State<Home> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
eventBus.on<OnGotDeepLinkUri>().listen((event) {
|
||||
if (mounted) {
|
||||
print('got latest Uri $_latestUri');
|
||||
}
|
||||
});
|
||||
initPlatformStateForUri();
|
||||
_loadData();
|
||||
eventBus.on<OpenDrawer>().listen((event) {
|
||||
if (mounted) {
|
||||
_scaffoldKey.currentState.openDrawer();
|
||||
}
|
||||
});
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
Utils.getCurrentUser();
|
||||
});
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
@@ -94,4 +154,39 @@ class HomeState extends State<Home> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initPlatformStateForUri() async {
|
||||
if (kIsWeb) {
|
||||
if (!mounted) return;
|
||||
_latestUri = Uri.base;
|
||||
print('uri base $_latestUri');
|
||||
eventBus.fire(OnGotDeepLinkUri(_latestUri));
|
||||
} else {
|
||||
// _sub = getUriLinksStream().listen((Uri uri) {
|
||||
// print('_sub should get uri $uri');
|
||||
// // if (!mounted) return;
|
||||
// _latestUri = uri;
|
||||
// eventBus.fire(OnGotDeepLinkUri(uri));
|
||||
// }, onError: (err) {
|
||||
// if (!mounted) return;
|
||||
// _latestUri = null;
|
||||
// });
|
||||
//
|
||||
// Uri initialUri;
|
||||
//
|
||||
// try {
|
||||
// initialUri = await getInitialUri();
|
||||
// print('initial uri: ${initialUri?.path} ${initialUri
|
||||
// ?.queryParametersAll}');
|
||||
// } on PlatformException {
|
||||
// initialUri = null;
|
||||
// } on FormatException {
|
||||
// initialUri = null;
|
||||
// }
|
||||
//
|
||||
// if (!mounted) return;
|
||||
// _latestUri = initialUri;
|
||||
// eventBus.fire(OnGotDeepLinkUri(_latestUri));
|
||||
}
|
||||
}
|
||||
}
|
||||
89
lib/pages/igoshow_learn_more.dart
Normal file
89
lib/pages/igoshow_learn_more.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/http_util.dart';
|
||||
import '../widgets/desktop/desktop_igoshow_learn_more.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_igoshow_learn_more.dart';
|
||||
|
||||
class IGoShowLearnMore extends StatefulWidget {
|
||||
const IGoShowLearnMore({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return IGoShowLearnMoreState();
|
||||
}
|
||||
}
|
||||
|
||||
class IGoShowLearnMoreState extends State<IGoShowLearnMore> {
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
Map<String, dynamic> data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
if (data == null) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).igoshow,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).igoshow, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileiGoShowLearnMore(data),
|
||||
tablet: DesktopiGoShowLearnMore(data),
|
||||
desktop: DesktopiGoShowLearnMore(data),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
HttpUtil.httpGet('v1/get-igoshow-learn-more-page')
|
||||
.then((value) {
|
||||
print('$value');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
data = value;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
66
lib/pages/login.dart
Normal file
66
lib/pages/login.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_login.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_login.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
final Key key;
|
||||
|
||||
const Login({this.key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return LoginState();
|
||||
}
|
||||
}
|
||||
|
||||
class LoginState extends State<Login> {
|
||||
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).login,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).login, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileLogin(),
|
||||
tablet: DesktopLogin(),
|
||||
desktop: DesktopLogin(),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
69
lib/pages/me.dart
Normal file
69
lib/pages/me.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_me.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/double_back_to_close_app_wrapper.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_me.dart';
|
||||
|
||||
class Me extends StatefulWidget {
|
||||
final Key key;
|
||||
|
||||
const Me({this.key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return MeState();
|
||||
}
|
||||
}
|
||||
|
||||
class MeState extends State<Me> {
|
||||
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: sizingInformation.isMobile? null : NavigationBar(
|
||||
title: S.of(context).me,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).me, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: DoubleBackToCloseAppWrapper(
|
||||
child: ScreenTypeLayout(
|
||||
mobile: MobileMe(),
|
||||
tablet: DesktopMe(),
|
||||
desktop: DesktopMe(),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 3,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
94
lib/pages/minipos_learn_more.dart
Normal file
94
lib/pages/minipos_learn_more.dart
Normal file
@@ -0,0 +1,94 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/http_util.dart';
|
||||
import '../widgets/desktop/desktop_minipos_learn_more.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_minipos_learn_more.dart';
|
||||
|
||||
class MiniPosLearnMore extends StatefulWidget {
|
||||
const MiniPosLearnMore({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return MiniPosLearnMoreState();
|
||||
}
|
||||
}
|
||||
|
||||
class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
Map<String, dynamic> data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
if (data == null) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return WillPopScope(
|
||||
child: ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).minipos,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).minipos, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileMiniPosLearnMore(data),
|
||||
tablet: DesktopMiniPosLearnMore(data),
|
||||
desktop: DesktopMiniPosLearnMore(data),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
),
|
||||
onWillPop: () async {
|
||||
return true;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
HttpUtil.httpGet('v1/get-minipos-learn-more-page')
|
||||
.then((value) {
|
||||
print('$value');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
data = value;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
29
lib/pages/my_addresses.dart
Normal file
29
lib/pages/my_addresses.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../widgets/desktop/desktop_my_addresses.dart';
|
||||
import '../widgets/mobile/mobile_my_addresses.dart';
|
||||
|
||||
class MyAddresses extends StatelessWidget {
|
||||
final Key key;
|
||||
final int businessId;
|
||||
|
||||
const MyAddresses({this.key, int businessId}) :
|
||||
businessId = businessId ?? Constants.BUSINESS_ID;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileMyAddresses(businessId: businessId,),
|
||||
tablet: DesktopMyAddresses(businessId: businessId,),
|
||||
desktop: DesktopMyAddresses(businessId: businessId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
46
lib/pages/my_cards.dart
Normal file
46
lib/pages/my_cards.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../routes.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_my_cards.dart';
|
||||
import '../widgets/mobile/mobile_my_cards.dart';
|
||||
|
||||
class MyCards extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
if (store.state.user == null) {
|
||||
store.dispatch(UpdateRedirectRoute('/my-cards'));
|
||||
Routes.router.navigateTo(context, '/login', replace: true);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (store.state.user == null) {
|
||||
return Center(
|
||||
child: Image.asset(
|
||||
'assets/images/denied.png',
|
||||
width: 48,
|
||||
height: 48,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileMyCards(),
|
||||
tablet: DesktopMyCards(),
|
||||
desktop: DesktopMyCards(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
29
lib/pages/my_support.dart
Normal file
29
lib/pages/my_support.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../widgets/desktop/desktop_my_support.dart';
|
||||
import '../widgets/mobile/mobile_my_support.dart';
|
||||
|
||||
class MySupport extends StatelessWidget {
|
||||
final Key key;
|
||||
final int businessId;
|
||||
|
||||
const MySupport({this.key, int businessId}) :
|
||||
businessId = businessId ?? Constants.BUSINESS_ID;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileMySupport(businessId: businessId,),
|
||||
tablet: DesktopMySupport(businessId: businessId,),
|
||||
desktop: DesktopMySupport(businessId: businessId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
36
lib/pages/new_address.dart
Normal file
36
lib/pages/new_address.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../models/located_address.dart';
|
||||
import '../widgets/desktop/desktop_new_address.dart';
|
||||
import '../widgets/mobile/mobile_new_address.dart';
|
||||
|
||||
class NewAddress extends StatelessWidget {
|
||||
final Key key;
|
||||
final LocatedAddress locatedAddress;
|
||||
final int businessId;
|
||||
const NewAddress({this.key, this.locatedAddress, this.businessId}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileNewAddress(
|
||||
locatedAddress: locatedAddress,
|
||||
businessId: businessId,
|
||||
),
|
||||
tablet: DesktopNewAddress(
|
||||
locatedAddress: locatedAddress,
|
||||
businessId: businessId,
|
||||
),
|
||||
desktop: DesktopNewAddress(
|
||||
locatedAddress: locatedAddress,
|
||||
businessId: businessId,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
31
lib/pages/new_comment.dart
Normal file
31
lib/pages/new_comment.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_new_comment.dart';
|
||||
import '../widgets/mobile/mobile_new_comment.dart';
|
||||
|
||||
class NewComment extends StatelessWidget {
|
||||
final int orderId;
|
||||
|
||||
const NewComment(this.orderId, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileNewComment(orderId,),
|
||||
tablet: DesktopNewComment(orderId,),
|
||||
desktop: DesktopNewComment(orderId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
68
lib/pages/new_ticket.dart
Normal file
68
lib/pages/new_ticket.dart
Normal file
@@ -0,0 +1,68 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_new_ticket.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_new_ticket.dart';
|
||||
|
||||
class NewTicket extends StatefulWidget {
|
||||
final Key key;
|
||||
final int businessId;
|
||||
|
||||
const NewTicket({this.key, int businessId}) :
|
||||
businessId = businessId ?? Constants.BUSINESS_ID;
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return NewTicketState();
|
||||
}
|
||||
}
|
||||
|
||||
class NewTicketState extends State<NewTicket> {
|
||||
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).new_ticket,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).new_ticket, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileNewTicket(businessId: widget.businessId,),
|
||||
tablet: DesktopNewTicket(businessId: widget.businessId,),
|
||||
desktop: DesktopNewTicket(businessId: widget.businessId,),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
45
lib/pages/new_user.dart
Normal file
45
lib/pages/new_user.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_new_user.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_new_user.dart';
|
||||
|
||||
class NewUser extends StatelessWidget {
|
||||
const NewUser({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).registration,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).registration, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileNewUser(),
|
||||
tablet: DesktopNewUser(),
|
||||
desktop: DesktopNewUser(),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
31
lib/pages/order_detail.dart
Normal file
31
lib/pages/order_detail.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_order_detail.dart';
|
||||
import '../widgets/mobile/mobile_order_detail.dart';
|
||||
|
||||
class OrderDetail extends StatelessWidget {
|
||||
final int orderId;
|
||||
final bool fromOrders;
|
||||
|
||||
const OrderDetail(this.orderId, {this.fromOrders = false, Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileOrderDetail(orderId, fromOrders: fromOrders,),
|
||||
tablet: DesktopOrderDetail(orderId, fromOrders: fromOrders,),
|
||||
desktop: DesktopOrderDetail(orderId, fromOrders: fromOrders,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
46
lib/pages/orders.dart
Normal file
46
lib/pages/orders.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../routes.dart';
|
||||
import '../widgets/desktop/desktop_orders.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/mobile/mobile_orders.dart';
|
||||
|
||||
class Orders extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
if (store.state.user == null) {
|
||||
store.dispatch(UpdateRedirectRoute('/orders'));
|
||||
Routes.router.navigateTo(context, '/login', replace: true);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (store.state.user == null) {
|
||||
return Center(
|
||||
child: Image.asset(
|
||||
'assets/images/denied.png',
|
||||
width: 48,
|
||||
height: 48,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileOrders(),
|
||||
tablet: DesktopOrders(),
|
||||
desktop: DesktopOrders(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
31
lib/pages/pay_now.dart
Normal file
31
lib/pages/pay_now.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_pay_now.dart';
|
||||
import '../widgets/mobile/mobile_pay_now.dart';
|
||||
|
||||
class PayNow extends StatelessWidget {
|
||||
final int orderId;
|
||||
|
||||
const PayNow(this.orderId, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobilePayNow(orderId,),
|
||||
tablet: DesktopPayNow(orderId,),
|
||||
desktop: DesktopPayNow(orderId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
74
lib/pages/plain_page.dart
Normal file
74
lib/pages/plain_page.dart
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_plain_page.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_plain_page.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../models/blog.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/http_util.dart';
|
||||
import '../utils/utils.dart';
|
||||
|
||||
class PlainPage extends StatefulWidget {
|
||||
final int businessId;
|
||||
final String slug;
|
||||
|
||||
const PlainPage(this.slug, {this.businessId, Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => PlainPageState();
|
||||
}
|
||||
|
||||
class PlainPageState extends State<PlainPage> {
|
||||
Blog blog;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
if (blog == null) {
|
||||
return new Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobilePlainPage(blog),
|
||||
tablet: DesktopPlainPage(blog),
|
||||
desktop: DesktopPlainPage(blog),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
loadData();
|
||||
}
|
||||
|
||||
void loadData() {
|
||||
HttpUtil.httpGet(
|
||||
'v1/special-page',
|
||||
businessId: widget.businessId,
|
||||
queryParameters: {
|
||||
'bid': widget.slug,
|
||||
}
|
||||
).then((value) {
|
||||
blog = Blog.fromJson(value);
|
||||
setState(() {});
|
||||
}).onError((error, stackTrace) {
|
||||
Utils.showMessageDialog(context, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
34
lib/pages/product_detail_page.dart
Normal file
34
lib/pages/product_detail_page.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../models/business.dart';
|
||||
import '../models/product.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_product_detail_page.dart';
|
||||
import '../widgets/mobile/mobile_product_detail_page.dart';
|
||||
|
||||
class ProductDetailPage extends StatelessWidget {
|
||||
final Business business;
|
||||
final Product product;
|
||||
|
||||
const ProductDetailPage({this.business, this.product, Key key}) :
|
||||
super(key: key);
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileProductDetailPage(business: business, product: product,),
|
||||
tablet: DesktopProductDetailPage(business: business, product: product,),
|
||||
desktop: DesktopProductDetailPage(business: business, product: product,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
43
lib/pages/renew_license.dart
Normal file
43
lib/pages/renew_license.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../models/business.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_renew_license.dart';
|
||||
import '../widgets/mobile/mobile_renew_license.dart';
|
||||
|
||||
class RenewLicense extends StatefulWidget {
|
||||
|
||||
const RenewLicense({Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => RenewLicenseState();
|
||||
}
|
||||
|
||||
class RenewLicenseState extends State<RenewLicense> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileRenewLicense(Constants.BUSINESS_ID),
|
||||
tablet: DesktopRenewLicense(Constants.BUSINESS_ID),
|
||||
desktop: DesktopRenewLicense(Constants.BUSINESS_ID),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
}
|
||||
73
lib/pages/renew_minioffice.dart
Normal file
73
lib/pages/renew_minioffice.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_wisetronic/utils/http_util.dart';
|
||||
import 'package:flutter_wisetronic/utils/utils.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_renew_minioffice.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_renew_minioffice.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../models/business.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_renew_license.dart';
|
||||
import '../widgets/mobile/mobile_renew_license.dart';
|
||||
|
||||
class RenewMiniOffice extends StatefulWidget {
|
||||
final int gid;
|
||||
|
||||
const RenewMiniOffice(this.gid, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => RenewMiniOfficeState();
|
||||
}
|
||||
|
||||
class RenewMiniOfficeState extends State<RenewMiniOffice> {
|
||||
Map<String, dynamic> data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
if (data == null ) {
|
||||
return new Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileRenewMiniOffice(data),
|
||||
tablet: DesktopRenewMiniOffice(data),
|
||||
desktop: DesktopRenewMiniOffice(data),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
HttpUtil.httpGet(
|
||||
'v1/renew-minioffice/${widget.gid}',
|
||||
businessId: Constants.BUSINESS_ID,
|
||||
).then((value) {
|
||||
data = value;
|
||||
setState(() {});
|
||||
}).onError((error, stackTrace) {
|
||||
Utils.showMessageDialog(context, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
47
lib/pages/reset_password.dart
Normal file
47
lib/pages/reset_password.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_reset_password.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_reset_password.dart';
|
||||
|
||||
class ResetPassword extends StatelessWidget {
|
||||
final String mobile;
|
||||
final String code;
|
||||
const ResetPassword(this.mobile, {Key key, this.code}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).reset_password,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).reset_password, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileResetPassword(mobile, code: code,),
|
||||
tablet: DesktopResetPassword(mobile, code: code,),
|
||||
desktop: DesktopResetPassword(mobile, code: code,),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
24
lib/pages/search_place.dart
Normal file
24
lib/pages/search_place.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_search_place.dart';
|
||||
import '../widgets/mobile/mobile_search_place.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
class SearchPlace extends StatelessWidget {
|
||||
final Key key;
|
||||
final int businessId;
|
||||
const SearchPlace(this.businessId, {this.key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileSearchPlace(businessId),
|
||||
tablet: DesktopSearchPlace(businessId),
|
||||
desktop: DesktopSearchPlace(businessId),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
47
lib/pages/set_password.dart
Normal file
47
lib/pages/set_password.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_set_password.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_set_password.dart';
|
||||
|
||||
class SetPassword extends StatelessWidget {
|
||||
final String mobile;
|
||||
final String code;
|
||||
const SetPassword(this.mobile, {Key key, this.code}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).set_password,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).set_password, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileSetPassword(mobile, code: code,),
|
||||
tablet: DesktopSetPassword(mobile, code: code,),
|
||||
desktop: DesktopSetPassword(mobile, code: code,),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
193
lib/pages/shop.dart
Normal file
193
lib/pages/shop.dart
Normal file
@@ -0,0 +1,193 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/events/eventbus.dart';
|
||||
import 'package:flutter_wisetronic/events/events.dart';
|
||||
import 'package:flutter_wisetronic/generated/l10n.dart';
|
||||
import 'package:flutter_wisetronic/models/cart_info.dart';
|
||||
import 'package:flutter_wisetronic/models/cart_line_item.dart';
|
||||
import 'package:flutter_wisetronic/models/product.dart';
|
||||
import 'package:flutter_wisetronic/utils/utils.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_shop.dart';
|
||||
import '../widgets/mobile/mobile_shop.dart';
|
||||
|
||||
class Shop extends StatefulWidget {
|
||||
final int businessId;
|
||||
|
||||
const Shop({this.businessId = Constants.BUSINESS_ID, Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => ShopState();
|
||||
}
|
||||
|
||||
class ShopState extends State<Shop> {
|
||||
StreamSubscription onProductWillAddToCartSubscription;
|
||||
StreamSubscription onProductWillRemoveFromCartSubscription;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileShop(businessId: widget.businessId,),
|
||||
tablet: DesktopShop(businessId: widget.businessId,),
|
||||
desktop: DesktopShop(businessId: widget.businessId,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
onProductWillAddToCartSubscription?.cancel();
|
||||
onProductWillRemoveFromCartSubscription?.cancel();
|
||||
super.dispose();
|
||||
print("shop parent dispose");
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
onProductWillAddToCartSubscription =
|
||||
eventBus.on<OnProductWillAddToCart>().listen((event) {
|
||||
if (mounted) {
|
||||
|
||||
CartInfo cartInfo =
|
||||
Utils.getCartInfoByBusiness(store.state.cartInfos, event.business);
|
||||
|
||||
if (cartInfo == null || cartInfo.productList.length == 0) {
|
||||
cartInfo = CartInfo();
|
||||
cartInfo.id = 0;
|
||||
cartInfo.amountPaid = 0.0;
|
||||
cartInfo.businessInfo = event.business;
|
||||
cartInfo.extraFeeList = [];
|
||||
cartInfo.discountList = [];
|
||||
CartLineItem lineItem = Utils.newCartLineItem(
|
||||
id: 0,
|
||||
price: event.price,
|
||||
product: event.product,
|
||||
name: event.product.name,
|
||||
description: event.description,
|
||||
quantity: 1.0);
|
||||
cartInfo.productList = [lineItem];
|
||||
Utils.addSubproductToCard(cartInfo, lineItem);
|
||||
store.dispatch(new UpdateCartInfo(Utils.addCartInfoToCartInfoList(
|
||||
store.state.cartInfos, cartInfo)));
|
||||
eventBus.fire(new OnCartInfoUpdated());
|
||||
} else {
|
||||
if (event.product.productAttributes.length > 0) {
|
||||
CartLineItem lineItem = Utils.newCartLineItem(
|
||||
id: 0,
|
||||
price: event.price,
|
||||
product: event.product,
|
||||
name: event.product.name,
|
||||
description: event.description,
|
||||
quantity: 1.0);
|
||||
cartInfo.productList.add(lineItem);
|
||||
Utils.addSubproductToCard(cartInfo, lineItem);
|
||||
store.dispatch(new UpdateCartInfo(Utils.addCartInfoToCartInfoList(
|
||||
store.state.cartInfos, cartInfo)));
|
||||
eventBus.fire(new OnCartInfoUpdated());
|
||||
} else {
|
||||
int found = -1;
|
||||
for (var i = 0; i < cartInfo.productList.length; i++) {
|
||||
if (event.product.id == cartInfo.productList[i].product.id) {
|
||||
found = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found == -1) {
|
||||
CartLineItem lineItem = Utils.newCartLineItem(
|
||||
id: 0,
|
||||
price: event.price,
|
||||
product: event.product,
|
||||
name: event.product.name,
|
||||
description: event.description,
|
||||
quantity: 1.0);
|
||||
cartInfo.productList.add(lineItem);
|
||||
Utils.addSubproductToCard(cartInfo, lineItem);
|
||||
store.dispatch(new UpdateCartInfo(Utils.addCartInfoToCartInfoList(
|
||||
store.state.cartInfos, cartInfo)));
|
||||
eventBus.fire(new OnCartInfoUpdated());
|
||||
} else {
|
||||
if (cartInfo.productList[found].quantity + 1.0 >
|
||||
event.product.leftNum) {
|
||||
Fluttertoast.showToast(
|
||||
msg: S.of(context).product_insufficient,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
backgroundColor: Colors.red,
|
||||
textColor: Colors.white);
|
||||
} else {
|
||||
cartInfo.productList[found].quantity += 1;
|
||||
Utils.addSubproductQty(cartInfo, cartInfo.productList[found]);
|
||||
store.dispatch(new UpdateCartInfo(
|
||||
Utils.addCartInfoToCartInfoList(
|
||||
store.state.cartInfos, cartInfo)));
|
||||
eventBus.fire(new OnCartInfoUpdated());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
onProductWillRemoveFromCartSubscription =
|
||||
eventBus.on<OnProductWillRemoveFromCart>().listen((event) {
|
||||
if (mounted) {
|
||||
CartInfo cartInfo =
|
||||
Utils.getCartInfoByBusiness(store.state.cartInfos, event.business);
|
||||
if (cartInfo != null) {
|
||||
if (cartInfo.productList.length > 0) {
|
||||
if (event.productListIndex != -1) {
|
||||
if (cartInfo.productList[event.productListIndex].quantity <= 1) {
|
||||
String uuid = cartInfo.productList[event.productListIndex].uuid;
|
||||
cartInfo.productList.removeAt(event.productListIndex);
|
||||
Utils.removeSubproduct(cartInfo, uuid);
|
||||
} else {
|
||||
cartInfo.productList[event.productListIndex].quantity -= 1;
|
||||
Utils.addSubproductQty(cartInfo, cartInfo.productList[event.productListIndex], remove: true);
|
||||
}
|
||||
} else {
|
||||
int productListIndex = -1;
|
||||
for (var i = 0; i < cartInfo.productList.length; i++) {
|
||||
if (cartInfo.productList[i].product.id == event.product.id) {
|
||||
productListIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (productListIndex != -1) {
|
||||
if (cartInfo.productList[productListIndex].quantity <= 1) {
|
||||
String uuid = cartInfo.productList[productListIndex].uuid;
|
||||
cartInfo.productList.removeAt(productListIndex);
|
||||
Utils.removeSubproduct(cartInfo, uuid);
|
||||
} else {
|
||||
cartInfo.productList[productListIndex].quantity -= 1;
|
||||
Utils.addSubproductQty(cartInfo, cartInfo.productList[productListIndex], remove: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cartInfo.productList.length <= 0) {
|
||||
store.dispatch(UpdateCartInfo(Utils.removeCartInfoFromCartInfoList(
|
||||
store.state.cartInfos, cartInfo)));
|
||||
} else {
|
||||
store.dispatch(UpdateCartInfo(Utils.addCartInfoToCartInfoList(
|
||||
store.state.cartInfos, cartInfo)));
|
||||
}
|
||||
eventBus.fire(new OnCartInfoUpdated());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
48
lib/pages/store_product_search.dart
Normal file
48
lib/pages/store_product_search.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_store_product_search.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../models/business.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_store_product_search.dart';
|
||||
|
||||
class StoreProductSearch extends StatelessWidget {
|
||||
final Business business;
|
||||
|
||||
const StoreProductSearch(this.business, {Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).search_product,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).search_product, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileStoreProductSearch(business,),
|
||||
tablet: DesktopStoreProductSearch(business),
|
||||
desktop: DesktopStoreProductSearch(business),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 1,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
34
lib/pages/stripe_pay_web.dart
Normal file
34
lib/pages/stripe_pay_web.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../models/order.dart';
|
||||
import '../models/payment_platform.dart';
|
||||
import '../models/stripe_payment_method.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_stripe_pay_web.dart';
|
||||
import '../widgets/mobile/mobile_stripe_pay_web.dart';
|
||||
|
||||
class StripePayWeb extends StatelessWidget {
|
||||
final Order order;
|
||||
final PaymentPlatform paymentPlatform;
|
||||
final StripePaymentMethod stripePaymentMethod;
|
||||
|
||||
const StripePayWeb(this.order, this.paymentPlatform, {this.stripePaymentMethod});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileStripePayWeb(order, paymentPlatform, stripePaymentMethod: stripePaymentMethod,),
|
||||
tablet: DesktopStripePayWeb(order, paymentPlatform, stripePaymentMethod: stripePaymentMethod,),
|
||||
desktop: DesktopStripePayWeb(order, paymentPlatform, stripePaymentMethod: stripePaymentMethod,),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
66
lib/pages/tutorials.dart
Normal file
66
lib/pages/tutorials.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../events/eventbus.dart';
|
||||
import '../events/events.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_tutorials.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_navigation_drawer.dart';
|
||||
import '../widgets/mobile/mobile_tutorials.dart';
|
||||
|
||||
class Tutorials extends StatefulWidget {
|
||||
const Tutorials({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return TutorialsState();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TutorialsState extends State<Tutorials> {
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).tutorials,
|
||||
back: true,
|
||||
breadCrumbs: [BreadCrumb(S.of(context).tutorials, null)],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileTutorials(),
|
||||
tablet: DesktopTutorials(),
|
||||
desktop: DesktopTutorials(),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
eventBus.on<OpenDrawer>().listen((event) {
|
||||
if (mounted) {
|
||||
_scaffoldKey.currentState.openDrawer();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
46
lib/pages/user_profile.dart
Normal file
46
lib/pages/user_profile.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_wisetronic/widgets/general/breadcrumbs.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../widgets/desktop/desktop_user_profile.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_user_profile.dart';
|
||||
|
||||
class UserProfile extends StatelessWidget {
|
||||
const UserProfile({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).profile,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).profile, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileUserProfile(),
|
||||
tablet: DesktopUserProfile(),
|
||||
desktop: DesktopUserProfile(),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
67
lib/pages/view_blog.dart
Normal file
67
lib/pages/view_blog.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_view_blog.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_view_blog.dart';
|
||||
|
||||
class ViewBlog extends StatefulWidget {
|
||||
final Key key;
|
||||
final int bid;
|
||||
|
||||
const ViewBlog(this.bid, {this.key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return ViewBlogState();
|
||||
}
|
||||
}
|
||||
|
||||
class ViewBlogState extends State<ViewBlog> {
|
||||
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).view_blog,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).view_blog, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileViewBlog(widget.bid),
|
||||
tablet: DesktopViewBlog(widget.bid),
|
||||
desktop: DesktopViewBlog(widget.bid),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
67
lib/pages/view_ticket.dart
Normal file
67
lib/pages/view_ticket.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_view_ticket.dart';
|
||||
import '../widgets/general/bottom_nav.dart';
|
||||
import '../widgets/general/breadcrumbs.dart';
|
||||
import '../widgets/general/navigationbar.dart';
|
||||
import '../widgets/mobile/MobileBottomNav.dart';
|
||||
import '../widgets/mobile/mobile_view_ticket.dart';
|
||||
|
||||
class ViewTicket extends StatefulWidget {
|
||||
final Key key;
|
||||
final int ticketId;
|
||||
|
||||
const ViewTicket(this.ticketId, {this.key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return ViewTicketState();
|
||||
}
|
||||
}
|
||||
|
||||
class ViewTicketState extends State<ViewTicket> {
|
||||
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: NavigationBar(
|
||||
title: S.of(context).view_ticket,
|
||||
back: true,
|
||||
breadCrumbs: [
|
||||
BreadCrumb(S.of(context).view_ticket, null),
|
||||
],
|
||||
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
||||
),
|
||||
drawer: null,
|
||||
body: ScreenTypeLayout(
|
||||
mobile: MobileViewTicket(widget.ticketId),
|
||||
tablet: DesktopViewTicket(widget.ticketId),
|
||||
desktop: DesktopViewTicket(widget.ticketId),
|
||||
),
|
||||
bottomNavigationBar: ScreenTypeLayout(
|
||||
mobile: MobileBottomNav(currentIndex: 0,),
|
||||
tablet: BottomNav(),
|
||||
desktop: BottomNav(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user