Commit 99571208425260b87bbed884352035b3ee608e5d
1 parent
a4d8eaa2
feat:弹窗
Showing
3 changed files
with
236 additions
and
6 deletions
ios/Runner.xcodeproj/project.pbxproj
| ... | ... | @@ -495,7 +495,7 @@ |
| 495 | 495 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 496 | 496 | CLANG_ENABLE_MODULES = YES; |
| 497 | 497 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 498 | - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | |
| 498 | + CURRENT_PROJECT_VERSION = 2; | |
| 499 | 499 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
| 500 | 500 | ENABLE_BITCODE = NO; |
| 501 | 501 | INFOPLIST_FILE = Runner/Info.plist; |
| ... | ... | @@ -511,7 +511,7 @@ |
| 511 | 511 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; |
| 512 | 512 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; |
| 513 | 513 | SWIFT_VERSION = 5.0; |
| 514 | - TARGETED_DEVICE_FAMILY = "1,2"; | |
| 514 | + TARGETED_DEVICE_FAMILY = 1; | |
| 515 | 515 | VERSIONING_SYSTEM = "apple-generic"; |
| 516 | 516 | }; |
| 517 | 517 | name = Profile; |
| ... | ... | @@ -680,7 +680,7 @@ |
| 680 | 680 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 681 | 681 | CLANG_ENABLE_MODULES = YES; |
| 682 | 682 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 683 | - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | |
| 683 | + CURRENT_PROJECT_VERSION = 2; | |
| 684 | 684 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
| 685 | 685 | ENABLE_BITCODE = NO; |
| 686 | 686 | INFOPLIST_FILE = Runner/Info.plist; |
| ... | ... | @@ -697,7 +697,7 @@ |
| 697 | 697 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; |
| 698 | 698 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; |
| 699 | 699 | SWIFT_VERSION = 5.0; |
| 700 | - TARGETED_DEVICE_FAMILY = "1,2"; | |
| 700 | + TARGETED_DEVICE_FAMILY = 1; | |
| 701 | 701 | VERSIONING_SYSTEM = "apple-generic"; |
| 702 | 702 | }; |
| 703 | 703 | name = Debug; |
| ... | ... | @@ -709,7 +709,7 @@ |
| 709 | 709 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 710 | 710 | CLANG_ENABLE_MODULES = YES; |
| 711 | 711 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 712 | - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | |
| 712 | + CURRENT_PROJECT_VERSION = 2; | |
| 713 | 713 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
| 714 | 714 | ENABLE_BITCODE = NO; |
| 715 | 715 | INFOPLIST_FILE = Runner/Info.plist; |
| ... | ... | @@ -725,7 +725,7 @@ |
| 725 | 725 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; |
| 726 | 726 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; |
| 727 | 727 | SWIFT_VERSION = 5.0; |
| 728 | - TARGETED_DEVICE_FAMILY = "1,2"; | |
| 728 | + TARGETED_DEVICE_FAMILY = 1; | |
| 729 | 729 | VERSIONING_SYSTEM = "apple-generic"; |
| 730 | 730 | }; |
| 731 | 731 | name = Release; | ... | ... |
lib/common/dialogs/customer_dialog.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | |
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
| 3 | + | |
| 4 | +class CustomerTwoActionDialog extends Dialog { | |
| 5 | + const CustomerTwoActionDialog( | |
| 6 | + this.title, | |
| 7 | + this.leftTitle, | |
| 8 | + this.rightTitle, | |
| 9 | + this.content, | |
| 10 | + this.leftTap, | |
| 11 | + this.rightTap, {super.key}); | |
| 12 | + final String title; | |
| 13 | + final String leftTitle; | |
| 14 | + final String rightTitle; | |
| 15 | + final String content; | |
| 16 | + final GestureTapCallback leftTap; | |
| 17 | + final GestureTapCallback rightTap; | |
| 18 | + | |
| 19 | + @override | |
| 20 | + Widget build(BuildContext context) { | |
| 21 | + super.build(context); | |
| 22 | + return Container( | |
| 23 | + height: 238.h, | |
| 24 | + alignment: Alignment.center, | |
| 25 | + child: ConstrainedBox( | |
| 26 | + constraints: BoxConstraints( | |
| 27 | + maxHeight: 238.h, | |
| 28 | + maxWidth: 407.w | |
| 29 | + ), | |
| 30 | + child: Container( | |
| 31 | + padding: EdgeInsets.symmetric(horizontal: 24.w,vertical: 15.h), | |
| 32 | + decoration: BoxDecoration( | |
| 33 | + color: Colors.white, | |
| 34 | + border: Border.all( | |
| 35 | + color: const Color(0xFF333333), | |
| 36 | + width: 1.5 | |
| 37 | + ), | |
| 38 | + borderRadius: BorderRadius.circular(10.r) | |
| 39 | + ), | |
| 40 | + child: Column( | |
| 41 | + children: [ | |
| 42 | + Text( | |
| 43 | + title, | |
| 44 | + textAlign: TextAlign.center, | |
| 45 | + style: TextStyle( | |
| 46 | + fontSize: 21.sp, | |
| 47 | + color: const Color(0xFF333333) | |
| 48 | + ), | |
| 49 | + ), | |
| 50 | + Expanded( | |
| 51 | + child: Text( | |
| 52 | + content, | |
| 53 | + textAlign: TextAlign.left, | |
| 54 | + style: TextStyle( | |
| 55 | + color: const Color(0xFF333333), | |
| 56 | + fontSize: 13.sp | |
| 57 | + ) | |
| 58 | + ), | |
| 59 | + ), | |
| 60 | + Row( | |
| 61 | + mainAxisAlignment: MainAxisAlignment.center, | |
| 62 | + children: [ | |
| 63 | + TextButton( | |
| 64 | + onPressed: leftTap, | |
| 65 | + child: Container( | |
| 66 | + height: 31.h, | |
| 67 | + padding: EdgeInsets.symmetric( | |
| 68 | + horizontal: 6.w | |
| 69 | + ), | |
| 70 | + decoration: BoxDecoration( | |
| 71 | + color: const Color(0xFFFBB661), | |
| 72 | + border: Border.all( | |
| 73 | + color: const Color(0xFF333333), | |
| 74 | + width: 1.5 | |
| 75 | + ), | |
| 76 | + borderRadius: BorderRadius.circular(10.r) | |
| 77 | + ), | |
| 78 | + child: Text( | |
| 79 | + leftTitle, | |
| 80 | + textAlign: TextAlign.center, | |
| 81 | + style: TextStyle( | |
| 82 | + color: Colors.white, | |
| 83 | + fontSize: 19.sp | |
| 84 | + ),), | |
| 85 | + )), | |
| 86 | + 27.horizontalSpace, | |
| 87 | + TextButton( | |
| 88 | + onPressed: rightTap, | |
| 89 | + child: Container( | |
| 90 | + height: 31.h, | |
| 91 | + decoration: BoxDecoration( | |
| 92 | + color: Colors.white, | |
| 93 | + border: Border.all( | |
| 94 | + color: const Color(0xFF333333), | |
| 95 | + width: 1.0 | |
| 96 | + ), | |
| 97 | + borderRadius: BorderRadius.circular(10.r) | |
| 98 | + ), | |
| 99 | + padding: EdgeInsets.symmetric( | |
| 100 | + horizontal: 6.w | |
| 101 | + ), | |
| 102 | + child: Text( | |
| 103 | + rightTitle, | |
| 104 | + textAlign: TextAlign.center, | |
| 105 | + style: TextStyle( | |
| 106 | + color: const Color(0xFF333333), | |
| 107 | + fontSize: 19.sp | |
| 108 | + ),), | |
| 109 | + )) | |
| 110 | + ], | |
| 111 | + ) | |
| 112 | + ], | |
| 113 | + ), | |
| 114 | + ), | |
| 115 | + ), | |
| 116 | + ); | |
| 117 | + } | |
| 118 | +} | |
| 119 | + | |
| 120 | +class CustomerOneActionDialog extends Dialog { | |
| 121 | + const CustomerOneActionDialog(this.title, this.ensureTitle, this.content, this.ensureTap, {super.key}); | |
| 122 | + final String title; | |
| 123 | + final String ensureTitle; | |
| 124 | + final String content; | |
| 125 | + final GestureTapCallback ensureTap; | |
| 126 | + | |
| 127 | + @override | |
| 128 | + Widget build(BuildContext context) { | |
| 129 | + super.build(context); | |
| 130 | + return Container( | |
| 131 | + alignment: Alignment.center, | |
| 132 | + child: ConstrainedBox( | |
| 133 | + constraints: BoxConstraints( | |
| 134 | + maxHeight: 238.h, | |
| 135 | + maxWidth: 407.w | |
| 136 | + ), | |
| 137 | + child: Container( | |
| 138 | + padding: EdgeInsets.symmetric(horizontal: 24.w,vertical: 15.h), | |
| 139 | + decoration: BoxDecoration( | |
| 140 | + color: Colors.white, | |
| 141 | + border: Border.all( | |
| 142 | + color: const Color(0xFF333333), | |
| 143 | + width: 1.5 | |
| 144 | + ), | |
| 145 | + borderRadius: BorderRadius.circular(10.r) | |
| 146 | + ), | |
| 147 | + child: Column( | |
| 148 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
| 149 | + children: [ | |
| 150 | + Text( | |
| 151 | + title, | |
| 152 | + textAlign: TextAlign.center, | |
| 153 | + style: TextStyle( | |
| 154 | + fontSize: 21.sp, | |
| 155 | + color: const Color(0xFF333333) | |
| 156 | + ), | |
| 157 | + ), | |
| 158 | + Text( | |
| 159 | + content, | |
| 160 | + textAlign: TextAlign.left, | |
| 161 | + style: TextStyle( | |
| 162 | + color: const Color(0xFF333333), | |
| 163 | + fontSize: 13.sp | |
| 164 | + ) | |
| 165 | + ), | |
| 166 | + TextButton( | |
| 167 | + onPressed: ensureTap, | |
| 168 | + child: Container( | |
| 169 | + height: 31.h, | |
| 170 | + decoration: BoxDecoration( | |
| 171 | + color: Colors.white, | |
| 172 | + border: Border.all( | |
| 173 | + color: const Color(0xFF333333), | |
| 174 | + width: 1.0 | |
| 175 | + ), | |
| 176 | + borderRadius: BorderRadius.circular(10.r) | |
| 177 | + ), | |
| 178 | + padding: EdgeInsets.symmetric( | |
| 179 | + horizontal: 6.w | |
| 180 | + ), | |
| 181 | + child: Text( | |
| 182 | + ensureTitle, | |
| 183 | + textAlign: TextAlign.center, | |
| 184 | + style: TextStyle( | |
| 185 | + color: const Color(0xFF333333), | |
| 186 | + fontSize: 19.sp | |
| 187 | + ),), | |
| 188 | + )) | |
| 189 | + ], | |
| 190 | + ), | |
| 191 | + ), | |
| 192 | + ), | |
| 193 | + ); | |
| 194 | + } | |
| 195 | +} | |
| 0 | 196 | \ No newline at end of file | ... | ... |
lib/common/dialogs/show_dialog.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | |
| 2 | +import 'package:wow_english/route/route.dart'; | |
| 3 | + | |
| 4 | +import 'customer_dialog.dart'; | |
| 5 | + | |
| 6 | +void showOneActionDialog( | |
| 7 | + String title, | |
| 8 | + String ensureTitle, | |
| 9 | + String content, | |
| 10 | + GestureTapCallback ensureTap,{ | |
| 11 | + bool? barrierDismissible | |
| 12 | + }) { | |
| 13 | + showDialog<CustomerOneActionDialog>( | |
| 14 | + context: AppRouter.context, | |
| 15 | + barrierDismissible: barrierDismissible??true, | |
| 16 | + builder: (BuildContext context){ | |
| 17 | + return CustomerOneActionDialog(title, ensureTitle, content, ensureTap); | |
| 18 | + }); | |
| 19 | +} | |
| 20 | + | |
| 21 | +void showTwoActionDialog( | |
| 22 | + String title, | |
| 23 | + String leftTitle, | |
| 24 | + String rightTitle, | |
| 25 | + String content, | |
| 26 | + GestureTapCallback leftTap, | |
| 27 | + GestureTapCallback rightTap,{ | |
| 28 | + bool? barrierDismissible | |
| 29 | + }) { | |
| 30 | + showDialog<CustomerTwoActionDialog>( | |
| 31 | + context: AppRouter.context, | |
| 32 | + builder: (BuildContext context){ | |
| 33 | + return CustomerTwoActionDialog(title,leftTitle,rightTitle,content,leftTap,rightTap); | |
| 34 | + }); | |
| 35 | +} | |
| 0 | 36 | \ No newline at end of file | ... | ... |