删除重复代码

master
张萌 3 years ago
parent 4b4ee23347
commit 81240a68f1

@ -3,6 +3,8 @@
/// FlutterGen /// FlutterGen
/// ***************************************************** /// *****************************************************
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import // ignore_for_file: directives_ordering,unnecessary_import
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@ -567,19 +569,23 @@ class Assets {
static const $AssetsUserGen user = $AssetsUserGen(); static const $AssetsUserGen user = $AssetsUserGen();
} }
class AssetGenImage extends AssetImage { class AssetGenImage {
const AssetGenImage(String assetName) : super(assetName); const AssetGenImage(this._assetName);
final String _assetName;
Image image({ Image image({
Key? key, Key? key,
AssetBundle? bundle,
ImageFrameBuilder? frameBuilder, ImageFrameBuilder? frameBuilder,
ImageLoadingBuilder? loadingBuilder,
ImageErrorWidgetBuilder? errorBuilder, ImageErrorWidgetBuilder? errorBuilder,
String? semanticLabel, String? semanticLabel,
bool excludeFromSemantics = false, bool excludeFromSemantics = false,
double? scale = 1.0,
double? width, double? width,
double? height, double? height,
Color? color, Color? color,
Animation<double>? opacity,
BlendMode? colorBlendMode, BlendMode? colorBlendMode,
BoxFit? fit, BoxFit? fit,
AlignmentGeometry alignment = Alignment.center, AlignmentGeometry alignment = Alignment.center,
@ -588,19 +594,24 @@ class AssetGenImage extends AssetImage {
bool matchTextDirection = false, bool matchTextDirection = false,
bool gaplessPlayback = false, bool gaplessPlayback = false,
bool isAntiAlias = false, bool isAntiAlias = false,
String? package,
FilterQuality filterQuality = FilterQuality.low, FilterQuality filterQuality = FilterQuality.low,
int? cacheWidth,
int? cacheHeight,
}) { }) {
return Image( return Image.asset(
_assetName,
key: key, key: key,
image: this, bundle: bundle,
frameBuilder: frameBuilder, frameBuilder: frameBuilder,
loadingBuilder: loadingBuilder,
errorBuilder: errorBuilder, errorBuilder: errorBuilder,
semanticLabel: semanticLabel, semanticLabel: semanticLabel,
excludeFromSemantics: excludeFromSemantics, excludeFromSemantics: excludeFromSemantics,
scale: scale,
width: width, width: width,
height: height, height: height,
color: color, color: color,
opacity: opacity,
colorBlendMode: colorBlendMode, colorBlendMode: colorBlendMode,
fit: fit, fit: fit,
alignment: alignment, alignment: alignment,
@ -609,9 +620,12 @@ class AssetGenImage extends AssetImage {
matchTextDirection: matchTextDirection, matchTextDirection: matchTextDirection,
gaplessPlayback: gaplessPlayback, gaplessPlayback: gaplessPlayback,
isAntiAlias: isAntiAlias, isAntiAlias: isAntiAlias,
package: package,
filterQuality: filterQuality, filterQuality: filterQuality,
cacheWidth: cacheWidth,
cacheHeight: cacheHeight,
); );
} }
String get path => assetName; String get path => _assetName;
} }

@ -3,6 +3,8 @@
/// FlutterGen /// FlutterGen
/// ***************************************************** /// *****************************************************
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import // ignore_for_file: directives_ordering,unnecessary_import
class FontFamily { class FontFamily {

@ -2,9 +2,9 @@
// Project imports: // Project imports:
import 'package:aku_new_community_manager/provider/app_provider.dart'; 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/data_provider.dart';
import 'package:aku_new_community_manager/provider/message_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/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/apptheme.dart'; import 'package:aku_new_community_manager/style/apptheme.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';

@ -1,4 +1,5 @@
import 'package:aku_new_community_manager/new_ui/auth/sign_func.dart'; 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/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:bot_toast/bot_toast.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:sms_autofill/sms_autofill.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../../provider/timer_provider.dart';
class CodeMessagePage extends StatefulWidget { class CodeMessagePage extends StatefulWidget {
final String tel; final String tel;

@ -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/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/login_button_widget.dart';
import 'package:aku_new_community_manager/new_ui/auth/widget/tel_textfield.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/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
@ -11,7 +12,6 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../../provider/timer_provider.dart';
import 'forgot_set_psd_page.dart'; import 'forgot_set_psd_page.dart';
class ForgotPsdPage extends StatefulWidget { class ForgotPsdPage extends StatefulWidget {

@ -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/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/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/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/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
@ -13,8 +14,6 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../../provider/timer_provider.dart';
class ForgotSetPsdPage extends StatefulWidget { class ForgotSetPsdPage extends StatefulWidget {
final String tel; final String tel;

@ -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/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/psd_textfield.dart';
import 'package:aku_new_community_manager/new_ui/auth/widget/tel_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/clock_timer_provider.dart';
import 'package:aku_new_community_manager/provider/timer_provider.dart';
import 'package:aku_new_community_manager/tools/user_tool.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:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';

@ -391,7 +391,7 @@ class _NewHomePageState extends State<NewHomePage> {
padding: EdgeInsets.symmetric(horizontal: 40.w, vertical: 48.w), padding: EdgeInsets.symmetric(horizontal: 40.w, vertical: 48.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w), borderRadius: BorderRadius.circular(16.w),
image: DecorationImage(image: Assets.home.homeHead)), image: DecorationImage(image: AssetImage(Assets.home.homeHead.path))),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -433,7 +433,7 @@ class _NewHomePageState extends State<NewHomePage> {
borderRadius: BorderRadius.circular(4.w), borderRadius: BorderRadius.circular(4.w),
), ),
child: child:
'${UserTool.userProvider.userInfoModel!.positionName??''}' '${UserTool.userProvider.userInfoModel!.positionName ?? ''}'
.text .text
.size(24.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.85)) .color(Colors.black.withOpacity(0.85))

@ -147,30 +147,5 @@ class AppProvider extends ChangeNotifier {
_pickedCityAndCommunity = null; _pickedCityAndCommunity = null;
notifyListeners(); 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(); notifyListeners();
} }

@ -10,6 +10,7 @@ class ClockTimerProvider extends ChangeNotifier {
void startTimer() { void startTimer() {
timerStart = true; timerStart = true;
print(timer==null);
if (timer != null) { if (timer != null) {
return; return;
} }

@ -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();
}
}

@ -24,6 +24,7 @@ class UserInfoModel extends Equatable {
final String? entryDate; final String? entryDate;
final String? remake; final String? remake;
final List<ImgModel>? imgList; final List<ImgModel>? imgList;
final int communityCode;
final String communityName; final String communityName;
final String? positionName; final String? positionName;
final int? workOrderJurisdiction; final int? workOrderJurisdiction;
@ -86,11 +87,12 @@ class UserInfoModel extends Equatable {
this.lastLoginDate, this.lastLoginDate,
this.nickName, this.nickName,
this.address, this.address,
required this.entryDate, this.entryDate,
this.remake, this.remake,
this.imgList, this.imgList,
required this.communityCode,
required this.communityName, required this.communityName,
required this.positionName, this.positionName,
this.workOrderJurisdiction, this.workOrderJurisdiction,
}); });
} }

@ -27,6 +27,7 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
imgList: (json['imgList'] as List<dynamic>?) imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) ?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
communityCode: json['communityCode'] as int,
communityName: json['communityName'] as String, communityName: json['communityName'] as String,
positionName: json['positionName'] as String?, positionName: json['positionName'] as String?,
workOrderJurisdiction: json['workOrderJurisdiction'] as int?, workOrderJurisdiction: json['workOrderJurisdiction'] as int?,

@ -1,9 +1,9 @@
// Package imports: // Package imports:
// Project imports: // Project imports:
import 'package:aku_new_community_manager/provider/app_provider.dart'; 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/data_provider.dart';
import 'package:aku_new_community_manager/provider/message_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/provider/user_provider.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -28,7 +28,7 @@ class WebSocketUtil {
static const String baseUri = 'wss://saas.kaidalai.cn/websocket/butlerApp'; static const String baseUri = 'wss://saas.kaidalai.cn/websocket/butlerApp';
String get urlAddress => 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; SOCKETSTATUS _socketStatus = SOCKETSTATUS.CLOSED;

Loading…
Cancel
Save