diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 1522919..ee7fec1 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -3,6 +3,8 @@ /// FlutterGen /// ***************************************************** +// coverage:ignore-file +// ignore_for_file: type=lint // ignore_for_file: directives_ordering,unnecessary_import import 'package:flutter/widgets.dart'; @@ -567,19 +569,23 @@ class Assets { static const $AssetsUserGen user = $AssetsUserGen(); } -class AssetGenImage extends AssetImage { - const AssetGenImage(String assetName) : super(assetName); +class AssetGenImage { + const AssetGenImage(this._assetName); + + final String _assetName; Image image({ Key? key, + AssetBundle? bundle, ImageFrameBuilder? frameBuilder, - ImageLoadingBuilder? loadingBuilder, ImageErrorWidgetBuilder? errorBuilder, String? semanticLabel, bool excludeFromSemantics = false, + double? scale = 1.0, double? width, double? height, Color? color, + Animation? opacity, BlendMode? colorBlendMode, BoxFit? fit, AlignmentGeometry alignment = Alignment.center, @@ -588,19 +594,24 @@ class AssetGenImage extends AssetImage { bool matchTextDirection = false, bool gaplessPlayback = false, bool isAntiAlias = false, + String? package, FilterQuality filterQuality = FilterQuality.low, + int? cacheWidth, + int? cacheHeight, }) { - return Image( + return Image.asset( + _assetName, key: key, - image: this, + bundle: bundle, frameBuilder: frameBuilder, - loadingBuilder: loadingBuilder, errorBuilder: errorBuilder, semanticLabel: semanticLabel, excludeFromSemantics: excludeFromSemantics, + scale: scale, width: width, height: height, color: color, + opacity: opacity, colorBlendMode: colorBlendMode, fit: fit, alignment: alignment, @@ -609,9 +620,12 @@ class AssetGenImage extends AssetImage { matchTextDirection: matchTextDirection, gaplessPlayback: gaplessPlayback, isAntiAlias: isAntiAlias, + package: package, filterQuality: filterQuality, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, ); } - String get path => assetName; + String get path => _assetName; } diff --git a/lib/gen/fonts.gen.dart b/lib/gen/fonts.gen.dart index 69d5c31..d500766 100644 --- a/lib/gen/fonts.gen.dart +++ b/lib/gen/fonts.gen.dart @@ -3,6 +3,8 @@ /// FlutterGen /// ***************************************************** +// coverage:ignore-file +// ignore_for_file: type=lint // ignore_for_file: directives_ordering,unnecessary_import class FontFamily { diff --git a/lib/main.dart b/lib/main.dart index 2efac91..f56471a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,9 +2,9 @@ // Project imports: import 'package:aku_new_community_manager/provider/app_provider.dart'; +import 'package:aku_new_community_manager/provider/clock_timer_provider.dart'; import 'package:aku_new_community_manager/provider/data_provider.dart'; import 'package:aku_new_community_manager/provider/message_provider.dart'; -import 'package:aku_new_community_manager/provider/timer_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/style/apptheme.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; diff --git a/lib/new_ui/auth/code_message_page.dart b/lib/new_ui/auth/code_message_page.dart index 0733960..b969d56 100644 --- a/lib/new_ui/auth/code_message_page.dart +++ b/lib/new_ui/auth/code_message_page.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community_manager/new_ui/auth/sign_func.dart'; +import 'package:aku_new_community_manager/provider/clock_timer_provider.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -9,7 +10,6 @@ import 'package:provider/provider.dart'; import 'package:sms_autofill/sms_autofill.dart'; import 'package:velocity_x/velocity_x.dart'; -import '../../provider/timer_provider.dart'; class CodeMessagePage extends StatefulWidget { final String tel; diff --git a/lib/new_ui/auth/forgot_psd_page.dart b/lib/new_ui/auth/forgot_psd_page.dart index ac5cb72..fc6d058 100644 --- a/lib/new_ui/auth/forgot_psd_page.dart +++ b/lib/new_ui/auth/forgot_psd_page.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community_manager/new_ui/auth/sign_func.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/login_button_widget.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/tel_textfield.dart'; +import 'package:aku_new_community_manager/provider/clock_timer_provider.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -11,7 +12,6 @@ import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; -import '../../provider/timer_provider.dart'; import 'forgot_set_psd_page.dart'; class ForgotPsdPage extends StatefulWidget { diff --git a/lib/new_ui/auth/forgot_set_psd_page.dart b/lib/new_ui/auth/forgot_set_psd_page.dart index 9c4306a..a37bbf9 100644 --- a/lib/new_ui/auth/forgot_set_psd_page.dart +++ b/lib/new_ui/auth/forgot_set_psd_page.dart @@ -3,6 +3,7 @@ import 'package:aku_new_community_manager/new_ui/auth/psd_verify.dart'; import 'package:aku_new_community_manager/new_ui/auth/sign_func.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/login_button_widget.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/psd_textfield.dart'; +import 'package:aku_new_community_manager/provider/clock_timer_provider.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -13,8 +14,6 @@ import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; -import '../../provider/timer_provider.dart'; - class ForgotSetPsdPage extends StatefulWidget { final String tel; diff --git a/lib/new_ui/auth/other_login_page.dart b/lib/new_ui/auth/other_login_page.dart index f88cc16..a2421eb 100644 --- a/lib/new_ui/auth/other_login_page.dart +++ b/lib/new_ui/auth/other_login_page.dart @@ -2,8 +2,7 @@ import 'package:aku_new_community_manager/new_ui/auth/sign_func.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/login_button_widget.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/psd_textfield.dart'; import 'package:aku_new_community_manager/new_ui/auth/widget/tel_textfield.dart'; -import 'package:aku_new_community_manager/provider/app_provider.dart'; -import 'package:aku_new_community_manager/provider/timer_provider.dart'; +import 'package:aku_new_community_manager/provider/clock_timer_provider.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; diff --git a/lib/new_ui/new_home/new_home_page.dart b/lib/new_ui/new_home/new_home_page.dart index 864e945..12b1845 100644 --- a/lib/new_ui/new_home/new_home_page.dart +++ b/lib/new_ui/new_home/new_home_page.dart @@ -391,7 +391,7 @@ class _NewHomePageState extends State { padding: EdgeInsets.symmetric(horizontal: 40.w, vertical: 48.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16.w), - image: DecorationImage(image: Assets.home.homeHead)), + image: DecorationImage(image: AssetImage(Assets.home.homeHead.path))), child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -433,7 +433,7 @@ class _NewHomePageState extends State { borderRadius: BorderRadius.circular(4.w), ), child: - '${UserTool.userProvider.userInfoModel!.positionName??''}' + '${UserTool.userProvider.userInfoModel!.positionName ?? ''}' .text .size(24.sp) .color(Colors.black.withOpacity(0.85)) diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index 8bd19d5..1c61532 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -147,30 +147,5 @@ class AppProvider extends ChangeNotifier { _pickedCityAndCommunity = null; notifyListeners(); } - - ///登录页验证码计时器 - /*int second = 60; - bool timerStart = false; - Timer? timer; - - void startTimer() { - timerStart = true; - timer = Timer.periodic(Duration(seconds: 1), (timer) { - if (second > 0) { - second--; - notifyListeners(); - } else { - stopTimer(); - } - }); - } - - void stopTimer() { - second = 60; - timerStart = false; - timer?.cancel(); - timer = null; - notifyListeners(); - }*/ notifyListeners(); } diff --git a/lib/provider/clock_timer_provider.dart b/lib/provider/clock_timer_provider.dart index 4d6b66e..3addb5e 100644 --- a/lib/provider/clock_timer_provider.dart +++ b/lib/provider/clock_timer_provider.dart @@ -10,6 +10,7 @@ class ClockTimerProvider extends ChangeNotifier { void startTimer() { timerStart = true; + print(timer==null); if (timer != null) { return; } diff --git a/lib/provider/timer_provider.dart b/lib/provider/timer_provider.dart deleted file mode 100644 index aa33dd8..0000000 --- a/lib/provider/timer_provider.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'dart:async'; - -import 'package:flutter/material.dart'; - -class ClockTimerProvider extends ChangeNotifier{ - ///登录页验证码计时器 - int second = 60; - bool timerStart = false; - Timer? timer; - - void startTimer() { - timerStart = true; - timer = Timer.periodic(Duration(seconds: 1), (timer) { - if (second > 0) { - second--; - notifyListeners(); - } else { - stopTimer(); - } - }); - } - - void stopTimer() { - second = 60; - timerStart = false; - timer?.cancel(); - timer = null; - notifyListeners(); - } -} \ No newline at end of file diff --git a/lib/saas_models/user/user_info_model.dart b/lib/saas_models/user/user_info_model.dart index da8097a..7cf4fc8 100644 --- a/lib/saas_models/user/user_info_model.dart +++ b/lib/saas_models/user/user_info_model.dart @@ -24,6 +24,7 @@ class UserInfoModel extends Equatable { final String? entryDate; final String? remake; final List? imgList; + final int communityCode; final String communityName; final String? positionName; final int? workOrderJurisdiction; @@ -86,11 +87,12 @@ class UserInfoModel extends Equatable { this.lastLoginDate, this.nickName, this.address, - required this.entryDate, + this.entryDate, this.remake, this.imgList, + required this.communityCode, required this.communityName, - required this.positionName, + this.positionName, this.workOrderJurisdiction, }); } diff --git a/lib/saas_models/user/user_info_model.g.dart b/lib/saas_models/user/user_info_model.g.dart index 980c27c..7921654 100644 --- a/lib/saas_models/user/user_info_model.g.dart +++ b/lib/saas_models/user/user_info_model.g.dart @@ -27,6 +27,7 @@ UserInfoModel _$UserInfoModelFromJson(Map json) => imgList: (json['imgList'] as List?) ?.map((e) => ImgModel.fromJson(e as Map)) .toList(), + communityCode: json['communityCode'] as int, communityName: json['communityName'] as String, positionName: json['positionName'] as String?, workOrderJurisdiction: json['workOrderJurisdiction'] as int?, diff --git a/lib/tools/user_tool.dart b/lib/tools/user_tool.dart index 4c9ca0d..cb077bd 100644 --- a/lib/tools/user_tool.dart +++ b/lib/tools/user_tool.dart @@ -1,9 +1,9 @@ // Package imports: // Project imports: import 'package:aku_new_community_manager/provider/app_provider.dart'; +import 'package:aku_new_community_manager/provider/clock_timer_provider.dart'; import 'package:aku_new_community_manager/provider/data_provider.dart'; import 'package:aku_new_community_manager/provider/message_provider.dart'; -import 'package:aku_new_community_manager/provider/timer_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; diff --git a/lib/utils/websocket/web_socket_util.dart b/lib/utils/websocket/web_socket_util.dart index 8fc4523..498e0e7 100644 --- a/lib/utils/websocket/web_socket_util.dart +++ b/lib/utils/websocket/web_socket_util.dart @@ -28,7 +28,7 @@ class WebSocketUtil { static const String baseUri = 'wss://saas.kaidalai.cn/websocket/butlerApp'; String get urlAddress => - '$baseUri/${UserTool.userProvider.userInfoModel?.communityName}/${UserTool.userProvider.userInfoModel?.nickName}'; + '$baseUri/${UserTool.userProvider.userInfoModel?.communityCode}/${UserTool.userProvider.userInfoModel?.nickName}'; ///连接状态 SOCKETSTATUS _socketStatus = SOCKETSTATUS.CLOSED;