main.dart 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332
  1. import 'dart:async';
  2. import 'dart:convert';
  3. import 'dart:io';
  4. import 'package:amap_location/amap_location.dart';
  5. import 'package:bbyyy/beans/access_bean_entity.dart';
  6. import 'package:bbyyy/beans/template_bean_entity.dart';
  7. import 'package:bbyyy/beans/w_x_bean_entity.dart';
  8. import 'package:bbyyy/https/url.dart';
  9. import 'package:bbyyy/my_tools/event_bus.dart';
  10. import 'package:bbyyy/my_tools/my_cookie.dart';
  11. import 'package:bbyyy/my_tools/my_tools.dart';
  12. import 'package:bbyyy/paegs/login_page/login_page.dart';
  13. import 'package:bbyyy/paegs/pay_page/order_information_page.dart';
  14. import 'package:bbyyy/paegs/root_page/root_page.dart';
  15. import 'package:bbyyy/paegs/root_page/root_page_view.dart';
  16. import 'package:bbyyy/paegs/welcome_page/welcome_page.dart';
  17. import 'package:dio/dio.dart';
  18. import 'package:flustars/flustars.dart';
  19. import 'package:flutter/cupertino.dart';
  20. import 'package:flutter/material.dart';
  21. import 'package:flutter/services.dart';
  22. import 'package:flutter_local_notifications/flutter_local_notifications.dart';
  23. import 'package:flutter_localizations/flutter_localizations.dart';
  24. import 'package:flutter_svg/flutter_svg.dart';
  25. import 'package:fluwx/fluwx.dart';
  26. import 'package:pull_to_refresh/pull_to_refresh.dart';
  27. import 'package:rxdart/rxdart.dart';
  28. import 'beans/coupon_bean_entity.dart';
  29. import 'beans/my_shop_bean_entity.dart';
  30. import 'beans/new_order_bean_entity.dart';
  31. import 'beans/smart_order_bean_entity.dart';
  32. import 'beans/system_information_bean_entity.dart';
  33. import 'https/MyDio.dart';
  34. import 'https/my_request.dart';
  35. import 'my_tools/const.dart';
  36. import 'my_tools/dims.dart';
  37. import 'my_tools/easy_loading/easy_loading.dart';
  38. import 'my_tools/easy_loading/loading.dart';
  39. import 'my_tools/global.dart';
  40. import 'my_tools/my_colors.dart';
  41. import 'my_tools/my_views.dart';
  42. import 'my_tools/order.dart';
  43. import 'my_tools/pop_up_queue.dart';
  44. final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
  45. FlutterLocalNotificationsPlugin();
  46. final BehaviorSubject<ReceivedNotification> didReceiveLocalNotificationSubject =
  47. BehaviorSubject<ReceivedNotification>();
  48. final BehaviorSubject<String> selectNotificationSubject =
  49. BehaviorSubject<String>();
  50. class ReceivedNotification {
  51. ReceivedNotification({
  52. @required this.id,
  53. @required this.title,
  54. @required this.body,
  55. @required this.payload,
  56. });
  57. final int id;
  58. final String title;
  59. final String body;
  60. final String payload;
  61. }
  62. Future<void> main() async {
  63. if (Platform.isIOS) {
  64. AMapLocationClient.setApiKey('548414a843a2ec9c383e34341b8c84df');
  65. }
  66. WidgetsFlutterBinding.ensureInitialized();
  67. const AndroidInitializationSettings initializationSettingsAndroid =
  68. AndroidInitializationSettings('@mipmap/app_logo');
  69. /// Note: permissions aren't requested here just to demonstrate that can be
  70. /// done later
  71. final IOSInitializationSettings initializationSettingsIOS =
  72. IOSInitializationSettings(
  73. requestAlertPermission: true,
  74. requestBadgePermission: true,
  75. requestSoundPermission: true,
  76. onDidReceiveLocalNotification:
  77. (int id, String title, String body, String payload) async {
  78. didReceiveLocalNotificationSubject.add(ReceivedNotification(
  79. id: id, title: title, body: body, payload: payload));
  80. });
  81. const MacOSInitializationSettings initializationSettingsMacOS =
  82. MacOSInitializationSettings(
  83. requestAlertPermission: true,
  84. requestBadgePermission: true,
  85. requestSoundPermission: true);
  86. final InitializationSettings initializationSettings = InitializationSettings(
  87. android: initializationSettingsAndroid,
  88. iOS: initializationSettingsIOS,
  89. macOS: initializationSettingsMacOS);
  90. await flutterLocalNotificationsPlugin.initialize(initializationSettings,
  91. onSelectNotification: (String payload) async {
  92. if (payload != null) {
  93. if (payload == notifyTypeNewMsg) {
  94. RootPageView().bNIndex = 2;
  95. EventBus().emit('ChangePage');
  96. }
  97. debugPrint('notification payload: $payload');
  98. }
  99. selectNotificationSubject.add(payload);
  100. });
  101. runApp(MyApp());
  102. }
  103. class MyApp extends StatelessWidget with WidgetsBindingObserver {
  104. BuildContext buildContext;
  105. StateSetter ss;
  106. List<MyShopBeanDataData> shops = [];
  107. int shopIndex = 0;
  108. String clipboardT;
  109. int amountCompleted = 0;
  110. NewOrderBeanEntity newOrder;
  111. @override
  112. StatelessElement createElement() {
  113. // TODO: implement createElement
  114. WidgetsBinding.instance.addObserver(this);
  115. MyCookie().initP();
  116. _initFluwx();
  117. EventBus().on('hasNewOrder', (arg) {
  118. newOrder = arg;
  119. displayPendingOrders();
  120. });
  121. EventBus().on('systemInformation', (arg) {
  122. if (arg is SystemInformationBeanEntity) {
  123. showSystemMessages(arg);
  124. }
  125. });
  126. EventBus().on('检查粘贴板', (arg) {
  127. Timer(Duration(seconds: 1), () {
  128. getClipboardData();
  129. checkUnpaidThirdPartyOrders();
  130. });
  131. });
  132. EventBus().on('hasCoupon', (arg) {
  133. if (arg is CouponBeanDataData) {
  134. couponBulletBox(arg);
  135. }
  136. });
  137. return super.createElement();
  138. }
  139. @override
  140. Widget build(BuildContext context) {
  141. SystemChrome.setPreferredOrientations([
  142. DeviceOrientation.portraitUp, //只能纵向
  143. DeviceOrientation.portraitDown, //只能纵向
  144. ]);
  145. return RefreshConfiguration(
  146. child: MaterialApp(
  147. navigatorKey: navigatorKey,
  148. theme: ThemeData(fontFamily: 'PingFang'),
  149. debugShowCheckedModeBanner: false,
  150. home: WelcomePage(),
  151. routes: {
  152. '/loginPage': (context) => LoginPage(),
  153. '/rootPage': (context) => RootPage(),
  154. },
  155. supportedLocales: [const Locale('zh', 'CH')],
  156. localizationsDelegates: [
  157. RefreshLocalizations.delegate,
  158. GlobalMaterialLocalizations.delegate,
  159. GlobalWidgetsLocalizations.delegate,
  160. const FallbackCupertinoLocalisationsDelegate(),
  161. ],
  162. builder: (BuildContext context, Widget child) {
  163. buildContext = context;
  164. return MediaQuery(
  165. data: MediaQuery.of(context)
  166. .copyWith(textScaleFactor: 1.0), //设置字体不随系统字体大小改变
  167. child: FlutterEasyLoading(
  168. child: child,
  169. ),
  170. );
  171. },
  172. ),
  173. hideFooterWhenNotFull: true,
  174. footerBuilder: () {
  175. return ClassicFooter(
  176. loadStyle: LoadStyle.ShowWhenLoading,
  177. );
  178. },
  179. );
  180. }
  181. @override
  182. void didChangeAppLifecycleState(AppLifecycleState state) {
  183. super.didChangeAppLifecycleState(state);
  184. if (state == AppLifecycleState.paused) {
  185. print('went to Background');
  186. }
  187. if (state == AppLifecycleState.resumed) {
  188. print('came back to Foreground');
  189. if (MyCookie().loginInformation != null) {
  190. Timer(Duration(seconds: 1), () {
  191. getClipboardData();
  192. });
  193. }
  194. checkUnpaidThirdPartyOrders();
  195. }
  196. }
  197. //获取剪切板文字
  198. Future<void> getClipboardData() async {
  199. PopUpQueue().onShow = true;
  200. ClipboardData text = await Clipboard.getData(Clipboard.kTextPlain);
  201. try {
  202. print('Clipboard-----\n${text.text}');
  203. clipboardT = text.text;
  204. Clipboard.setData(ClipboardData(text: ''));
  205. getOnlineTemplate();
  206. } catch (e) {
  207. PopUpQueue().onShow = false;
  208. PopUpQueue().showNext();
  209. }
  210. }
  211. //获取线上模板
  212. void getOnlineTemplate() {
  213. MyDio().query({
  214. 'key': 'order_template',
  215. "dims": ["id", "sid", "template"],
  216. "filters": {}
  217. }, (response, hasError) {
  218. if (!hasError) {
  219. TemplateBeanEntity entity = TemplateBeanEntity()
  220. .fromJson(json.decode(response.data.toString()));
  221. checkOrder(entity.data);
  222. } else {
  223. PopUpQueue().onShow = false;
  224. PopUpQueue().showNext();
  225. }
  226. }, (error) {
  227. PopUpQueue().onShow = false;
  228. PopUpQueue().showNext();
  229. });
  230. }
  231. var orderHash;
  232. //最大金额赢家数量 0---发送订单的人不是最大赢家 1---发订单的人是最大赢家 2---发订单的人是最大赢家且有两个一样的金额
  233. int commissionPayerNum = -1;
  234. //匹配模板去除不是自己的订单
  235. void checkOrder(List<TemplateBeanData> data) {
  236. commissionPayerNum = -1;
  237. bool hasMatch = false;
  238. w:
  239. for (int i = 0; i < data.length; i++) {
  240. try {
  241. var res = parseString2(
  242. data[i].template.replaceAll('\r', ''), '''$clipboardT''');
  243. if (res != null) {
  244. print('-----------data[i].template-----------');
  245. print(data[i].template);
  246. print(json.encode(res));
  247. var order = parse2(res);
  248. print(order.toString());
  249. var maxAmount = 0;
  250. int maxAmountNum = 0;
  251. order.forEach((element) {
  252. if (maxAmount < element.seller.amount) {
  253. maxAmount = element.seller.amount;
  254. maxAmountNum = 1;
  255. } else if (maxAmount == element.seller.amount) {
  256. maxAmountNum++;
  257. }
  258. });
  259. print('maxAmount---------$maxAmount');
  260. print('maxAmountNum---------$maxAmountNum');
  261. int meIsMaximum = order.indexWhere((element) =>
  262. element.seller.amount == maxAmount &&
  263. (element.seller.name
  264. .contains(MyCookie().loginInformation.data.extra.name) ||
  265. MyCookie()
  266. .loginInformation
  267. .data
  268. .extra
  269. .name
  270. .contains(element.seller.name)));
  271. if (meIsMaximum >= 0) {
  272. commissionPayerNum = maxAmountNum;
  273. }
  274. print('commissionPayerNum-----------$commissionPayerNum');
  275. order.removeWhere((element) =>
  276. !element.seller.name
  277. .contains(MyCookie().loginInformation.data.extra.name) &&
  278. !MyCookie()
  279. .loginInformation
  280. .data
  281. .extra
  282. .name
  283. .contains(element.seller.name));
  284. if (order.length > 0) {
  285. hasMatch = true;
  286. orderHash = computeOrderHash(res);
  287. getShop(order);
  288. }
  289. break w;
  290. }
  291. } catch (e) {}
  292. }
  293. if (!hasMatch) {
  294. PopUpQueue().onShow = false;
  295. PopUpQueue().showNext();
  296. }
  297. }
  298. //订单视图
  299. items(List<OrderInfo2> order) {
  300. List<Widget> items = [];
  301. order.forEach((element) {
  302. items.add(Container(
  303. child: Column(
  304. children: [
  305. Row(
  306. children: [
  307. Container(
  308. margin: EdgeInsets.only(left: 8, right: 7),
  309. child: ClipRRect(
  310. child: MyViews().netImg(
  311. imgURL(MyCookie().loginInformation.data.extra.picture),
  312. 35,
  313. 35),
  314. borderRadius: BorderRadius.circular(17.5),
  315. ),
  316. ),
  317. Expanded(
  318. child: Container(
  319. height: 35,
  320. child: Column(
  321. children: [
  322. Text(
  323. '付款人:${element.payer.name}',
  324. style: TextStyle(
  325. color: MyColors.c333333,
  326. fontSize: 13,
  327. decoration: TextDecoration.none,
  328. ),
  329. ),
  330. Text(
  331. '订单时间:${element.time}',
  332. style: TextStyle(
  333. color: MyColors.c666666,
  334. fontSize: 10,
  335. decoration: TextDecoration.none,
  336. ),
  337. ),
  338. ],
  339. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  340. crossAxisAlignment: CrossAxisAlignment.start,
  341. ),
  342. ),
  343. ),
  344. Container(
  345. margin: EdgeInsets.only(right: 10),
  346. child: Text(
  347. '¥${(element.payer.amount * element.factor).toStringAsFixed(2)}',
  348. style: TextStyle(
  349. color: MyColors.cFF4233,
  350. fontSize: 14,
  351. decoration: TextDecoration.none,
  352. ),
  353. ),
  354. ),
  355. ],
  356. crossAxisAlignment: CrossAxisAlignment.center,
  357. ),
  358. Container(
  359. height: 0.5,
  360. margin: EdgeInsets.only(right: 10, left: 50, top: 5),
  361. color: MyColors.cE7E7E7,
  362. )
  363. ],
  364. ),
  365. margin: EdgeInsets.only(top: 5),
  366. ));
  367. });
  368. return items;
  369. }
  370. bool saving = false;
  371. //获取用户所在店铺
  372. void getShop(List<OrderInfo2> order) {
  373. shopIndex = 0;
  374. MyDio().query({
  375. "key": "shop_user",
  376. "filters": {
  377. "or": true,
  378. "conditions": [
  379. "role!=0",
  380. "user_uid==${MyCookie().getUID()}",
  381. "review_state==1"
  382. ],
  383. "filters": [
  384. {
  385. "conditions": ["role==0", "user_uid==${MyCookie().getUID()}"]
  386. }
  387. ]
  388. },
  389. "dims": shopUserDims,
  390. "paging": [1, 20000]
  391. }, (response, hasError) {
  392. if (!hasError) {
  393. MyShopBeanEntity entity =
  394. MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
  395. shops = entity.data.data;
  396. shops.removeWhere((element) => !element.privateShop);
  397. if (shops.length == 0) {
  398. showToast('你还没有添加任何货帮,暂时不能发送智能订单');
  399. PopUpQueue().onShow = false;
  400. PopUpQueue().showNext();
  401. } else {
  402. EasyLoading.instance
  403. ..contentPadding = EdgeInsets.symmetric(horizontal: 0, vertical: 12)
  404. ..alignment = Alignment.bottomCenter
  405. ..loadingStyle = EasyLoadingStyle.light
  406. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  407. EasyLoading.show(
  408. indicator: Material(
  409. color: Colors.white,
  410. child: StatefulBuilder(
  411. builder: (c, s) {
  412. ss = s;
  413. return Column(
  414. children: [
  415. Container(
  416. child: Stack(
  417. children: [
  418. Container(
  419. child: MyViews()
  420. .myText('智能订单', MyColors.c333333, 14),
  421. alignment: Alignment.center,
  422. height: 22,
  423. ),
  424. Positioned(
  425. right: 0,
  426. child: GestureDetector(
  427. onTap: () {
  428. PopUpQueue().onShow = false;
  429. PopUpQueue().showNext();
  430. },
  431. behavior: HitTestBehavior.translucent,
  432. child: Container(
  433. child: Icon(
  434. Icons.close,
  435. size: 20,
  436. color: Colors.white,
  437. ),
  438. decoration: BoxDecoration(
  439. color: MyColors.cB6B6B6,
  440. borderRadius: BorderRadius.circular(11)),
  441. height: 22,
  442. width: 22,
  443. ),
  444. ),
  445. )
  446. ],
  447. alignment: Alignment.center,
  448. ),
  449. height: 30,
  450. padding: EdgeInsets.symmetric(horizontal: 12),
  451. ),
  452. Container(
  453. height: 5,
  454. color: MyColors.cF7F7F7,
  455. margin: EdgeInsets.only(top: 10),
  456. ),
  457. Column(
  458. children: items(order),
  459. ),
  460. Container(
  461. height: 5,
  462. color: MyColors.cF7F7F7,
  463. margin: EdgeInsets.only(top: 10),
  464. ),
  465. Visibility(
  466. child: Column(
  467. children: [
  468. Container(
  469. child: MyViews()
  470. .myText('货帮选择', MyColors.c333333, 13),
  471. margin: EdgeInsets.only(left: 7, top: 11),
  472. ),
  473. Container(
  474. margin: EdgeInsets.symmetric(
  475. horizontal: 7, vertical: 10),
  476. height: (shops.length * 1.0 / 2).ceil() *
  477. (double.parse(
  478. '${MediaQuery.of(buildContext).size.width - 74}') /
  479. 2 /
  480. 3.8 +
  481. 10) -
  482. 10,
  483. child: GridView(
  484. gridDelegate:
  485. SliverGridDelegateWithFixedCrossAxisCount(
  486. crossAxisCount: 2, //横轴三个子widget
  487. childAspectRatio: 3.8,
  488. crossAxisSpacing: 10,
  489. mainAxisSpacing: 8 //宽高比为1时,子widget
  490. ),
  491. children: shop(shops),
  492. padding: EdgeInsets.all(0),
  493. ),
  494. ),
  495. ],
  496. crossAxisAlignment: CrossAxisAlignment.start,
  497. ),
  498. visible: shops.length != 1,
  499. ),
  500. Container(
  501. height: 0.5,
  502. color: MyColors.cF7F7F7,
  503. margin: EdgeInsets.only(bottom: 10),
  504. ),
  505. Container(
  506. child: GestureDetector(
  507. onTap: () {
  508. if (saving) {
  509. return;
  510. } else {
  511. saving = true;
  512. EventBus().on('saveOrder', (arg) {
  513. amountCompleted++;
  514. if (amountCompleted == order.length) {
  515. amountCompleted = 0;
  516. EasyLoading.dismiss();
  517. showToast('发送成功');
  518. clipboardT = '';
  519. saving = false;
  520. EventBus().off('saveOrder');
  521. PopUpQueue().onShow = false;
  522. PopUpQueue().showNext();
  523. }
  524. });
  525. order.forEach((element) {
  526. sendOrder(element);
  527. });
  528. }
  529. },
  530. behavior: HitTestBehavior.translucent,
  531. child: Container(
  532. decoration: BoxDecoration(
  533. color: MyColors.cFF4233,
  534. borderRadius: BorderRadius.circular(20),
  535. ),
  536. height: 40,
  537. width: 150,
  538. child: MyViews().myText('发送订单', Colors.white, 14),
  539. alignment: Alignment.center,
  540. ),
  541. ),
  542. alignment: Alignment.center,
  543. )
  544. ],
  545. mainAxisAlignment: MainAxisAlignment.start,
  546. crossAxisAlignment: CrossAxisAlignment.start,
  547. );
  548. },
  549. ),
  550. ),
  551. );
  552. }
  553. } else {
  554. PopUpQueue().onShow = false;
  555. PopUpQueue().showNext();
  556. }
  557. }, (error) {
  558. PopUpQueue().onShow = false;
  559. PopUpQueue().showNext();
  560. });
  561. }
  562. //店铺视图
  563. shop(List<MyShopBeanDataData> shops) {
  564. List<Widget> items = [];
  565. for (int i = 0; i < shops.length; i++) {
  566. items.add(GestureDetector(
  567. onTap: () {
  568. shopIndex = i;
  569. ss(() {});
  570. },
  571. behavior: HitTestBehavior.translucent,
  572. child: Container(
  573. child: Row(
  574. children: [
  575. Container(
  576. margin: EdgeInsets.only(right: 5),
  577. child: ClipRRect(
  578. child: MyViews().netImg(imgURL(shops[i].shopPic), 30, 30),
  579. borderRadius: BorderRadius.circular(15),
  580. ),
  581. ),
  582. Expanded(
  583. child: Column(
  584. children: [
  585. Text(
  586. shops[i].shopName,
  587. style: TextStyle(
  588. color: i == shopIndex
  589. ? MyColors.cFF4233
  590. : MyColors.c666666,
  591. fontSize: 12,
  592. ),
  593. maxLines: 1,
  594. overflow: TextOverflow.ellipsis,
  595. softWrap: true,
  596. ),
  597. Text(
  598. 'ID:${shops[i].shopUid}',
  599. style: TextStyle(
  600. color: i == shopIndex
  601. ? MyColors.cFF4233
  602. : MyColors.c666666,
  603. fontSize: 10,
  604. ),
  605. maxLines: 1,
  606. overflow: TextOverflow.ellipsis,
  607. softWrap: true,
  608. ),
  609. ],
  610. crossAxisAlignment: CrossAxisAlignment.start,
  611. ),
  612. ),
  613. ],
  614. ),
  615. decoration: BoxDecoration(
  616. color: i == shopIndex ? MyColors.cFFECEB : MyColors.cEDEDED,
  617. borderRadius: BorderRadius.circular(4),
  618. ),
  619. constraints: BoxConstraints(maxWidth: 150),
  620. padding: EdgeInsets.symmetric(horizontal: 6, vertical: 6),
  621. ),
  622. ));
  623. }
  624. return items;
  625. }
  626. //发送订单
  627. void sendOrder(OrderInfo2 element) {
  628. MyDio().save({
  629. 'key': 'order',
  630. 'object': {
  631. 'uuid': orderHash,
  632. 'shop_uid': shops[shopIndex].shopUid,
  633. 'shop_pic': shops[shopIndex].shopPic,
  634. 'shop_name': shops[shopIndex].shopName,
  635. 'seller_pic': MyCookie().loginInformation.data.extra.picture,
  636. 'seller_uid': MyCookie().getUID(),
  637. 'seller_name': MyCookie().loginInformation.data.extra.name,
  638. 'buyer_name': element.payer.name,
  639. 'type': orderTypeThirdPlatform,
  640. 'amount': NumUtil.multiply(element.payer.amount, element.factor),
  641. 'commission_payer_num': commissionPayerNum
  642. }
  643. }, (response, hasError) {
  644. if (!hasError) {
  645. EventBus().emit('saveOrder');
  646. }
  647. }, (error) {});
  648. }
  649. //待支付订单视图
  650. void displayPendingOrders() {
  651. EasyLoading.instance
  652. ..contentPadding = EdgeInsets.symmetric(horizontal: 0, vertical: 12)
  653. ..alignment = Alignment.bottomCenter
  654. ..loadingStyle = EasyLoadingStyle.light
  655. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  656. EasyLoading.show(
  657. indicator: Material(
  658. color: Colors.white,
  659. child: Column(
  660. children: [
  661. Container(
  662. padding: EdgeInsets.symmetric(horizontal: 12),
  663. child: Row(
  664. children: [
  665. Container(
  666. margin: EdgeInsets.only(right: 7),
  667. child: ClipRRect(
  668. child: MyViews()
  669. .netImg(imgURL(newOrder.content.shopPic), 25, 25),
  670. borderRadius: BorderRadius.circular(12.5),
  671. ),
  672. ),
  673. MyViews().myText(
  674. '${newOrder.content.shopName}(${newOrder.content.shopUID})',
  675. MyColors.c333333,
  676. 14),
  677. ],
  678. ),
  679. ),
  680. Container(
  681. margin: EdgeInsets.only(top: 11, left: 12, right: 12, bottom: 11),
  682. height: 0.5,
  683. color: MyColors.cE7E7E7,
  684. ),
  685. Container(
  686. margin: EdgeInsets.symmetric(horizontal: 12),
  687. child: Row(
  688. children: [
  689. Container(
  690. child: SvgPicture.asset(
  691. newOrder.content.buyerPic == null
  692. ? 'images/svg/第三方.svg'
  693. : 'images/svg/线下付款.svg',
  694. height: 27,
  695. width: 27,
  696. ),
  697. margin: EdgeInsets.only(right: 8),
  698. height: 45,
  699. width: 45,
  700. decoration: BoxDecoration(
  701. border: Border.all(color: MyColors.cEBEBEB, width: 1)),
  702. alignment: Alignment.center,
  703. ),
  704. Expanded(
  705. child: Container(
  706. height: 45,
  707. child: Column(
  708. children: [
  709. MyViews().myText(
  710. newOrder.content.buyerPic == null
  711. ? '第三方订单'
  712. : '线下付款',
  713. MyColors.c333333,
  714. 13),
  715. Row(
  716. children: [
  717. MyViews().myText('¥${newOrder.content.amount}',
  718. MyColors.cFF4233, 12),
  719. MyViews().myText('x1', MyColors.c999999, 12),
  720. ],
  721. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  722. )
  723. ],
  724. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  725. crossAxisAlignment: CrossAxisAlignment.start,
  726. ),
  727. ),
  728. ),
  729. ],
  730. ),
  731. ),
  732. Container(
  733. height: 0.5,
  734. color: MyColors.cE7E7E7,
  735. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  736. ),
  737. Container(
  738. margin: EdgeInsets.symmetric(horizontal: 12),
  739. child: Row(
  740. children: [
  741. MyViews().myText('卖家信息:', MyColors.c333333, 13),
  742. Row(
  743. children: [
  744. Container(
  745. margin: EdgeInsets.only(right: 5),
  746. child: ClipRRect(
  747. child: MyViews().netImg(
  748. imgURL(newOrder.content.sellerPic), 23, 23),
  749. borderRadius: BorderRadius.circular(11.5),
  750. ),
  751. ),
  752. MyViews().myText(
  753. '${newOrder.content.sellerName}(${hideUID(newOrder.content.sellerUID.toString())})',
  754. MyColors.c333333,
  755. 13),
  756. ],
  757. )
  758. ],
  759. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  760. ),
  761. ),
  762. Container(
  763. height: 0.5,
  764. color: MyColors.cE7E7E7,
  765. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  766. ),
  767. Container(
  768. margin: EdgeInsets.symmetric(horizontal: 12),
  769. child: Row(
  770. children: [
  771. MyViews().myText('买家信息:', MyColors.c333333, 13),
  772. Row(
  773. children: [
  774. Container(
  775. margin: EdgeInsets.only(right: 5),
  776. child: ClipRRect(
  777. child: MyViews().netImg(
  778. newOrder.content.buyerPic == null
  779. ? ''
  780. : imgURL(newOrder.content.buyerPic),
  781. 23,
  782. 23),
  783. borderRadius: BorderRadius.circular(11.5),
  784. ),
  785. ),
  786. MyViews().myText(
  787. '${newOrder.content.buyerName} ${newOrder.content.buyerUID != null && newOrder.content.buyerUID.toString().length > 0 ? '(${newOrder.content.buyerUID})' : ''}',
  788. MyColors.c333333,
  789. 13),
  790. ],
  791. )
  792. ],
  793. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  794. ),
  795. ),
  796. Container(
  797. height: 0.5,
  798. color: MyColors.cE7E7E7,
  799. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  800. ),
  801. Container(
  802. margin: EdgeInsets.symmetric(horizontal: 12),
  803. child: Row(
  804. children: [
  805. MyViews().myText('下单时间:', MyColors.c333333, 13),
  806. MyViews().myText(
  807. '${newOrder.content.createTime}', MyColors.c333333, 13)
  808. ],
  809. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  810. ),
  811. ),
  812. Container(
  813. height: 0.5,
  814. color: MyColors.cE7E7E7,
  815. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  816. ),
  817. Container(
  818. margin: EdgeInsets.symmetric(horizontal: 20),
  819. child: Row(
  820. children: [
  821. Expanded(
  822. child: GestureDetector(
  823. onTap: () {
  824. PopUpQueue().onShow = false;
  825. PopUpQueue().showNext();
  826. },
  827. behavior: HitTestBehavior.translucent,
  828. child: Container(
  829. decoration: BoxDecoration(
  830. borderRadius: BorderRadius.only(
  831. topLeft: Radius.circular(20),
  832. bottomLeft: Radius.circular(20),
  833. ),
  834. border: Border.all(
  835. color: MyColors.cFF4233, width: 1)),
  836. height: 40,
  837. child: MyViews().myText('与我无瓜', MyColors.cFF4233, 14),
  838. alignment: Alignment.center),
  839. ),
  840. ),
  841. Expanded(
  842. child: GestureDetector(
  843. onTap: () {
  844. if (newOrder.content.buyerName
  845. .contains(MyCookie().getName()) ||
  846. MyCookie()
  847. .getName()
  848. .contains(newOrder.content.buyerName)) {
  849. EasyLoading.dismiss();
  850. payTheOrder();
  851. } else {
  852. showToast('该订单与你无关');
  853. PopUpQueue().onShow = false;
  854. PopUpQueue().showNext();
  855. }
  856. },
  857. behavior: HitTestBehavior.translucent,
  858. child: Container(
  859. decoration: BoxDecoration(
  860. borderRadius: BorderRadius.only(
  861. topRight: Radius.circular(20),
  862. bottomRight: Radius.circular(20),
  863. ),
  864. color: MyColors.cFF4233),
  865. height: 40,
  866. child: MyViews().myText('去支付', Colors.white, 14),
  867. alignment: Alignment.center),
  868. ),
  869. )
  870. ],
  871. ),
  872. )
  873. ],
  874. ),
  875. ),
  876. );
  877. }
  878. void payTheOrder() {
  879. //获取店铺信息
  880. MyDio().query({
  881. "key": "shop_user",
  882. "filters": {
  883. "conditions": ["shop_uid==${newOrder.content.shopUID}"]
  884. },
  885. "dims": shopUserDims,
  886. "paging": [1, 1],
  887. "order_by": ["shop_name,DESC"]
  888. }, (response, hasError) {
  889. if (!hasError) {
  890. MyShopBeanEntity entity =
  891. MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
  892. SmartOrderBeanDataData data = SmartOrderBeanDataData();
  893. data.sellerUid = newOrder.content.sellerUID;
  894. data.sellerName = newOrder.content.sellerName;
  895. data.sellerPic = newOrder.content.sellerPic;
  896. data.buyerUid = 0;
  897. data.buyerName = newOrder.content.buyerName;
  898. data.buyerPic = '';
  899. data.amount = newOrder.content.amount;
  900. data.uid = newOrder.content.uID;
  901. navigatorKey.currentState
  902. .push(MaterialPageRoute(
  903. builder: (context) => OrderInformationPage(
  904. false,
  905. orderType: orderTypeThirdPlatform,
  906. amount: newOrder.content.amount,
  907. uid: newOrder.content.uID,
  908. buyerUid: MyCookie().getUID(),
  909. buyerName: newOrder.content.buyerName,
  910. buyerPic: MyCookie().getPic(),
  911. commodityCount: 1,
  912. commodityTitle: '第三方订单',
  913. commodityCover: '',
  914. sellName: newOrder.content.sellerName,
  915. sellPic: newOrder.content.sellerPic,
  916. sellUid: newOrder.content.sellerUID,
  917. )))
  918. .then((value) {
  919. PopUpQueue().onShow = false;
  920. PopUpQueue().showNext();
  921. });
  922. // navigatorKey.currentState.push(MaterialPageRoute(
  923. // builder: (context) =>
  924. // GangInPage(entity.data.data[0], newOrder.content)));
  925. }
  926. }, (error) {});
  927. // getUserWalletBalance((re, hE) {
  928. // if (!hE) {
  929. // UserBalanceEntity balance =
  930. // UserBalanceEntity().fromJson(json.decode(re.data.toString()));
  931. // if (balance.data >= newOrder.content.amount) {
  932. // payOrder(payWayWallet, newOrder.content.uID, (re, hE) {
  933. // if (!hE) {
  934. // showToast('支付成功');
  935. // EventBus().emit('payAnOrder');
  936. // }
  937. // }, (e) {}, context);
  938. // } else {
  939. // payOrder(payWayAliPay, newOrder.content.uID, (re, hE) {
  940. // if (!hE) {
  941. // PayByAlipayBeanEntity entity = PayByAlipayBeanEntity()
  942. // .fromJson(json.decode(re.data.toString()));
  943. // EventBus().on('alipayPaymentCallback', (arg) {
  944. // EventBus().off('alipayPaymentCallback');
  945. // EasyLoading.dismiss();
  946. // showToast('支付成功');
  947. // EventBus().emit('reNoPayOrder');
  948. // });
  949. // print(entity.data);
  950. // EasyLoading.instance
  951. // ..contentPadding =
  952. // EdgeInsets.symmetric(horizontal: 20, vertical: 12)
  953. // ..alignment = Alignment.center
  954. // ..contentMargin = EdgeInsets.all(20);
  955. // EasyLoading.show();
  956. // aliPay(entity.data).then((value) {
  957. // print(json.encode(value));
  958. // AlipayResultBeanEntity e = AlipayResultBeanEntity()
  959. // .fromJson(json.decode(json.encode(value)));
  960. // try {
  961. // int r = int.parse(e.resultStatus);
  962. // if (r == 9000) {
  963. // showToast('支付成功');
  964. // } else {
  965. // showToast(aliPayResultStatus(r));
  966. // resetOrder(newOrder.content.uID, context);
  967. // }
  968. // } catch (e) {
  969. // EasyLoading.dismiss();
  970. // }
  971. // });
  972. // // EventBus().emit('payAnOrder');
  973. // }
  974. // }, (e) {}, context);
  975. // // showToast('积分余额不足');
  976. // }
  977. // }
  978. // }, (e) {}, context);
  979. }
  980. void showSystemMessages(SystemInformationBeanEntity arg) {
  981. EasyLoading.instance
  982. ..contentPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 12)
  983. ..alignment = Alignment.center
  984. ..loadingStyle = EasyLoadingStyle.custom
  985. ..backgroundColor = Colors.transparent
  986. ..indicatorColor = Colors.black
  987. ..progressColor = Colors.black
  988. ..maskColor = Colors.black
  989. ..textColor = Colors.black
  990. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  991. EasyLoading.show(
  992. indicator: Material(
  993. color: Colors.transparent,
  994. child: Container(
  995. decoration: BoxDecoration(
  996. borderRadius: BorderRadius.circular(16),
  997. ),
  998. height: MediaQuery.of(buildContext).size.height - 200,
  999. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  1000. child: Column(
  1001. children: [
  1002. Expanded(child: Container()),
  1003. Container(
  1004. decoration: BoxDecoration(
  1005. color: Colors.white,
  1006. borderRadius: BorderRadius.circular(16),
  1007. ),
  1008. child: Column(
  1009. children: [
  1010. Container(
  1011. child: Text(
  1012. '系统消息',
  1013. style: TextStyle(
  1014. color: MyColors.c333333,
  1015. fontSize: 14,
  1016. fontWeight: FontWeight.bold),
  1017. ),
  1018. margin:
  1019. EdgeInsets.symmetric(horizontal: 26, vertical: 15),
  1020. ),
  1021. Container(
  1022. child: Text(
  1023. arg.content.content,
  1024. style: TextStyle(color: MyColors.c333333, fontSize: 14),
  1025. ),
  1026. margin: EdgeInsets.symmetric(horizontal: 26),
  1027. alignment: Alignment.centerLeft,
  1028. ),
  1029. Container(
  1030. height: 0.5,
  1031. color: MyColors.cE7E7E7,
  1032. margin: EdgeInsets.only(bottom: 12, top: 12),
  1033. ),
  1034. GestureDetector(
  1035. onTap: () {
  1036. PopUpQueue().onShow = false;
  1037. PopUpQueue().showNext();
  1038. },
  1039. behavior: HitTestBehavior.translucent,
  1040. child: Container(
  1041. width: 150,
  1042. margin: EdgeInsets.only(bottom: 14),
  1043. decoration: BoxDecoration(
  1044. borderRadius: BorderRadius.circular(20),
  1045. border:
  1046. Border.all(color: MyColors.cFF4233, width: 1.1),
  1047. color: Colors.white),
  1048. child: MyViews().myText('我知道了', MyColors.cFF4233, 14),
  1049. height: 40,
  1050. alignment: Alignment.center,
  1051. ),
  1052. )
  1053. ],
  1054. ),
  1055. ),
  1056. Expanded(child: Container()),
  1057. ],
  1058. ),
  1059. alignment: Alignment.center,
  1060. ),
  1061. ),
  1062. );
  1063. }
  1064. //优惠券弹框
  1065. void couponBulletBox(CouponBeanDataData data) {
  1066. EasyLoading.instance
  1067. ..contentPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 12)
  1068. ..alignment = Alignment.center
  1069. ..loadingStyle = EasyLoadingStyle.custom
  1070. ..backgroundColor = Colors.transparent
  1071. ..indicatorColor = Colors.black
  1072. ..progressColor = Colors.black
  1073. ..maskColor = Colors.black
  1074. ..textColor = Colors.black
  1075. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  1076. EasyLoading.show(
  1077. indicator: Material(
  1078. color: Colors.transparent,
  1079. child: Stack(
  1080. children: [
  1081. Image.asset(
  1082. 'images/优惠券.png',
  1083. height: 640,
  1084. width: double.infinity,
  1085. ),
  1086. Container(
  1087. height: 640,
  1088. margin: EdgeInsets.only(top: 24),
  1089. child: Column(
  1090. children: [
  1091. Container(
  1092. margin: EdgeInsets.only(bottom: 5),
  1093. child: Text(
  1094. '抢红包啦',
  1095. style: TextStyle(
  1096. color: Colors.white,
  1097. fontSize: 24,
  1098. fontWeight: FontWeight.bold,
  1099. shadows: [
  1100. Shadow(
  1101. offset: Offset(1.0, 1.0),
  1102. blurRadius: 3.0,
  1103. color: MyColors.cDC1717,
  1104. )
  1105. ]),
  1106. ),
  1107. ),
  1108. Container(
  1109. decoration: BoxDecoration(
  1110. color: Colors.white,
  1111. borderRadius: BorderRadius.circular(8),
  1112. ),
  1113. height: 107,
  1114. width: double.infinity,
  1115. margin: EdgeInsets.symmetric(horizontal: 25, vertical: 27),
  1116. child: Column(
  1117. children: [
  1118. Text(
  1119. '平台红包大放送!',
  1120. style: TextStyle(
  1121. color: MyColors.c333333,
  1122. fontSize: 16,
  1123. fontWeight: FontWeight.bold),
  1124. ),
  1125. Text(
  1126. '立即去抢最高${data.max}元消费红包',
  1127. style: TextStyle(
  1128. color: MyColors.cFF4233,
  1129. fontSize: 14,
  1130. fontWeight: FontWeight.bold),
  1131. ),
  1132. Text(
  1133. '活动时间${data.distributeFromDate}至${data.distributeEndDate}',
  1134. style: TextStyle(
  1135. color: MyColors.c666666,
  1136. fontSize: 11,
  1137. fontWeight: FontWeight.bold),
  1138. ),
  1139. ],
  1140. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  1141. crossAxisAlignment: CrossAxisAlignment.start,
  1142. ),
  1143. padding: EdgeInsets.symmetric(horizontal: 26),
  1144. ),
  1145. Container(
  1146. margin: EdgeInsets.symmetric(horizontal: 25),
  1147. child: Row(
  1148. children: [
  1149. Expanded(
  1150. child: GestureDetector(
  1151. onTap: () {
  1152. EasyLoading.dismiss();
  1153. },
  1154. behavior: HitTestBehavior.translucent,
  1155. child: Container(
  1156. height: 34,
  1157. decoration: BoxDecoration(
  1158. borderRadius: BorderRadius.only(
  1159. topLeft: Radius.circular(17),
  1160. bottomLeft: Radius.circular(17),
  1161. ),
  1162. border: Border.all(
  1163. color: MyColors.cFFB455, width: 1),
  1164. color: Colors.white),
  1165. child: Text(
  1166. '我已参与',
  1167. style: TextStyle(
  1168. color: MyColors.cFFB455,
  1169. fontSize: 14,
  1170. ),
  1171. ),
  1172. alignment: Alignment.center,
  1173. ),
  1174. ),
  1175. ),
  1176. Expanded(
  1177. child: GestureDetector(
  1178. onTap: () {
  1179. grabACoupon(data.id);
  1180. },
  1181. behavior: HitTestBehavior.translucent,
  1182. child: Container(
  1183. height: 34,
  1184. decoration: BoxDecoration(
  1185. borderRadius: BorderRadius.only(
  1186. topRight: Radius.circular(17),
  1187. bottomRight: Radius.circular(17),
  1188. ),
  1189. color: MyColors.cFFB455),
  1190. child: Text(
  1191. '立即去抢',
  1192. style: TextStyle(
  1193. color: Colors.white,
  1194. fontSize: 14,
  1195. ),
  1196. ),
  1197. alignment: Alignment.center,
  1198. ),
  1199. ),
  1200. ),
  1201. ],
  1202. ),
  1203. )
  1204. ],
  1205. mainAxisAlignment: MainAxisAlignment.center,
  1206. ),
  1207. alignment: Alignment.center,
  1208. )
  1209. ],
  1210. ),
  1211. ),
  1212. );
  1213. }
  1214. _initFluwx() async {
  1215. await registerWxApi(
  1216. appId: AppID,
  1217. doOnAndroid: true,
  1218. doOnIOS: true,
  1219. universalLink: "https://oms.kunyueyun.com/");
  1220. var result = await isWeChatInstalled;
  1221. print("is installed $result");
  1222. weChatResponseEventHandler.listen((res) {
  1223. if (res is WeChatPaymentResponse) {
  1224. // do something here
  1225. print('res.type----${res.type}');
  1226. print('res.extData----${res.extData}');
  1227. print('res.errCode----${res.errCode}');
  1228. print('res.errStr----${res.errStr}');
  1229. print('res.isSuccessful----${res.isSuccessful}');
  1230. EventBus().emit('WeChatPaymentResponse', res.isSuccessful);
  1231. }
  1232. if (res is WeChatAuthResponse) {
  1233. print('res.type----${res.type}');
  1234. print('res.country----${res.country}');
  1235. print('res.lang----${res.lang}');
  1236. print('res.code----${res.code}');
  1237. print('res.state----${res.state}');
  1238. print(
  1239. 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=$AppID&secret=$AppSecret&code=${res.code}&grant_type=authorization_code');
  1240. Dio()
  1241. .get(
  1242. 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=$AppID&secret=$AppSecret&code=${res.code}&grant_type=authorization_code')
  1243. .then((value) {
  1244. print(value);
  1245. getWeChatInfo(value);
  1246. });
  1247. }
  1248. });
  1249. }
  1250. //获取微信用户信息
  1251. void getWeChatInfo(Response value) {
  1252. AccessBeanEntity accessBeanEntity =
  1253. AccessBeanEntity().fromJson(json.decode(value.toString()));
  1254. Dio()
  1255. .get(
  1256. 'https://api.weixin.qq.com/sns/userinfo?access_token=${accessBeanEntity.accessToken}&openid=${accessBeanEntity.openid}')
  1257. .then((value) {
  1258. print(value);
  1259. try {
  1260. WXBeanEntity entity =
  1261. WXBeanEntity().fromJson(json.decode(value.toString()));
  1262. saveWXInfo(entity);
  1263. } catch (e) {}
  1264. });
  1265. }
  1266. void saveWXInfo(WXBeanEntity entity) {
  1267. MyDio().update({
  1268. "key": "user",
  1269. "values": {
  1270. "id": MyCookie().loginInformation.data.extra.id,
  1271. "wx_picture": entity.headimgurl,
  1272. "wx_name": entity.nickname,
  1273. "wx_openid": entity.openid
  1274. }
  1275. }, (response, hasError) {
  1276. if (!hasError) {
  1277. MyCookie().userBean.wxOpenid = entity.openid;
  1278. MyCookie().userBean.wxName = entity.nickname;
  1279. MyCookie().userBean.wxPicture = entity.headimgurl;
  1280. EventBus().emit('bindToWeChat');
  1281. }
  1282. }, (error) {});
  1283. }
  1284. }
  1285. class FallbackCupertinoLocalisationsDelegate
  1286. extends LocalizationsDelegate<CupertinoLocalizations> {
  1287. const FallbackCupertinoLocalisationsDelegate();
  1288. @override
  1289. bool isSupported(Locale locale) => true;
  1290. @override
  1291. Future<CupertinoLocalizations> load(Locale locale) =>
  1292. DefaultCupertinoLocalizations.load(locale);
  1293. @override
  1294. bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => false;
  1295. }