import 'package:fluro/fluro.dart'; import 'package:flutter/material.dart'; import 'package:flutter_wisetronic/pages/buy_service.dart'; import 'package:flutter_wisetronic/pages/contact_us.dart'; import 'package:flutter_wisetronic/pages/plain_page.dart'; import 'package:flutter_wisetronic/pages/renew_license.dart'; import 'package:flutter_wisetronic/pages/renew_minioffice.dart'; import 'package:flutter_wisetronic/store/store.dart'; import 'constants.dart'; import 'pages/blog.dart'; import 'pages/change_mobile_or_email.dart'; import 'pages/change_password.dart'; import 'pages/checkout.dart'; import 'pages/coupons.dart'; import 'pages/download.dart'; import 'pages/forgot_password.dart'; import 'pages/home.dart'; import 'pages/igoshow_learn_more.dart'; import 'pages/login.dart'; import 'pages/me.dart'; import 'pages/minipos_learn_more.dart'; import 'pages/my_addresses.dart'; import 'pages/my_cards.dart'; import 'pages/my_support.dart'; import 'pages/new_comment.dart'; import 'pages/new_ticket.dart'; import 'pages/new_user.dart'; import 'pages/order_detail.dart'; import 'pages/orders.dart'; import 'pages/pay_now.dart'; import 'pages/reset_password.dart'; import 'pages/search_place.dart'; import 'pages/set_password.dart'; import 'pages/shop.dart'; import 'pages/tutorials.dart'; import 'pages/user_profile.dart'; import 'pages/view_blog.dart'; import 'pages/view_ticket.dart'; // import 'widgets/mobile/ocr_scan.dart'; class Routes { static final router = FluroRouter(); static void configure() { router.define('/', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Home(title: Constants.APP_TITLE,); }), transitionType: TransitionType.fadeIn ); router.define('/download', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Download(); }), transitionType: TransitionType.inFromRight ); router.define('/minipos-learn-more', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return MiniPosLearnMore(); }), transitionType: TransitionType.inFromRight ); router.define('/igoshow-learn-more', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return IGoShowLearnMore(); }), transitionType: TransitionType.inFromRight ); router.define('/tutorials', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Tutorials(); }), transitionType: TransitionType.inFromRight ); router.define('/login', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Login(); }), transitionType: TransitionType.inFromRight ); router.define('/me', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Me(); }), transitionType: TransitionType.inFromRight ); router.define('/change-password', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return ChangePassword(); }), transitionType: TransitionType.inFromRight ); router.define('/user-profile', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return UserProfile(); }), transitionType: TransitionType.inFromRight ); router.define('/new-user', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return NewUser(); }), transitionType: TransitionType.inFromRight ); router.define('/set-password/:mobile/:code', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return SetPassword(params['mobile'][0], code: params['code'][0]); } )); router.define('/forgot-password', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return ForgotPassword(); } )); router.define('/reset-password/:mobile/:code', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return ResetPassword(params['mobile'][0], code: params['code'][0]); } )); router.define('/change-mobile-email/:ismobile', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { if (params['ismobile'][0] == '1') { return ChangeMobileOrEmail(true); } return ChangeMobileOrEmail(false); } )); router.define('/my-addresses/:business_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return MyAddresses(businessId: int.parse(params['business_id'][0]),); } )); router.define('/my-support/:business_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return MySupport(businessId: int.parse(params['business_id'][0]),); } )); router.define('/new-ticket/:business_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return NewTicket(businessId: int.parse(params['business_id'][0]),); } )); router.define('/search-place/:business_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return SearchPlace(int.parse(params['business_id'][0])); } )); router.define('/view-ticket/:ticket_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return ViewTicket(int.parse(params['ticket_id'][0]),); } )); router.define('/blog/:business_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Blog(businessId: int.parse(params['business_id'][0]),); } )); router.define('/view-blog/:bid', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return ViewBlog(int.parse(params['bid'][0]),); } )); router.define('/shop/:business_id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Shop(businessId: int.parse(params['business_id'][0]),); } )); router.define('/shop', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Shop(); } )); // router.define('/ocr-scan', handler: new Handler( // handlerFunc: (BuildContext context, Map> params) { // return OCRScan(); // } // )); router.define('/checkout/:id', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Checkout(int.parse(params['id'][0])); }), ); router.define('/paynow/:orderId', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return PayNow(int.parse(params['orderId'][0])); }), ); router.define('/orders', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Orders(); } )); router.define('/my-cards', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return MyCards(); } )); router.define('/orderdetail/:orderId', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return OrderDetail(int.parse(params['orderId'][0])); }), ); router.define('/new-comment/:orderId', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return NewComment(int.parse(params['orderId'][0])); }), ); router.define('/coupons/:contactId', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return Coupons(int.parse(params['contactId'][0])); }), ); router.define('/service-policy', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return PlainPage( 'service-policy', // businessId: Constants.BUSINESS_ID, businessId: 310, ); }), ); router.define('/return-policy', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return PlainPage( 'return-policy', // businessId: Constants.BUSINESS_ID, businessId: 310, ); }), ); router.define('/privacy-policy', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return PlainPage( 'privacy-policy', // businessId: Constants.BUSINESS_ID, businessId: 310, ); }), ); router.define('/end-user-license-agreement', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return PlainPage( 'end-user-license-agreement', // businessId: Constants.BUSINESS_ID, businessId: 310, ); }), ); router.define('/about-us', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return PlainPage( 'about-us', // businessId: Constants.BUSINESS_ID, businessId: 310, ); }), ); router.define('/contact-us', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return ContactUs( businessId: Constants.BUSINESS_ID, ); }), ); router.define('/renew-license', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return RenewLicense(); } )); router.define('/renew-minioffice/:gid', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return RenewMiniOffice(int.parse(params['gid'][0])); } )); router.define('/buy-service/:gid/:servicename', handler: new Handler( handlerFunc: (BuildContext context, Map> params) { return BuyService(int.parse(params['gid'][0]), params['servicename'][0]); } )); } }