Showing
3 changed files
with
61 additions
and
42 deletions
| ... | @@ -10,6 +10,10 @@ import 'package:Parlando/widgets/my_button.dart'; | ... | @@ -10,6 +10,10 @@ import 'package:Parlando/widgets/my_button.dart'; |
| 10 | import 'package:Parlando/widgets/my_scroll_view.dart'; | 10 | import 'package:Parlando/widgets/my_scroll_view.dart'; |
| 11 | 11 | ||
| 12 | import 'package:Parlando/extension/int_extension.dart'; | 12 | import 'package:Parlando/extension/int_extension.dart'; |
| 13 | +import 'package:getwidget/components/loader/gf_loader.dart'; | ||
| 14 | + | ||
| 15 | +import '../../net/dio_utils.dart'; | ||
| 16 | +import '../../net/http_api.dart'; | ||
| 13 | 17 | ||
| 14 | class UpdatePasswordPage extends StatefulWidget { | 18 | class UpdatePasswordPage extends StatefulWidget { |
| 15 | const UpdatePasswordPage({Key? key}) : super(key: key); | 19 | const UpdatePasswordPage({Key? key}) : super(key: key); |
| ... | @@ -26,6 +30,7 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> | ... | @@ -26,6 +30,7 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> |
| 26 | final FocusNode _nodeText1 = FocusNode(); | 30 | final FocusNode _nodeText1 = FocusNode(); |
| 27 | final FocusNode _nodeText2 = FocusNode(); | 31 | final FocusNode _nodeText2 = FocusNode(); |
| 28 | bool _clickable = false; | 32 | bool _clickable = false; |
| 33 | + bool _isLoading = false; | ||
| 29 | 34 | ||
| 30 | @override | 35 | @override |
| 31 | Map<ChangeNotifier, List<VoidCallback>?>? changeNotifier() { | 36 | Map<ChangeNotifier, List<VoidCallback>?>? changeNotifier() { |
| ... | @@ -56,8 +61,25 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> | ... | @@ -56,8 +61,25 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> |
| 56 | } | 61 | } |
| 57 | 62 | ||
| 58 | void _confirm() { | 63 | void _confirm() { |
| 59 | - Toast.show('修改成功!'); | 64 | + _isLoading = true; |
| 60 | - NavigatorUtils.goBack(context); | 65 | + Map<String, String> params = <String, String>{ |
| 66 | + "password": _newPwdController.text, | ||
| 67 | + "password_confirmation": _newPwdController.text, | ||
| 68 | + }; | ||
| 69 | + DioUtils.instance.asyncRequestNetwork( | ||
| 70 | + Method.post, | ||
| 71 | + HttpApi.changePassword, | ||
| 72 | + params: params, | ||
| 73 | + onSuccess: (data) { | ||
| 74 | + _isLoading = false; | ||
| 75 | + NavigatorUtils.goBack(context); | ||
| 76 | + }, | ||
| 77 | + onError: (code, msg) { | ||
| 78 | + _isLoading = false; | ||
| 79 | + Toast.show(msg.toString()); | ||
| 80 | + setState(() {}); | ||
| 81 | + }, | ||
| 82 | + ); | ||
| 61 | } | 83 | } |
| 62 | 84 | ||
| 63 | @override | 85 | @override |
| ... | @@ -76,7 +98,7 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> | ... | @@ -76,7 +98,7 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> |
| 76 | ), | 98 | ), |
| 77 | Gaps.vGap8, | 99 | Gaps.vGap8, |
| 78 | Text( | 100 | Text( |
| 79 | - '设置账号 15000000000', | 101 | + ' ', |
| 80 | style: Theme.of(context) | 102 | style: Theme.of(context) |
| 81 | .textTheme | 103 | .textTheme |
| 82 | .subtitle2 | 104 | .subtitle2 |
| ... | @@ -102,7 +124,10 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> | ... | @@ -102,7 +124,10 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> |
| 102 | MyButton( | 124 | MyButton( |
| 103 | onPressed: _clickable ? _confirm : null, | 125 | onPressed: _clickable ? _confirm : null, |
| 104 | text: '确认', | 126 | text: '确认', |
| 105 | - ) | 127 | + ), |
| 128 | + Container( | ||
| 129 | + child: _isLoading ? const GFLoader() : null, | ||
| 130 | + ), | ||
| 106 | ], | 131 | ], |
| 107 | ), | 132 | ), |
| 108 | ); | 133 | ); | ... | ... |
| ... | @@ -7,6 +7,7 @@ class HttpApi { | ... | @@ -7,6 +7,7 @@ class HttpApi { |
| 7 | static const String uploadVideo = 'upload/video'; | 7 | static const String uploadVideo = 'upload/video'; |
| 8 | static const String uploadImage = 'upload/image'; | 8 | static const String uploadImage = 'upload/image'; |
| 9 | static const String immersive = 'immersive'; | 9 | static const String immersive = 'immersive'; |
| 10 | + static const String changePassword = 'user/changePassword'; | ||
| 10 | static const String avatar = 'avatar'; | 11 | static const String avatar = 'avatar'; |
| 11 | static const String user = 'user'; | 12 | static const String user = 'user'; |
| 12 | static const String membership = 'membership'; | 13 | static const String membership = 'membership'; | ... | ... |
| ... | @@ -112,21 +112,21 @@ packages: | ... | @@ -112,21 +112,21 @@ packages: |
| 112 | name: cached_network_image | 112 | name: cached_network_image |
| 113 | url: "https://pub.flutter-io.cn" | 113 | url: "https://pub.flutter-io.cn" |
| 114 | source: hosted | 114 | source: hosted |
| 115 | - version: "3.2.1" | 115 | + version: "3.2.3" |
| 116 | cached_network_image_platform_interface: | 116 | cached_network_image_platform_interface: |
| 117 | dependency: transitive | 117 | dependency: transitive |
| 118 | description: | 118 | description: |
| 119 | name: cached_network_image_platform_interface | 119 | name: cached_network_image_platform_interface |
| 120 | url: "https://pub.flutter-io.cn" | 120 | url: "https://pub.flutter-io.cn" |
| 121 | source: hosted | 121 | source: hosted |
| 122 | - version: "1.0.0" | 122 | + version: "2.0.0" |
| 123 | cached_network_image_web: | 123 | cached_network_image_web: |
| 124 | dependency: transitive | 124 | dependency: transitive |
| 125 | description: | 125 | description: |
| 126 | name: cached_network_image_web | 126 | name: cached_network_image_web |
| 127 | url: "https://pub.flutter-io.cn" | 127 | url: "https://pub.flutter-io.cn" |
| 128 | source: hosted | 128 | source: hosted |
| 129 | - version: "1.0.1" | 129 | + version: "1.0.2" |
| 130 | camera: | 130 | camera: |
| 131 | dependency: "direct main" | 131 | dependency: "direct main" |
| 132 | description: | 132 | description: |
| ... | @@ -147,7 +147,7 @@ packages: | ... | @@ -147,7 +147,7 @@ packages: |
| 147 | name: camera_avfoundation | 147 | name: camera_avfoundation |
| 148 | url: "https://pub.flutter-io.cn" | 148 | url: "https://pub.flutter-io.cn" |
| 149 | source: hosted | 149 | source: hosted |
| 150 | - version: "0.9.9" | 150 | + version: "0.9.10" |
| 151 | camera_platform_interface: | 151 | camera_platform_interface: |
| 152 | dependency: transitive | 152 | dependency: transitive |
| 153 | description: | 153 | description: |
| ... | @@ -175,7 +175,7 @@ packages: | ... | @@ -175,7 +175,7 @@ packages: |
| 175 | name: checked_yaml | 175 | name: checked_yaml |
| 176 | url: "https://pub.flutter-io.cn" | 176 | url: "https://pub.flutter-io.cn" |
| 177 | source: hosted | 177 | source: hosted |
| 178 | - version: "2.0.1" | 178 | + version: "2.0.2" |
| 179 | chewie: | 179 | chewie: |
| 180 | dependency: "direct main" | 180 | dependency: "direct main" |
| 181 | description: | 181 | description: |
| ... | @@ -196,7 +196,7 @@ packages: | ... | @@ -196,7 +196,7 @@ packages: |
| 196 | name: code_builder | 196 | name: code_builder |
| 197 | url: "https://pub.flutter-io.cn" | 197 | url: "https://pub.flutter-io.cn" |
| 198 | source: hosted | 198 | source: hosted |
| 199 | - version: "4.3.0" | 199 | + version: "4.4.0" |
| 200 | collection: | 200 | collection: |
| 201 | dependency: transitive | 201 | dependency: transitive |
| 202 | description: | 202 | description: |
| ... | @@ -217,7 +217,7 @@ packages: | ... | @@ -217,7 +217,7 @@ packages: |
| 217 | name: convert | 217 | name: convert |
| 218 | url: "https://pub.flutter-io.cn" | 218 | url: "https://pub.flutter-io.cn" |
| 219 | source: hosted | 219 | source: hosted |
| 220 | - version: "3.1.0" | 220 | + version: "3.1.1" |
| 221 | coverage: | 221 | coverage: |
| 222 | dependency: transitive | 222 | dependency: transitive |
| 223 | description: | 223 | description: |
| ... | @@ -336,7 +336,7 @@ packages: | ... | @@ -336,7 +336,7 @@ packages: |
| 336 | name: facebook_auth_desktop | 336 | name: facebook_auth_desktop |
| 337 | url: "https://pub.flutter-io.cn" | 337 | url: "https://pub.flutter-io.cn" |
| 338 | source: hosted | 338 | source: hosted |
| 339 | - version: "0.0.7" | 339 | + version: "0.0.8" |
| 340 | fake_async: | 340 | fake_async: |
| 341 | dependency: transitive | 341 | dependency: transitive |
| 342 | description: | 342 | description: |
| ... | @@ -430,7 +430,7 @@ packages: | ... | @@ -430,7 +430,7 @@ packages: |
| 430 | name: flutter_facebook_auth | 430 | name: flutter_facebook_auth |
| 431 | url: "https://pub.flutter-io.cn" | 431 | url: "https://pub.flutter-io.cn" |
| 432 | source: hosted | 432 | source: hosted |
| 433 | - version: "5.0.6" | 433 | + version: "5.0.7" |
| 434 | flutter_facebook_auth_platform_interface: | 434 | flutter_facebook_auth_platform_interface: |
| 435 | dependency: transitive | 435 | dependency: transitive |
| 436 | description: | 436 | description: |
| ... | @@ -477,7 +477,7 @@ packages: | ... | @@ -477,7 +477,7 @@ packages: |
| 477 | name: flutter_native_splash | 477 | name: flutter_native_splash |
| 478 | url: "https://pub.flutter-io.cn" | 478 | url: "https://pub.flutter-io.cn" |
| 479 | source: hosted | 479 | source: hosted |
| 480 | - version: "2.2.9" | 480 | + version: "2.2.16" |
| 481 | flutter_plugin_android_lifecycle: | 481 | flutter_plugin_android_lifecycle: |
| 482 | dependency: transitive | 482 | dependency: transitive |
| 483 | description: | 483 | description: |
| ... | @@ -491,7 +491,7 @@ packages: | ... | @@ -491,7 +491,7 @@ packages: |
| 491 | name: flutter_secure_storage | 491 | name: flutter_secure_storage |
| 492 | url: "https://pub.flutter-io.cn" | 492 | url: "https://pub.flutter-io.cn" |
| 493 | source: hosted | 493 | source: hosted |
| 494 | - version: "6.1.0" | 494 | + version: "7.0.1" |
| 495 | flutter_secure_storage_linux: | 495 | flutter_secure_storage_linux: |
| 496 | dependency: transitive | 496 | dependency: transitive |
| 497 | description: | 497 | description: |
| ... | @@ -505,7 +505,7 @@ packages: | ... | @@ -505,7 +505,7 @@ packages: |
| 505 | name: flutter_secure_storage_macos | 505 | name: flutter_secure_storage_macos |
| 506 | url: "https://pub.flutter-io.cn" | 506 | url: "https://pub.flutter-io.cn" |
| 507 | source: hosted | 507 | source: hosted |
| 508 | - version: "1.1.2" | 508 | + version: "2.0.1" |
| 509 | flutter_secure_storage_platform_interface: | 509 | flutter_secure_storage_platform_interface: |
| 510 | dependency: transitive | 510 | dependency: transitive |
| 511 | description: | 511 | description: |
| ... | @@ -632,7 +632,7 @@ packages: | ... | @@ -632,7 +632,7 @@ packages: |
| 632 | name: google_maps_flutter | 632 | name: google_maps_flutter |
| 633 | url: "https://pub.flutter-io.cn" | 633 | url: "https://pub.flutter-io.cn" |
| 634 | source: hosted | 634 | source: hosted |
| 635 | - version: "2.2.2" | 635 | + version: "2.2.3" |
| 636 | google_maps_flutter_android: | 636 | google_maps_flutter_android: |
| 637 | dependency: transitive | 637 | dependency: transitive |
| 638 | description: | 638 | description: |
| ... | @@ -695,7 +695,7 @@ packages: | ... | @@ -695,7 +695,7 @@ packages: |
| 695 | name: image | 695 | name: image |
| 696 | url: "https://pub.flutter-io.cn" | 696 | url: "https://pub.flutter-io.cn" |
| 697 | source: hosted | 697 | source: hosted |
| 698 | - version: "3.2.2" | 698 | + version: "3.3.0" |
| 699 | image_cropper: | 699 | image_cropper: |
| 700 | dependency: "direct main" | 700 | dependency: "direct main" |
| 701 | description: | 701 | description: |
| ... | @@ -737,7 +737,7 @@ packages: | ... | @@ -737,7 +737,7 @@ packages: |
| 737 | name: image_picker_android | 737 | name: image_picker_android |
| 738 | url: "https://pub.flutter-io.cn" | 738 | url: "https://pub.flutter-io.cn" |
| 739 | source: hosted | 739 | source: hosted |
| 740 | - version: "0.8.5+3" | 740 | + version: "0.8.5+4" |
| 741 | image_picker_for_web: | 741 | image_picker_for_web: |
| 742 | dependency: transitive | 742 | dependency: transitive |
| 743 | description: | 743 | description: |
| ... | @@ -751,7 +751,7 @@ packages: | ... | @@ -751,7 +751,7 @@ packages: |
| 751 | name: image_picker_ios | 751 | name: image_picker_ios |
| 752 | url: "https://pub.flutter-io.cn" | 752 | url: "https://pub.flutter-io.cn" |
| 753 | source: hosted | 753 | source: hosted |
| 754 | - version: "0.8.6+1" | 754 | + version: "0.8.6+5" |
| 755 | image_picker_platform_interface: | 755 | image_picker_platform_interface: |
| 756 | dependency: transitive | 756 | dependency: transitive |
| 757 | description: | 757 | description: |
| ... | @@ -765,7 +765,7 @@ packages: | ... | @@ -765,7 +765,7 @@ packages: |
| 765 | name: in_app_purchase | 765 | name: in_app_purchase |
| 766 | url: "https://pub.flutter-io.cn" | 766 | url: "https://pub.flutter-io.cn" |
| 767 | source: hosted | 767 | source: hosted |
| 768 | - version: "3.0.8" | 768 | + version: "3.1.1" |
| 769 | in_app_purchase_android: | 769 | in_app_purchase_android: |
| 770 | dependency: transitive | 770 | dependency: transitive |
| 771 | description: | 771 | description: |
| ... | @@ -841,13 +841,6 @@ packages: | ... | @@ -841,13 +841,6 @@ packages: |
| 841 | url: "https://pub.flutter-io.cn" | 841 | url: "https://pub.flutter-io.cn" |
| 842 | source: hosted | 842 | source: hosted |
| 843 | version: "4.1.0" | 843 | version: "4.1.0" |
| 844 | - lint: | ||
| 845 | - dependency: transitive | ||
| 846 | - description: | ||
| 847 | - name: lint | ||
| 848 | - url: "https://pub.flutter-io.cn" | ||
| 849 | - source: hosted | ||
| 850 | - version: "1.10.0" | ||
| 851 | lints: | 844 | lints: |
| 852 | dependency: transitive | 845 | dependency: transitive |
| 853 | description: | 846 | description: |
| ... | @@ -1064,7 +1057,7 @@ packages: | ... | @@ -1064,7 +1057,7 @@ packages: |
| 1064 | name: petitparser | 1057 | name: petitparser |
| 1065 | url: "https://pub.flutter-io.cn" | 1058 | url: "https://pub.flutter-io.cn" |
| 1066 | source: hosted | 1059 | source: hosted |
| 1067 | - version: "5.0.0" | 1060 | + version: "5.1.0" |
| 1068 | platform: | 1061 | platform: |
| 1069 | dependency: transitive | 1062 | dependency: transitive |
| 1070 | description: | 1063 | description: |
| ... | @@ -1148,7 +1141,7 @@ packages: | ... | @@ -1148,7 +1141,7 @@ packages: |
| 1148 | name: quiver | 1141 | name: quiver |
| 1149 | url: "https://pub.flutter-io.cn" | 1142 | url: "https://pub.flutter-io.cn" |
| 1150 | source: hosted | 1143 | source: hosted |
| 1151 | - version: "3.1.0" | 1144 | + version: "3.2.1" |
| 1152 | rational: | 1145 | rational: |
| 1153 | dependency: transitive | 1146 | dependency: transitive |
| 1154 | description: | 1147 | description: |
| ... | @@ -1253,7 +1246,7 @@ packages: | ... | @@ -1253,7 +1246,7 @@ packages: |
| 1253 | name: shared_preferences_macos | 1246 | name: shared_preferences_macos |
| 1254 | url: "https://pub.flutter-io.cn" | 1247 | url: "https://pub.flutter-io.cn" |
| 1255 | source: hosted | 1248 | source: hosted |
| 1256 | - version: "2.0.4" | 1249 | + version: "2.0.5" |
| 1257 | shared_preferences_platform_interface: | 1250 | shared_preferences_platform_interface: |
| 1258 | dependency: transitive | 1251 | dependency: transitive |
| 1259 | description: | 1252 | description: |
| ... | @@ -1309,7 +1302,7 @@ packages: | ... | @@ -1309,7 +1302,7 @@ packages: |
| 1309 | name: sign_in_with_apple | 1302 | name: sign_in_with_apple |
| 1310 | url: "https://pub.flutter-io.cn" | 1303 | url: "https://pub.flutter-io.cn" |
| 1311 | source: hosted | 1304 | source: hosted |
| 1312 | - version: "4.2.0" | 1305 | + version: "4.3.0" |
| 1313 | sign_in_with_apple_platform_interface: | 1306 | sign_in_with_apple_platform_interface: |
| 1314 | dependency: transitive | 1307 | dependency: transitive |
| 1315 | description: | 1308 | description: |
| ... | @@ -1356,7 +1349,7 @@ packages: | ... | @@ -1356,7 +1349,7 @@ packages: |
| 1356 | name: source_maps | 1349 | name: source_maps |
| 1357 | url: "https://pub.flutter-io.cn" | 1350 | url: "https://pub.flutter-io.cn" |
| 1358 | source: hosted | 1351 | source: hosted |
| 1359 | - version: "0.10.10" | 1352 | + version: "0.10.11" |
| 1360 | source_span: | 1353 | source_span: |
| 1361 | dependency: transitive | 1354 | dependency: transitive |
| 1362 | description: | 1355 | description: |
| ... | @@ -1384,14 +1377,14 @@ packages: | ... | @@ -1384,14 +1377,14 @@ packages: |
| 1384 | name: sqflite | 1377 | name: sqflite |
| 1385 | url: "https://pub.flutter-io.cn" | 1378 | url: "https://pub.flutter-io.cn" |
| 1386 | source: hosted | 1379 | source: hosted |
| 1387 | - version: "2.0.3+1" | 1380 | + version: "2.2.2" |
| 1388 | sqflite_common: | 1381 | sqflite_common: |
| 1389 | dependency: transitive | 1382 | dependency: transitive |
| 1390 | description: | 1383 | description: |
| 1391 | name: sqflite_common | 1384 | name: sqflite_common |
| 1392 | url: "https://pub.flutter-io.cn" | 1385 | url: "https://pub.flutter-io.cn" |
| 1393 | source: hosted | 1386 | source: hosted |
| 1394 | - version: "2.4.0" | 1387 | + version: "2.4.0+2" |
| 1395 | stack_trace: | 1388 | stack_trace: |
| 1396 | dependency: transitive | 1389 | dependency: transitive |
| 1397 | description: | 1390 | description: |
| ... | @@ -1594,35 +1587,35 @@ packages: | ... | @@ -1594,35 +1587,35 @@ packages: |
| 1594 | name: video_player | 1587 | name: video_player |
| 1595 | url: "https://pub.flutter-io.cn" | 1588 | url: "https://pub.flutter-io.cn" |
| 1596 | source: hosted | 1589 | source: hosted |
| 1597 | - version: "2.4.9" | 1590 | + version: "2.4.10" |
| 1598 | video_player_android: | 1591 | video_player_android: |
| 1599 | dependency: transitive | 1592 | dependency: transitive |
| 1600 | description: | 1593 | description: |
| 1601 | name: video_player_android | 1594 | name: video_player_android |
| 1602 | url: "https://pub.flutter-io.cn" | 1595 | url: "https://pub.flutter-io.cn" |
| 1603 | source: hosted | 1596 | source: hosted |
| 1604 | - version: "2.3.9" | 1597 | + version: "2.3.10" |
| 1605 | video_player_avfoundation: | 1598 | video_player_avfoundation: |
| 1606 | dependency: transitive | 1599 | dependency: transitive |
| 1607 | description: | 1600 | description: |
| 1608 | name: video_player_avfoundation | 1601 | name: video_player_avfoundation |
| 1609 | url: "https://pub.flutter-io.cn" | 1602 | url: "https://pub.flutter-io.cn" |
| 1610 | source: hosted | 1603 | source: hosted |
| 1611 | - version: "2.3.7" | 1604 | + version: "2.3.8" |
| 1612 | video_player_platform_interface: | 1605 | video_player_platform_interface: |
| 1613 | dependency: transitive | 1606 | dependency: transitive |
| 1614 | description: | 1607 | description: |
| 1615 | name: video_player_platform_interface | 1608 | name: video_player_platform_interface |
| 1616 | url: "https://pub.flutter-io.cn" | 1609 | url: "https://pub.flutter-io.cn" |
| 1617 | source: hosted | 1610 | source: hosted |
| 1618 | - version: "5.1.4" | 1611 | + version: "6.0.1" |
| 1619 | video_player_web: | 1612 | video_player_web: |
| 1620 | dependency: transitive | 1613 | dependency: transitive |
| 1621 | description: | 1614 | description: |
| 1622 | name: video_player_web | 1615 | name: video_player_web |
| 1623 | url: "https://pub.flutter-io.cn" | 1616 | url: "https://pub.flutter-io.cn" |
| 1624 | source: hosted | 1617 | source: hosted |
| 1625 | - version: "2.0.12" | 1618 | + version: "2.0.13" |
| 1626 | vm_service: | 1619 | vm_service: |
| 1627 | dependency: transitive | 1620 | dependency: transitive |
| 1628 | description: | 1621 | description: |
| ... | @@ -1750,5 +1743,5 @@ packages: | ... | @@ -1750,5 +1743,5 @@ packages: |
| 1750 | source: hosted | 1743 | source: hosted |
| 1751 | version: "3.1.1" | 1744 | version: "3.1.1" |
| 1752 | sdks: | 1745 | sdks: |
| 1753 | - dart: ">=2.17.0 <3.0.0" | 1746 | + dart: ">=2.18.0 <3.0.0" |
| 1754 | - flutter: ">=3.0.0" | 1747 | + flutter: ">=3.3.0" | ... | ... |
-
Please register or login to post a comment