parent
b4f9982603
commit
883013fef0
@ -0,0 +1,10 @@
|
||||
part of 'saas_api.dart';
|
||||
|
||||
class _OtherApi {
|
||||
_File file = _File();
|
||||
}
|
||||
|
||||
class _File {
|
||||
///上传app照片
|
||||
String get uploadImg => '/butlerApp/user/upload/uploadImg';
|
||||
}
|
@ -0,0 +1,506 @@
|
||||
/// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
/// *****************************************************
|
||||
/// FlutterGen
|
||||
/// *****************************************************
|
||||
|
||||
// ignore_for_file: directives_ordering,unnecessary_import
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class $AssetsHomeGen {
|
||||
const $AssetsHomeGen();
|
||||
|
||||
/// File path: assets/home/app_alarm.png
|
||||
AssetGenImage get appAlarm =>
|
||||
const AssetGenImage('assets/home/app_alarm.png');
|
||||
|
||||
/// File path: assets/home/bee_task.png
|
||||
AssetGenImage get beeTask => const AssetGenImage('assets/home/bee_task.png');
|
||||
|
||||
/// File path: assets/home/clock_in_out.png
|
||||
AssetGenImage get clockInOut =>
|
||||
const AssetGenImage('assets/home/clock_in_out.png');
|
||||
|
||||
/// File path: assets/home/device_alarm.png
|
||||
AssetGenImage get deviceAlarm =>
|
||||
const AssetGenImage('assets/home/device_alarm.png');
|
||||
|
||||
/// File path: assets/home/facilities.png
|
||||
AssetGenImage get facilities =>
|
||||
const AssetGenImage('assets/home/facilities.png');
|
||||
|
||||
/// File path: assets/home/fire_alarm.png
|
||||
AssetGenImage get fireAlarm =>
|
||||
const AssetGenImage('assets/home/fire_alarm.png');
|
||||
|
||||
/// File path: assets/home/house_keeping.png
|
||||
AssetGenImage get houseKeeping =>
|
||||
const AssetGenImage('assets/home/house_keeping.png');
|
||||
|
||||
/// File path: assets/home/hygienice.png
|
||||
AssetGenImage get hygienice =>
|
||||
const AssetGenImage('assets/home/hygienice.png');
|
||||
|
||||
/// File path: assets/home/ic_Patrol.png
|
||||
AssetGenImage get icPatrol =>
|
||||
const AssetGenImage('assets/home/ic_Patrol.png');
|
||||
|
||||
/// File path: assets/home/ic_activity.png
|
||||
AssetGenImage get icActivity =>
|
||||
const AssetGenImage('assets/home/ic_activity.png');
|
||||
|
||||
/// File path: assets/home/ic_all.png
|
||||
AssetGenImage get icAll => const AssetGenImage('assets/home/ic_all.png');
|
||||
|
||||
/// File path: assets/home/ic_article.png
|
||||
AssetGenImage get icArticle =>
|
||||
const AssetGenImage('assets/home/ic_article.png');
|
||||
|
||||
/// File path: assets/home/ic_borrow.png
|
||||
AssetGenImage get icBorrow =>
|
||||
const AssetGenImage('assets/home/ic_borrow.png');
|
||||
|
||||
/// File path: assets/home/ic_decoration.png
|
||||
AssetGenImage get icDecoration =>
|
||||
const AssetGenImage('assets/home/ic_decoration.png');
|
||||
|
||||
/// File path: assets/home/ic_facilities.png
|
||||
AssetGenImage get icFacilities =>
|
||||
const AssetGenImage('assets/home/ic_facilities.png');
|
||||
|
||||
/// File path: assets/home/ic_greening.png
|
||||
AssetGenImage get icGreening =>
|
||||
const AssetGenImage('assets/home/ic_greening.png');
|
||||
|
||||
/// File path: assets/home/ic_news.png
|
||||
AssetGenImage get icNews => const AssetGenImage('assets/home/ic_news.png');
|
||||
|
||||
/// File path: assets/home/ic_police.png
|
||||
AssetGenImage get icPolice =>
|
||||
const AssetGenImage('assets/home/ic_police.png');
|
||||
|
||||
/// File path: assets/home/ic_scan.png
|
||||
AssetGenImage get icScan => const AssetGenImage('assets/home/ic_scan.png');
|
||||
|
||||
/// File path: assets/home/ic_search.png
|
||||
AssetGenImage get icSearch =>
|
||||
const AssetGenImage('assets/home/ic_search.png');
|
||||
|
||||
/// File path: assets/home/ic_service.png
|
||||
AssetGenImage get icService =>
|
||||
const AssetGenImage('assets/home/ic_service.png');
|
||||
|
||||
/// File path: assets/home/ic_visitors.png
|
||||
AssetGenImage get icVisitors =>
|
||||
const AssetGenImage('assets/home/ic_visitors.png');
|
||||
|
||||
/// File path: assets/home/interview.png
|
||||
AssetGenImage get interview =>
|
||||
const AssetGenImage('assets/home/interview.png');
|
||||
|
||||
/// File path: assets/home/key.png
|
||||
AssetGenImage get key => const AssetGenImage('assets/home/key.png');
|
||||
|
||||
/// File path: assets/home/nearby_pet.png
|
||||
AssetGenImage get nearbyPet =>
|
||||
const AssetGenImage('assets/home/nearby_pet.png');
|
||||
|
||||
/// File path: assets/home/nearby_service.png
|
||||
AssetGenImage get nearbyService =>
|
||||
const AssetGenImage('assets/home/nearby_service.png');
|
||||
|
||||
/// File path: assets/home/package.png
|
||||
AssetGenImage get package => const AssetGenImage('assets/home/package.png');
|
||||
|
||||
/// File path: assets/home/provide_aged.png
|
||||
AssetGenImage get provideAged =>
|
||||
const AssetGenImage('assets/home/provide_aged.png');
|
||||
|
||||
/// File path: assets/home/rules.png
|
||||
AssetGenImage get rules => const AssetGenImage('assets/home/rules.png');
|
||||
|
||||
/// File path: assets/home/second_hand_market.png
|
||||
AssetGenImage get secondHandMarket =>
|
||||
const AssetGenImage('assets/home/second_hand_market.png');
|
||||
|
||||
/// File path: assets/home/share_park.png
|
||||
AssetGenImage get sharePark =>
|
||||
const AssetGenImage('assets/home/share_park.png');
|
||||
|
||||
/// File path: assets/home/shopping_mall.png
|
||||
AssetGenImage get shoppingMall =>
|
||||
const AssetGenImage('assets/home/shopping_mall.png');
|
||||
|
||||
/// File path: assets/home/sos.png
|
||||
AssetGenImage get sos => const AssetGenImage('assets/home/sos.png');
|
||||
}
|
||||
|
||||
class $AssetsInspectionGen {
|
||||
const $AssetsInspectionGen();
|
||||
|
||||
/// File path: assets/inspection/ic_date.png
|
||||
AssetGenImage get icDate =>
|
||||
const AssetGenImage('assets/inspection/ic_date.png');
|
||||
|
||||
/// File path: assets/inspection/ic_inspection_name.png
|
||||
AssetGenImage get icInspectionName =>
|
||||
const AssetGenImage('assets/inspection/ic_inspection_name.png');
|
||||
|
||||
/// File path: assets/inspection/ic_pattern.png
|
||||
AssetGenImage get icPattern =>
|
||||
const AssetGenImage('assets/inspection/ic_pattern.png');
|
||||
|
||||
/// File path: assets/inspection/ic_station.png
|
||||
AssetGenImage get icStation =>
|
||||
const AssetGenImage('assets/inspection/ic_station.png');
|
||||
|
||||
/// File path: assets/inspection/ic_way.png
|
||||
AssetGenImage get icWay =>
|
||||
const AssetGenImage('assets/inspection/ic_way.png');
|
||||
|
||||
/// File path: assets/inspection/ic_xunjian.png
|
||||
AssetGenImage get icXunjian =>
|
||||
const AssetGenImage('assets/inspection/ic_xunjian.png');
|
||||
|
||||
/// File path: assets/inspection/inspection_station.png
|
||||
AssetGenImage get inspectionStation =>
|
||||
const AssetGenImage('assets/inspection/inspection_station.png');
|
||||
}
|
||||
|
||||
class $AssetsManageGen {
|
||||
const $AssetsManageGen();
|
||||
|
||||
/// File path: assets/manage/add.png
|
||||
AssetGenImage get add => const AssetGenImage('assets/manage/add.png');
|
||||
|
||||
/// File path: assets/manage/address.png
|
||||
AssetGenImage get address => const AssetGenImage('assets/manage/address.png');
|
||||
|
||||
/// File path: assets/manage/article.png
|
||||
AssetGenImage get article => const AssetGenImage('assets/manage/article.png');
|
||||
|
||||
/// File path: assets/manage/borrow.png
|
||||
AssetGenImage get borrow => const AssetGenImage('assets/manage/borrow.png');
|
||||
|
||||
/// File path: assets/manage/check.png
|
||||
AssetGenImage get check => const AssetGenImage('assets/manage/check.png');
|
||||
|
||||
/// File path: assets/manage/circuit.png
|
||||
AssetGenImage get circuit => const AssetGenImage('assets/manage/circuit.png');
|
||||
|
||||
/// File path: assets/manage/clock.png
|
||||
AssetGenImage get clock => const AssetGenImage('assets/manage/clock.png');
|
||||
|
||||
/// File path: assets/manage/decoration.png
|
||||
AssetGenImage get decoration =>
|
||||
const AssetGenImage('assets/manage/decoration.png');
|
||||
|
||||
/// File path: assets/manage/dingwei.png
|
||||
AssetGenImage get dingwei => const AssetGenImage('assets/manage/dingwei.png');
|
||||
|
||||
/// File path: assets/manage/estate.png
|
||||
AssetGenImage get estate => const AssetGenImage('assets/manage/estate.png');
|
||||
|
||||
/// File path: assets/manage/home.png
|
||||
AssetGenImage get home => const AssetGenImage('assets/manage/home.png');
|
||||
|
||||
/// File path: assets/manage/ic_announce.png
|
||||
AssetGenImage get icAnnounce =>
|
||||
const AssetGenImage('assets/manage/ic_announce.png');
|
||||
|
||||
/// File path: assets/manage/ic_car.png
|
||||
AssetGenImage get icCar => const AssetGenImage('assets/manage/ic_car.png');
|
||||
|
||||
/// File path: assets/manage/ic_daofang.png
|
||||
AssetGenImage get icDaofang =>
|
||||
const AssetGenImage('assets/manage/ic_daofang.png');
|
||||
|
||||
/// File path: assets/manage/ic_guoqi.png
|
||||
AssetGenImage get icGuoqi =>
|
||||
const AssetGenImage('assets/manage/ic_guoqi.png');
|
||||
|
||||
/// File path: assets/manage/ic_image.png
|
||||
AssetGenImage get icImage =>
|
||||
const AssetGenImage('assets/manage/ic_image.png');
|
||||
|
||||
/// File path: assets/manage/ic_renwu.png
|
||||
AssetGenImage get icRenwu =>
|
||||
const AssetGenImage('assets/manage/ic_renwu.png');
|
||||
|
||||
/// File path: assets/manage/ic_time.png
|
||||
AssetGenImage get icTime => const AssetGenImage('assets/manage/ic_time.png');
|
||||
|
||||
/// File path: assets/manage/ic_wancheng.png
|
||||
AssetGenImage get icWancheng =>
|
||||
const AssetGenImage('assets/manage/ic_wancheng.png');
|
||||
|
||||
/// File path: assets/manage/ic_weidao.png
|
||||
AssetGenImage get icWeidao =>
|
||||
const AssetGenImage('assets/manage/ic_weidao.png');
|
||||
|
||||
/// File path: assets/manage/ic_zhuangxiu.png
|
||||
AssetGenImage get icZhuangxiu =>
|
||||
const AssetGenImage('assets/manage/ic_zhuangxiu.png');
|
||||
|
||||
/// File path: assets/manage/ic_zuofei.png
|
||||
AssetGenImage get icZuofei =>
|
||||
const AssetGenImage('assets/manage/ic_zuofei.png');
|
||||
|
||||
/// File path: assets/manage/info.png
|
||||
AssetGenImage get info => const AssetGenImage('assets/manage/info.png');
|
||||
|
||||
/// File path: assets/manage/key.png
|
||||
AssetGenImage get key => const AssetGenImage('assets/manage/key.png');
|
||||
|
||||
/// File path: assets/manage/location.png
|
||||
AssetGenImage get location =>
|
||||
const AssetGenImage('assets/manage/location.png');
|
||||
|
||||
/// File path: assets/manage/lock.png
|
||||
AssetGenImage get lock => const AssetGenImage('assets/manage/lock.png');
|
||||
|
||||
/// File path: assets/manage/police.png
|
||||
AssetGenImage get police => const AssetGenImage('assets/manage/police.png');
|
||||
|
||||
/// File path: assets/manage/remaining.png
|
||||
AssetGenImage get remaining =>
|
||||
const AssetGenImage('assets/manage/remaining.png');
|
||||
|
||||
/// File path: assets/manage/security.png
|
||||
AssetGenImage get security =>
|
||||
const AssetGenImage('assets/manage/security.png');
|
||||
|
||||
/// File path: assets/manage/status.png
|
||||
AssetGenImage get status => const AssetGenImage('assets/manage/status.png');
|
||||
|
||||
/// File path: assets/manage/submit_success.png
|
||||
AssetGenImage get submitSuccess =>
|
||||
const AssetGenImage('assets/manage/submit_success.png');
|
||||
|
||||
/// File path: assets/manage/wall.png
|
||||
AssetGenImage get wall => const AssetGenImage('assets/manage/wall.png');
|
||||
|
||||
/// File path: assets/manage/warning.png
|
||||
AssetGenImage get warning => const AssetGenImage('assets/manage/warning.png');
|
||||
|
||||
/// File path: assets/manage/waterway.png
|
||||
AssetGenImage get waterway =>
|
||||
const AssetGenImage('assets/manage/waterway.png');
|
||||
|
||||
/// File path: assets/manage/window.png
|
||||
AssetGenImage get window => const AssetGenImage('assets/manage/window.png');
|
||||
}
|
||||
|
||||
class $AssetsMessageGen {
|
||||
const $AssetsMessageGen();
|
||||
|
||||
/// File path: assets/message/ic_area.png
|
||||
AssetGenImage get icArea => const AssetGenImage('assets/message/ic_area.png');
|
||||
|
||||
/// File path: assets/message/ic_people.png
|
||||
AssetGenImage get icPeople =>
|
||||
const AssetGenImage('assets/message/ic_people.png');
|
||||
|
||||
/// File path: assets/message/ic_phone.png
|
||||
AssetGenImage get icPhone =>
|
||||
const AssetGenImage('assets/message/ic_phone.png');
|
||||
|
||||
/// File path: assets/message/ic_pinglun.png
|
||||
AssetGenImage get icPinglun =>
|
||||
const AssetGenImage('assets/message/ic_pinglun.png');
|
||||
|
||||
/// File path: assets/message/ic_star.png
|
||||
AssetGenImage get icStar => const AssetGenImage('assets/message/ic_star.png');
|
||||
|
||||
/// File path: assets/message/ic_tongzhi.png
|
||||
AssetGenImage get icTongzhi =>
|
||||
const AssetGenImage('assets/message/ic_tongzhi.png');
|
||||
}
|
||||
|
||||
class $AssetsOutdoorGen {
|
||||
const $AssetsOutdoorGen();
|
||||
|
||||
/// File path: assets/outdoor/ic_address.png
|
||||
AssetGenImage get icAddress =>
|
||||
const AssetGenImage('assets/outdoor/ic_address.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_chuhu.png
|
||||
AssetGenImage get icChuhu =>
|
||||
const AssetGenImage('assets/outdoor/ic_chuhu.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_goout.png
|
||||
AssetGenImage get icGoout =>
|
||||
const AssetGenImage('assets/outdoor/ic_goout.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_home.png
|
||||
AssetGenImage get icHome => const AssetGenImage('assets/outdoor/ic_home.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_image.png
|
||||
AssetGenImage get icImage =>
|
||||
const AssetGenImage('assets/outdoor/ic_image.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_people.png
|
||||
AssetGenImage get icPeople =>
|
||||
const AssetGenImage('assets/outdoor/ic_people.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_phoneblue.png
|
||||
AssetGenImage get icPhoneblue =>
|
||||
const AssetGenImage('assets/outdoor/ic_phoneblue.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_time.png
|
||||
AssetGenImage get icTime => const AssetGenImage('assets/outdoor/ic_time.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_transport.png
|
||||
AssetGenImage get icTransport =>
|
||||
const AssetGenImage('assets/outdoor/ic_transport.png');
|
||||
|
||||
/// File path: assets/outdoor/ic_weight.png
|
||||
AssetGenImage get icWeight =>
|
||||
const AssetGenImage('assets/outdoor/ic_weight.png');
|
||||
|
||||
/// File path: assets/outdoor/item2.png
|
||||
AssetGenImage get item2 => const AssetGenImage('assets/outdoor/item2.png');
|
||||
|
||||
/// File path: assets/outdoor/item3.png
|
||||
AssetGenImage get item3 => const AssetGenImage('assets/outdoor/item3.png');
|
||||
|
||||
/// File path: assets/outdoor/itme1.png
|
||||
AssetGenImage get itme1 => const AssetGenImage('assets/outdoor/itme1.png');
|
||||
}
|
||||
|
||||
class $AssetsStaticFixGen {
|
||||
const $AssetsStaticFixGen();
|
||||
|
||||
/// File path: assets/static_fix/air1.png
|
||||
AssetGenImage get air1 => const AssetGenImage('assets/static_fix/air1.png');
|
||||
|
||||
/// File path: assets/static_fix/air2.png
|
||||
AssetGenImage get air2 => const AssetGenImage('assets/static_fix/air2.png');
|
||||
|
||||
/// File path: assets/static_fix/food.png
|
||||
AssetGenImage get food => const AssetGenImage('assets/static_fix/food.png');
|
||||
|
||||
/// File path: assets/static_fix/food2.png
|
||||
AssetGenImage get food2 => const AssetGenImage('assets/static_fix/food2.png');
|
||||
|
||||
/// File path: assets/static_fix/light1.png
|
||||
AssetGenImage get light1 =>
|
||||
const AssetGenImage('assets/static_fix/light1.png');
|
||||
|
||||
/// File path: assets/static_fix/light2.png
|
||||
AssetGenImage get light2 =>
|
||||
const AssetGenImage('assets/static_fix/light2.png');
|
||||
|
||||
/// File path: assets/static_fix/light3.png
|
||||
AssetGenImage get light3 =>
|
||||
const AssetGenImage('assets/static_fix/light3.png');
|
||||
}
|
||||
|
||||
class $AssetsStaticTempGen {
|
||||
const $AssetsStaticTempGen();
|
||||
|
||||
/// File path: assets/static_temp/drill.png
|
||||
AssetGenImage get drill =>
|
||||
const AssetGenImage('assets/static_temp/drill.png');
|
||||
|
||||
/// File path: assets/static_temp/f1.webp
|
||||
AssetGenImage get f1 => const AssetGenImage('assets/static_temp/f1.webp');
|
||||
|
||||
/// File path: assets/static_temp/f2.webp
|
||||
AssetGenImage get f2 => const AssetGenImage('assets/static_temp/f2.webp');
|
||||
|
||||
/// File path: assets/static_temp/f3.webp
|
||||
AssetGenImage get f3 => const AssetGenImage('assets/static_temp/f3.webp');
|
||||
|
||||
/// File path: assets/static_temp/f4.webp
|
||||
AssetGenImage get f4 => const AssetGenImage('assets/static_temp/f4.webp');
|
||||
|
||||
/// File path: assets/static_temp/f5.webp
|
||||
AssetGenImage get f5 => const AssetGenImage('assets/static_temp/f5.webp');
|
||||
|
||||
/// File path: assets/static_temp/hammer.png
|
||||
AssetGenImage get hammer =>
|
||||
const AssetGenImage('assets/static_temp/hammer.png');
|
||||
|
||||
/// File path: assets/static_temp/ladder.png
|
||||
AssetGenImage get ladder =>
|
||||
const AssetGenImage('assets/static_temp/ladder.png');
|
||||
}
|
||||
|
||||
class $AssetsUserGen {
|
||||
const $AssetsUserGen();
|
||||
|
||||
/// File path: assets/user/ic_kefu.png
|
||||
AssetGenImage get icKefu => const AssetGenImage('assets/user/ic_kefu.png');
|
||||
|
||||
/// File path: assets/user/ic_person.png
|
||||
AssetGenImage get icPerson =>
|
||||
const AssetGenImage('assets/user/ic_person.png');
|
||||
|
||||
/// File path: assets/user/ic_setup.png
|
||||
AssetGenImage get icSetup => const AssetGenImage('assets/user/ic_setup.png');
|
||||
}
|
||||
|
||||
class Assets {
|
||||
Assets._();
|
||||
|
||||
static const $AssetsHomeGen home = $AssetsHomeGen();
|
||||
static const $AssetsInspectionGen inspection = $AssetsInspectionGen();
|
||||
static const $AssetsManageGen manage = $AssetsManageGen();
|
||||
static const $AssetsMessageGen message = $AssetsMessageGen();
|
||||
static const $AssetsOutdoorGen outdoor = $AssetsOutdoorGen();
|
||||
static const AssetGenImage placeholder =
|
||||
AssetGenImage('assets/placeholder.webp');
|
||||
static const $AssetsStaticFixGen staticFix = $AssetsStaticFixGen();
|
||||
static const $AssetsStaticTempGen staticTemp = $AssetsStaticTempGen();
|
||||
static const $AssetsUserGen user = $AssetsUserGen();
|
||||
}
|
||||
|
||||
class AssetGenImage extends AssetImage {
|
||||
const AssetGenImage(String assetName) : super(assetName);
|
||||
|
||||
Image image({
|
||||
Key? key,
|
||||
ImageFrameBuilder? frameBuilder,
|
||||
ImageLoadingBuilder? loadingBuilder,
|
||||
ImageErrorWidgetBuilder? errorBuilder,
|
||||
String? semanticLabel,
|
||||
bool excludeFromSemantics = false,
|
||||
double? width,
|
||||
double? height,
|
||||
Color? color,
|
||||
BlendMode? colorBlendMode,
|
||||
BoxFit? fit,
|
||||
AlignmentGeometry alignment = Alignment.center,
|
||||
ImageRepeat repeat = ImageRepeat.noRepeat,
|
||||
Rect? centerSlice,
|
||||
bool matchTextDirection = false,
|
||||
bool gaplessPlayback = false,
|
||||
bool isAntiAlias = false,
|
||||
FilterQuality filterQuality = FilterQuality.low,
|
||||
}) {
|
||||
return Image(
|
||||
key: key,
|
||||
image: this,
|
||||
frameBuilder: frameBuilder,
|
||||
loadingBuilder: loadingBuilder,
|
||||
errorBuilder: errorBuilder,
|
||||
semanticLabel: semanticLabel,
|
||||
excludeFromSemantics: excludeFromSemantics,
|
||||
width: width,
|
||||
height: height,
|
||||
color: color,
|
||||
colorBlendMode: colorBlendMode,
|
||||
fit: fit,
|
||||
alignment: alignment,
|
||||
repeat: repeat,
|
||||
centerSlice: centerSlice,
|
||||
matchTextDirection: matchTextDirection,
|
||||
gaplessPlayback: gaplessPlayback,
|
||||
isAntiAlias: isAntiAlias,
|
||||
filterQuality: filterQuality,
|
||||
);
|
||||
}
|
||||
|
||||
String get path => assetName;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
/// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
/// *****************************************************
|
||||
/// FlutterGen
|
||||
/// *****************************************************
|
||||
|
||||
// ignore_for_file: directives_ordering,unnecessary_import
|
||||
|
||||
class FontFamily {
|
||||
FontFamily._();
|
||||
|
||||
/// Font family: Bebas
|
||||
static const String bebas = 'Bebas';
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
import 'package:aku_new_community_manager/new_ui/auth/sign_func.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';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:sms_autofill/sms_autofill.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class CodeMessagePage extends StatefulWidget {
|
||||
final String tel;
|
||||
|
||||
const CodeMessagePage({Key? key, required this.tel}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CodeMessagePageState createState() => _CodeMessagePageState();
|
||||
}
|
||||
|
||||
class _CodeMessagePageState extends State<CodeMessagePage> {
|
||||
String? _errorMessage;
|
||||
TextEditingController _controller = TextEditingController();
|
||||
String? _currentCode;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(Duration(milliseconds: 0), () async {
|
||||
await SmsAutoFill().listenForCode();
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '',
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 48.w, vertical: 24.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
46.w.heightBox,
|
||||
'请输入验证码'
|
||||
.text
|
||||
.size(36.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.bold
|
||||
.make(),
|
||||
16.w.heightBox,
|
||||
_errorMessage != null
|
||||
? '${_errorMessage}'.text.color(Colors.red).size(28.sp).make()
|
||||
: '验证码已发送至'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
'${widget.tel}'
|
||||
.textSpan
|
||||
.size(28.sp)
|
||||
.color(Color(0xFFCF1322).withOpacity(0.8))
|
||||
.make(),
|
||||
])
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
80.w.heightBox,
|
||||
PinFieldAutoFill(
|
||||
autoFocus: true,
|
||||
currentCode: _currentCode,
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||
codeLength: 6,
|
||||
onCodeChanged: (code) async {
|
||||
if (code!.length >= 6) {
|
||||
var re = await SignFunc.loginBySms(
|
||||
widget.tel,
|
||||
code,
|
||||
UserTool.appProvider.pickedCityAndCommunity!
|
||||
.communityModel!.id);
|
||||
if (re.data['success']) {
|
||||
await UserTool.userProvider
|
||||
.setLogin(re.data['data'] as int);
|
||||
await UserTool.dataProvider.addHistories();
|
||||
} else {
|
||||
_errorMessage = re.data['msg'];
|
||||
BotToast.showText(text: re.data['msg']);
|
||||
_controller.clear();
|
||||
}
|
||||
}
|
||||
_currentCode = code;
|
||||
},
|
||||
decoration: UnderlineDecoration(
|
||||
colorBuilder: FixedColorListBuilder([
|
||||
Colors.black.withOpacity(0.3),
|
||||
Colors.black.withOpacity(0.3),
|
||||
Colors.black.withOpacity(0.3),
|
||||
Colors.black.withOpacity(0.3),
|
||||
Colors.black.withOpacity(0.3),
|
||||
Colors.black.withOpacity(0.3),
|
||||
])),
|
||||
),
|
||||
24.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
var base = await SignFunc.sendMessageCode(
|
||||
widget.tel,
|
||||
UserTool.appProvider.pickedCityAndCommunity!
|
||||
.communityModel!.id);
|
||||
if (base.success) {
|
||||
_errorMessage = null;
|
||||
UserTool.appProvider.startTimer();
|
||||
} else {
|
||||
BotToast.showText(text: base.msg);
|
||||
}
|
||||
},
|
||||
child: (UserTool.appProvider.second >= 60
|
||||
? '重新发送验证码'
|
||||
: '${UserTool.appProvider.second}秒后可重新发送')
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Color(0xFF5096F1))
|
||||
.make()),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
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/tools/user_tool.dart';
|
||||
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
import 'forgot_set_psd_page.dart';
|
||||
|
||||
class ForgotPsdPage extends StatefulWidget {
|
||||
const ForgotPsdPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ForgotPsdPageState createState() => _ForgotPsdPageState();
|
||||
}
|
||||
|
||||
class _ForgotPsdPageState extends State<ForgotPsdPage> {
|
||||
TextEditingController _telController = TextEditingController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_telController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '',
|
||||
backgroundColor: Colors.white,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
24.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
48.w.widthBox,
|
||||
'忘记密码'
|
||||
.text
|
||||
.size(36.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
16.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
48.w.widthBox,
|
||||
'为了安全,我们会向你的手机发送验证码'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
144.w.heightBox,
|
||||
TelTextField(controller: _telController),
|
||||
100.w.heightBox,
|
||||
LoginButtonWidget(
|
||||
onTap: _telController.text.isNotEmpty
|
||||
? () async {
|
||||
if (!RegexUtil.isMobileSimple(_telController.text)) {
|
||||
BotToast.showText(text: '请输入正确的手机号!');
|
||||
return;
|
||||
}
|
||||
var base = await SignFunc.sendForgotMessageCode(
|
||||
_telController.text,
|
||||
UserTool.appProvider.pickedCityAndCommunity!
|
||||
.communityModel!.id);
|
||||
if (base.success) {
|
||||
Get.to(() => ForgotSetPsdPage(
|
||||
tel: _telController.text,
|
||||
));
|
||||
UserTool.appProvider.startTimer();
|
||||
} else {
|
||||
BotToast.showText(text: base.msg);
|
||||
}
|
||||
}
|
||||
: null,
|
||||
text: '下一步'),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
import 'package:aku_new_community_manager/new_ui/auth/select_community_page.dart';
|
||||
import 'package:aku_new_community_manager/provider/app_provider.dart';
|
||||
import 'package:aku_new_community_manager/style/app_style.dart';
|
||||
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
import 'other_login_page.dart';
|
||||
|
||||
class LoginPage extends StatefulWidget {
|
||||
const LoginPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_LoginPageState createState() => _LoginPageState();
|
||||
}
|
||||
|
||||
class _LoginPageState extends State<LoginPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '',
|
||||
backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
44.w.heightBox,
|
||||
'登录解锁更多功能'.text.size(36.sp).color(kPrimaryColor).bold.make(),
|
||||
144.w.heightBox,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CommunityWidget(),
|
||||
80.w.heightBox,
|
||||
'${'1547***93018'}'
|
||||
.text
|
||||
.size(36.sp)
|
||||
.color(kTextPrimaryColor)
|
||||
.bold
|
||||
.make(),
|
||||
40.w.heightBox,
|
||||
MaterialButton(
|
||||
onPressed: () {},
|
||||
elevation: 0,
|
||||
height: 100.w,
|
||||
minWidth: 686.w,
|
||||
color: kPrimaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(60.w)),
|
||||
child: '本机号码一键登录'.text.size(32.sp).black.bold.make(),
|
||||
),
|
||||
24.w.heightBox,
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.to(() => OtherLoginPage());
|
||||
},
|
||||
child: Text(
|
||||
'其他登录方式',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF5096F1),
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
BottomTip(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BottomTip extends StatelessWidget {
|
||||
const BottomTip({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 100.w),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: kTextSubColor,
|
||||
),
|
||||
text: '注册/登记即代表同意',
|
||||
children: [
|
||||
WidgetSpan(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
//TODO:跳转隐私政策
|
||||
},
|
||||
child: '《小蜜蜂隐私政策及用户协议》'
|
||||
.text
|
||||
.size(24.sp)
|
||||
.color(Color(0xFF5096F1))
|
||||
.make(),
|
||||
)),
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CommunityWidget extends StatelessWidget {
|
||||
final MainAxisAlignment? align;
|
||||
|
||||
const CommunityWidget({
|
||||
Key? key,
|
||||
this.align,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AppProvider appProveider = Provider.of<AppProvider>(context, listen: true);
|
||||
var hasSelect = appProveider.pickedCityAndCommunity != null &&
|
||||
appProveider.pickedCityAndCommunity!.communityModel != null;
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
await Get.to(() => SelectCommunity());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: align ?? MainAxisAlignment.center,
|
||||
children: [
|
||||
(hasSelect
|
||||
? '${appProveider.pickedCityAndCommunity!.cityModel.district.name} ${appProveider.pickedCityAndCommunity!.communityModel!.name}'
|
||||
: '')
|
||||
.text
|
||||
.color(Colors.black)
|
||||
.make(),
|
||||
'${hasSelect ? ' 切换' : '请先选择小区'}'
|
||||
.text
|
||||
.size(32.sp)
|
||||
.color(Color(0xFF5096F1))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
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/tools/user_tool.dart';
|
||||
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
import 'code_message_page.dart';
|
||||
import 'forgot_psd_page.dart';
|
||||
import 'login_root_page.dart';
|
||||
|
||||
class OtherLoginPage extends StatefulWidget {
|
||||
const OtherLoginPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_OtherLoginPageState createState() => _OtherLoginPageState();
|
||||
}
|
||||
|
||||
class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
PageController _controller = PageController();
|
||||
List<String> _tabs = ['账号登录', '验证码登录'];
|
||||
int _currentIndex = 0;
|
||||
TextEditingController _tel = TextEditingController();
|
||||
TextEditingController _psd = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
_tel.dispose();
|
||||
_psd.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '',
|
||||
backgroundColor: Colors.white,
|
||||
body: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
24.w.widthBox,
|
||||
..._tabs
|
||||
.mapIndexed((e, index) => _tab(e, index, onTap: (value) {
|
||||
_currentIndex = value;
|
||||
_controller.jumpToPage(_currentIndex);
|
||||
setState(() {});
|
||||
}))
|
||||
.toList(),
|
||||
],
|
||||
),
|
||||
Flexible(
|
||||
child: PageView(
|
||||
controller: _controller,
|
||||
children: [_accountView(), _verificationView()],
|
||||
),
|
||||
),
|
||||
BottomTip(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _accountView() {
|
||||
return ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
children: [
|
||||
140.w.heightBox,
|
||||
CommunityWidget(
|
||||
align: MainAxisAlignment.start,
|
||||
),
|
||||
40.w.heightBox,
|
||||
TelTextField(
|
||||
controller: _tel,
|
||||
),
|
||||
40.w.heightBox,
|
||||
PsdTextField(
|
||||
controller: _psd,
|
||||
),
|
||||
100.w.heightBox,
|
||||
LoginButtonWidget(
|
||||
onTap: () async {
|
||||
var check = checkInput();
|
||||
if (!check) {
|
||||
return;
|
||||
}
|
||||
var cancel = BotToast.showLoading();
|
||||
var response = await SignFunc.login(
|
||||
_tel.text,
|
||||
_psd.text,
|
||||
UserTool
|
||||
.appProvider.pickedCityAndCommunity!.communityModel!.id);
|
||||
if (response.data['success']) {
|
||||
await UserTool.userProvider.setLogin(response.data['data']);
|
||||
await UserTool.dataProvider.addHistories();
|
||||
} else {
|
||||
BotToast.showText(text: response.data['message']);
|
||||
}
|
||||
cancel();
|
||||
},
|
||||
text: '登录'),
|
||||
24.w.heightBox,
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => ForgotPsdPage());
|
||||
},
|
||||
child: '忘记密码'.text.size(28.sp).color(Color(0xFF5096F1)).make())
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
bool checkInput() {
|
||||
if (!RegexUtil.isMobileSimple(_tel.text)) {
|
||||
BotToast.showText(text: '请输入正确的手机号!');
|
||||
return false;
|
||||
}
|
||||
if (UserTool.appProvider.pickedCityAndCommunity == null) {
|
||||
BotToast.showText(text: '请先选择小区!');
|
||||
return false;
|
||||
}
|
||||
if (_currentIndex == 0 && _psd.text.isEmpty) {
|
||||
BotToast.showText(text: '密码不能为空');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Widget _verificationView() {
|
||||
AppProvider appProvider = Provider.of<AppProvider>(context);
|
||||
return ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
children: [
|
||||
140.w.heightBox,
|
||||
CommunityWidget(
|
||||
align: MainAxisAlignment.start,
|
||||
),
|
||||
40.w.heightBox,
|
||||
TelTextField(controller: _tel),
|
||||
100.w.heightBox,
|
||||
LoginButtonWidget(
|
||||
onTap: UserTool.appProvider.second < 60
|
||||
? () {}
|
||||
: () async {
|
||||
var check = checkInput();
|
||||
if (!check) {
|
||||
return;
|
||||
}
|
||||
var base = await SignFunc.sendMessageCode(
|
||||
_tel.text,
|
||||
UserTool.appProvider.pickedCityAndCommunity!
|
||||
.communityModel!.id);
|
||||
if (base.success) {
|
||||
Get.to(() => CodeMessagePage(tel: _tel.text));
|
||||
appProvider.startTimer();
|
||||
} else {
|
||||
BotToast.showText(text: base.msg);
|
||||
}
|
||||
},
|
||||
text: appProvider.timerStart
|
||||
? '${appProvider.second}秒后重新获取'
|
||||
: '获取验证码'),
|
||||
24.w.heightBox,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
'未注册的手机验证后会自动创建账号'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _tab(String text, int index, {required Function(int) onTap}) {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () => onTap(index),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
|
||||
alignment: Alignment.center,
|
||||
child: text.text
|
||||
.size(_currentIndex == index ? 36.sp : 32.sp)
|
||||
.lineHeight(_currentIndex == index ? 1.2 : 1.2)
|
||||
.color(
|
||||
Colors.black.withOpacity(_currentIndex == index ? 0.65 : 0.45))
|
||||
.make(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
enum PSDVERIFY { shorLength, Insufficient, different, correct, empty }
|
||||
|
||||
class PsdVerify {
|
||||
//检测含有字母、数字、符号中两种的正则表达式
|
||||
static String reg = r'^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).*';
|
||||
static PSDVERIFY check(String psd, String confirmPsd) {
|
||||
if (psd.isEmpty || confirmPsd.isEmpty) {
|
||||
return PSDVERIFY.empty;
|
||||
} else if (psd != confirmPsd) {
|
||||
return PSDVERIFY.different;
|
||||
} else if (psd.length < 6) {
|
||||
return PSDVERIFY.shorLength;
|
||||
} else if (!RegexUtil.matches(reg, psd)) {
|
||||
return PSDVERIFY.Insufficient;
|
||||
} else {
|
||||
return PSDVERIFY.correct;
|
||||
}
|
||||
}
|
||||
|
||||
static String checkString(PSDVERIFY enu) {
|
||||
switch (enu) {
|
||||
case PSDVERIFY.shorLength:
|
||||
return '密码不能小于6位';
|
||||
case PSDVERIFY.Insufficient:
|
||||
return '密码至少由两种类型组成';
|
||||
case PSDVERIFY.different:
|
||||
return '您输入的确认密码和新密码不一致,请检查后重新输入';
|
||||
case PSDVERIFY.correct:
|
||||
return '';
|
||||
case PSDVERIFY.empty:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,194 @@
|
||||
import 'package:aku_new_community_manager/const/saas_api.dart';
|
||||
import 'package:aku_new_community_manager/saas_models/login/community_model.dart';
|
||||
import 'package:aku_new_community_manager/saas_models/login/history_login_model.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/bee_city_picker.dart';
|
||||
import 'package:aku_new_community_manager/ui/widgets/common/bee_community_picker.dart';
|
||||
import 'package:aku_new_community_manager/utils/network/net_util.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class SelectCommunity extends StatefulWidget {
|
||||
const SelectCommunity({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SelectCommunityState createState() => _SelectCommunityState();
|
||||
}
|
||||
|
||||
class _SelectCommunityState extends State<SelectCommunity> {
|
||||
String get cityName {
|
||||
var _model = UserTool.appProvider.pickedCityAndCommunity;
|
||||
if (_model == null) {
|
||||
return '请选择省、市、县/区';
|
||||
} else {
|
||||
return _model.cityModel.province.name +
|
||||
_model.cityModel.city.name +
|
||||
_model.cityModel.district.name;
|
||||
}
|
||||
}
|
||||
|
||||
String get communityName {
|
||||
var _community =
|
||||
UserTool.appProvider.pickedCityAndCommunity?.communityModel;
|
||||
if (_community == null) {
|
||||
return '请选择小区';
|
||||
} else {
|
||||
return _community.name;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void deactivate() {
|
||||
Future.delayed(Duration(milliseconds: 0), () async {
|
||||
if (UserTool.appProvider.pickedCityAndCommunity != null &&
|
||||
UserTool.appProvider.pickedCityAndCommunity?.communityModel == null) {
|
||||
UserTool.appProvider.resetPickedCity();
|
||||
}
|
||||
});
|
||||
super.deactivate();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var selectCity = GestureDetector(
|
||||
onTap: () async {
|
||||
var _city = await BeeCityPicker.pick(context);
|
||||
if (_city != null) {
|
||||
UserTool.appProvider.setPickedCity(city: _city);
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
width: double.infinity,
|
||||
height: 88.w,
|
||||
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||
child: Row(
|
||||
children: [
|
||||
'选择城市'.text.size(28.sp).black.make(),
|
||||
Spacer(),
|
||||
'${cityName}'.text.black.make(),
|
||||
32.w.widthBox,
|
||||
Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
var selectCommunity = GestureDetector(
|
||||
onTap: () async {
|
||||
var cancel = BotToast.showLoading();
|
||||
List<CommunityModel> _communities = [];
|
||||
var base = await NetUtil().get(SAASAPI.login.allCommunity, params: {
|
||||
'cityId': UserTool
|
||||
.appProvider.pickedCityAndCommunity!.cityModel.district.id,
|
||||
});
|
||||
if (base.success) {
|
||||
_communities = (base.data as List)
|
||||
.map((e) => CommunityModel.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
cancel();
|
||||
var _community = await BeeCommunityPicker.pick(context, _communities);
|
||||
print(_community?.name);
|
||||
if (_community != null) {
|
||||
UserTool.appProvider.setPickedCity(community: _community);
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
width: double.infinity,
|
||||
height: 88.w,
|
||||
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||
child: Row(
|
||||
children: [
|
||||
'选择小区'.text.size(28.sp).black.make(),
|
||||
Spacer(),
|
||||
'${communityName}'.text.black.make(),
|
||||
32.w.widthBox,
|
||||
Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
var history = Offstage(
|
||||
offstage: UserTool.dataProvider.loginHistories.length == 0,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'历史登录'.text.size(28.sp).color(Colors.black.withOpacity(0.2)).make(),
|
||||
24.w.widthBox,
|
||||
...UserTool.dataProvider.loginHistories
|
||||
.map((e) => _historyTile(e))
|
||||
.toList(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
var bool = UserTool.appProvider.pickedCityAndCommunity != null &&
|
||||
UserTool.appProvider.pickedCityAndCommunity?.communityModel == null;
|
||||
if (bool) {
|
||||
BotToast.showText(text: '请选择小区');
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
child: AkuScaffold(
|
||||
title: '选择登录小区',
|
||||
body: ListView(
|
||||
children: [
|
||||
selectCity,
|
||||
selectCommunity,
|
||||
10.w.heightBox,
|
||||
history,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _historyTile(HistoryLoginModel model) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
CupertinoIcons.search,
|
||||
size: 30.w,
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
),
|
||||
24.w.widthBox,
|
||||
'${model.communityModel!.name}(${model.cityModel.province.name}·${model.cityModel.city.name}·${model.cityModel.district.name})'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.2))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import 'package:aku_new_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LoginButtonWidget extends StatelessWidget {
|
||||
final VoidCallback? onTap;
|
||||
final String text;
|
||||
const LoginButtonWidget({Key? key, required this.onTap, required this.text})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
minWidth: 686.w,
|
||||
height: 97.w,
|
||||
onPressed: onTap,
|
||||
elevation: 0,
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
),
|
||||
),
|
||||
disabledTextColor: Colors.black.withOpacity(0.45),
|
||||
disabledColor: Colors.black.withOpacity(0.06),
|
||||
color: kPrimaryColor,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(60.w)),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
class PsdTextField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String? hintText;
|
||||
|
||||
const PsdTextField({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
this.hintText,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PsdTextFieldState createState() => _PsdTextFieldState();
|
||||
}
|
||||
|
||||
class _PsdTextFieldState extends State<PsdTextField> {
|
||||
bool visible = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 686.w,
|
||||
height: 94.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(60.w),
|
||||
color: Colors.black.withOpacity(0.06),
|
||||
),
|
||||
child: TextField(
|
||||
maxLength: 20,
|
||||
onChanged: (text) {
|
||||
setState(() {});
|
||||
},
|
||||
controller: widget.controller,
|
||||
obscureText: !visible,
|
||||
obscuringCharacter: '*',
|
||||
decoration: InputDecoration(
|
||||
isDense: false,
|
||||
contentPadding:
|
||||
EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
|
||||
border: InputBorder.none,
|
||||
hintText: widget.hintText ?? '请输入密码',
|
||||
counterText: '',
|
||||
suffixIconConstraints:
|
||||
BoxConstraints(minHeight: 50.w, maxHeight: 50.w),
|
||||
suffixIcon: GestureDetector(
|
||||
onTap: () {
|
||||
visible = !visible;
|
||||
setState(() {});
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 20.w),
|
||||
child: Icon(
|
||||
visible ? CupertinoIcons.eye : CupertinoIcons.eye_slash,
|
||||
color: Colors.black.withOpacity(0.4),
|
||||
),
|
||||
),
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.black.withOpacity(0.25), fontSize: 28.sp)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
import 'package:aku_new_community_manager/const/saas_api.dart';
|
||||
import 'package:aku_new_community_manager/saas_models/login/china_region_model.dart';
|
||||
import 'package:aku_new_community_manager/saas_models/login/history_login_model.dart';
|
||||
import 'package:aku_new_community_manager/tools/user_tool.dart';
|
||||
import 'package:aku_new_community_manager/utils/hive_store.dart';
|
||||
import 'package:aku_new_community_manager/utils/network/net_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DataProvider extends ChangeNotifier {
|
||||
Future init() async {
|
||||
_loginHistories = HiveStore.dataBox!
|
||||
.get('historyLogin')
|
||||
?.cast<HistoryLoginModel>()
|
||||
.toList() ??
|
||||
[];
|
||||
_cityModel =
|
||||
HiveStore.dataBox!.get('cities')?.cast<ChinaRegionModel>().toList() ??
|
||||
[];
|
||||
if (_cityModel.isEmpty) {
|
||||
updateCityList();
|
||||
}
|
||||
}
|
||||
|
||||
List<ChinaRegionModel> _cityModel = [];
|
||||
|
||||
List<ChinaRegionModel> get cityModel => _cityModel;
|
||||
|
||||
Future<bool> updateCityList() async {
|
||||
var model = await NetUtil().get(SAASAPI.city.allCity);
|
||||
if (model.success) {
|
||||
_cityModel = (model.data as List)
|
||||
.map((e) => ChinaRegionModel.fromJson(e))
|
||||
.toList();
|
||||
HiveStore.dataBox!.put('cities', _cityModel);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
List<HistoryLoginModel> _loginHistories = [];
|
||||
|
||||
List<HistoryLoginModel> get loginHistories => _loginHistories;
|
||||
|
||||
Future addHistories() async {
|
||||
_loginHistories.insert(0, UserTool.appProvider.pickedCityAndCommunity!);
|
||||
if (_loginHistories.length > 4) {
|
||||
_loginHistories.removeAt(_loginHistories.length - 1);
|
||||
}
|
||||
HiveStore.dataBox!.put('historyLogin', _loginHistories);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'china_region_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@HiveType(typeId: 3)
|
||||
class ChinaRegionModel extends Equatable {
|
||||
@HiveField(0)
|
||||
final int id;
|
||||
@HiveField(1)
|
||||
final String name;
|
||||
@HiveField(2)
|
||||
final int parentId;
|
||||
@HiveField(3)
|
||||
final List<ChinaRegionModel>? cityList;
|
||||
|
||||
factory ChinaRegionModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ChinaRegionModelFromJson(json);
|
||||
|
||||
static ChinaRegionModel empty(int parentId) {
|
||||
return ChinaRegionModel(id: 0, name: '', cityList: [], parentId: 0);
|
||||
}
|
||||
|
||||
ChinaRegionModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.parentId,
|
||||
this.cityList,
|
||||
});
|
||||
@override
|
||||
List<Object?> get props => [id, name, parentId, cityList];
|
||||
|
||||
ChinaRegionModel copyWith({
|
||||
int? id,
|
||||
String? name,
|
||||
int? parentId,
|
||||
List<ChinaRegionModel>? cityList,
|
||||
}) {
|
||||
return ChinaRegionModel(
|
||||
id: id ?? this.id,
|
||||
name: name ?? this.name,
|
||||
parentId: parentId ?? this.parentId,
|
||||
cityList: cityList ?? this.cityList,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'china_region_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class ChinaRegionModelAdapter extends TypeAdapter<ChinaRegionModel> {
|
||||
@override
|
||||
final int typeId = 3;
|
||||
|
||||
@override
|
||||
ChinaRegionModel read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return ChinaRegionModel(
|
||||
id: fields[0] as int,
|
||||
name: fields[1] as String,
|
||||
parentId: fields[2] as int,
|
||||
cityList: (fields[3] as List?)?.cast<ChinaRegionModel>(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, ChinaRegionModel obj) {
|
||||
writer
|
||||
..writeByte(4)
|
||||
..writeByte(0)
|
||||
..write(obj.id)
|
||||
..writeByte(1)
|
||||
..write(obj.name)
|
||||
..writeByte(2)
|
||||
..write(obj.parentId)
|
||||
..writeByte(3)
|
||||
..write(obj.cityList);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ChinaRegionModelAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ChinaRegionModel _$ChinaRegionModelFromJson(Map<String, dynamic> json) =>
|
||||
ChinaRegionModel(
|
||||
id: json['id'] as int,
|
||||
name: json['name'] as String,
|
||||
parentId: json['parentId'] as int,
|
||||
cityList: (json['cityList'] as List<dynamic>?)
|
||||
?.map((e) => ChinaRegionModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
@ -0,0 +1,28 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'community_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class CommunityModel extends Equatable {
|
||||
final int id;
|
||||
final String name;
|
||||
final String address;
|
||||
final String addressDetails;
|
||||
factory CommunityModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$CommunityModelFromJson(json);
|
||||
|
||||
const CommunityModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.address,
|
||||
required this.addressDetails,
|
||||
});
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
name,
|
||||
address,
|
||||
addressDetails,
|
||||
];
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'community_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CommunityModel _$CommunityModelFromJson(Map<String, dynamic> json) =>
|
||||
CommunityModel(
|
||||
id: json['id'] as int,
|
||||
name: json['name'] as String,
|
||||
address: json['address'] as String,
|
||||
addressDetails: json['addressDetails'] as String,
|
||||
);
|
@ -0,0 +1,27 @@
|
||||
import 'package:aku_new_community_manager/saas_models/login/picked_city_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'community_model.dart';
|
||||
|
||||
part 'history_login_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@HiveType(typeId: 4)
|
||||
class HistoryLoginModel extends Equatable {
|
||||
@HiveField(0)
|
||||
PickedCityModel cityModel;
|
||||
@HiveField(1)
|
||||
CommunityModel? communityModel;
|
||||
factory HistoryLoginModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$HistoryLoginModelFromJson(json);
|
||||
|
||||
HistoryLoginModel({
|
||||
required this.cityModel,
|
||||
this.communityModel,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [cityModel, communityModel];
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'history_login_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class HistoryLoginModelAdapter extends TypeAdapter<HistoryLoginModel> {
|
||||
@override
|
||||
final int typeId = 4;
|
||||
|
||||
@override
|
||||
HistoryLoginModel read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return HistoryLoginModel(
|
||||
cityModel: fields[0] as PickedCityModel,
|
||||
communityModel: fields[1] as CommunityModel?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, HistoryLoginModel obj) {
|
||||
writer
|
||||
..writeByte(2)
|
||||
..writeByte(0)
|
||||
..write(obj.cityModel)
|
||||
..writeByte(1)
|
||||
..write(obj.communityModel);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is HistoryLoginModelAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
HistoryLoginModel _$HistoryLoginModelFromJson(Map<String, dynamic> json) =>
|
||||
HistoryLoginModel(
|
||||
cityModel:
|
||||
PickedCityModel.fromJson(json['cityModel'] as Map<String, dynamic>),
|
||||
communityModel: json['communityModel'] == null
|
||||
? null
|
||||
: CommunityModel.fromJson(
|
||||
json['communityModel'] as Map<String, dynamic>),
|
||||
);
|
@ -0,0 +1,53 @@
|
||||
import 'package:aku_new_community_manager/utils/hive_store.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'china_region_model.dart';
|
||||
|
||||
part 'picked_city_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@HiveType(typeId: 6)
|
||||
class PickedCityModel extends Equatable {
|
||||
@HiveField(0)
|
||||
final ChinaRegionModel province;
|
||||
@HiveField(1)
|
||||
final ChinaRegionModel city;
|
||||
@HiveField(2)
|
||||
final ChinaRegionModel district;
|
||||
|
||||
factory PickedCityModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$PickedCityModelFromJson(json);
|
||||
|
||||
const PickedCityModel({
|
||||
required this.province,
|
||||
required this.city,
|
||||
required this.district,
|
||||
});
|
||||
|
||||
factory PickedCityModel.fromId(
|
||||
{required int provinceId, required int cityId, required int distrctId}) {
|
||||
var provinces =
|
||||
HiveStore.dataBox!.get('cities').cast<ChinaRegionModel>().toList();
|
||||
final _province =
|
||||
provinces.firstWhere((element) => element.id == provinceId);
|
||||
final _city =
|
||||
_province.cityList.firstWhere((element) => element.id == cityId);
|
||||
final _district =
|
||||
_city.cityList.firstWhere((element) => element.id == distrctId);
|
||||
|
||||
return PickedCityModel(
|
||||
province: _province,
|
||||
city: _city,
|
||||
district: _district,
|
||||
);
|
||||
}
|
||||
|
||||
String get address => province.name + city.name + district.name;
|
||||
|
||||
int get id => district.id;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [province, city, district];
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'picked_city_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class PickedCityModelAdapter extends TypeAdapter<PickedCityModel> {
|
||||
@override
|
||||
final int typeId = 6;
|
||||
|
||||
@override
|
||||
PickedCityModel read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return PickedCityModel(
|
||||
province: fields[0] as ChinaRegionModel,
|
||||
city: fields[1] as ChinaRegionModel,
|
||||
district: fields[2] as ChinaRegionModel,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, PickedCityModel obj) {
|
||||
writer
|
||||
..writeByte(3)
|
||||
..writeByte(0)
|
||||
..write(obj.province)
|
||||
..writeByte(1)
|
||||
..write(obj.city)
|
||||
..writeByte(2)
|
||||
..write(obj.district);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is PickedCityModelAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PickedCityModel _$PickedCityModelFromJson(Map<String, dynamic> json) =>
|
||||
PickedCityModel(
|
||||
province:
|
||||
ChinaRegionModel.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: ChinaRegionModel.fromJson(json['city'] as Map<String, dynamic>),
|
||||
district:
|
||||
ChinaRegionModel.fromJson(json['district'] as Map<String, dynamic>),
|
||||
);
|
@ -0,0 +1,29 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'base_list_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class BaseListModel {
|
||||
final int pages;
|
||||
final List<dynamic> rows;
|
||||
final int total;
|
||||
|
||||
BaseListModel.zero({
|
||||
this.total = 0,
|
||||
this.pages = 0,
|
||||
this.rows = const [],
|
||||
});
|
||||
|
||||
BaseListModel.err({
|
||||
this.pages = 0,
|
||||
this.total = 0,
|
||||
this.rows = const [],
|
||||
});
|
||||
factory BaseListModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$BaseListModelFromJson(json);
|
||||
const BaseListModel({
|
||||
required this.pages,
|
||||
required this.rows,
|
||||
required this.total,
|
||||
});
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'base_list_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BaseListModel _$BaseListModelFromJson(Map<String, dynamic> json) =>
|
||||
BaseListModel(
|
||||
pages: json['pages'] as int,
|
||||
rows: json['rows'] as List<dynamic>,
|
||||
total: json['total'] as int,
|
||||
);
|
@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'base_model.g.dart';
|
||||
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class BaseModel {
|
||||
final int code;
|
||||
final String msg;
|
||||
final bool success;
|
||||
final dynamic data;
|
||||
|
||||
factory BaseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$BaseModelFromJson(json);
|
||||
|
||||
static BaseModel error(
|
||||
{String? message, bool? success, dynamic data, int? code}) =>
|
||||
BaseModel(
|
||||
code: code ?? 0, msg: message ?? '未知错误', success: success ?? false);
|
||||
|
||||
BaseModel({
|
||||
required this.code,
|
||||
required this.msg,
|
||||
required this.success,
|
||||
this.data,
|
||||
});
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'base_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BaseModel _$BaseModelFromJson(Map<String, dynamic> json) => BaseModel(
|
||||
code: json['code'] as int,
|
||||
msg: json['msg'] as String,
|
||||
success: json['success'] as bool,
|
||||
data: json['data'],
|
||||
);
|
@ -0,0 +1,58 @@
|
||||
import 'package:aku_new_community_manager/models/common/img_model.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'user_info_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class UserInfoModel {
|
||||
final int id;
|
||||
final int communityId;
|
||||
final String communityCode;
|
||||
final String? name;
|
||||
final String? idCard;
|
||||
final String tel;
|
||||
|
||||
// 性别 1.男 2.女 3.保密
|
||||
final int? sex;
|
||||
final String? nickName;
|
||||
final bool isExistPassword;
|
||||
final bool isPointsSignSetting;
|
||||
final bool isSign;
|
||||
final int? points;
|
||||
final List<ImgModel> imgList;
|
||||
|
||||
String get sexValue {
|
||||
if (sex == 1) return '男';
|
||||
if (sex == 2) return '女';
|
||||
if (sex == 3) return '保密';
|
||||
return '未设置';
|
||||
}
|
||||
|
||||
// DateTime? get birthdayDate => DateUtil.getDateTime(birthday ?? '');
|
||||
|
||||
// String get birthdayValue {
|
||||
// if (TextUtil.isEmpty(birthday))
|
||||
// return '未设置';
|
||||
// else
|
||||
// return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd');
|
||||
// }
|
||||
|
||||
factory UserInfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserInfoModelFromJson(json);
|
||||
|
||||
const UserInfoModel({
|
||||
required this.id,
|
||||
required this.communityId,
|
||||
required this.communityCode,
|
||||
this.name,
|
||||
this.idCard,
|
||||
required this.tel,
|
||||
this.sex,
|
||||
this.nickName,
|
||||
required this.isExistPassword,
|
||||
required this.isPointsSignSetting,
|
||||
required this.isSign,
|
||||
this.points,
|
||||
required this.imgList,
|
||||
});
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
|
||||
UserInfoModel(
|
||||
id: json['id'] as int,
|
||||
communityId: json['communityId'] as int,
|
||||
communityCode: json['communityCode'] as String,
|
||||
name: json['name'] as String?,
|
||||
idCard: json['idCard'] as String?,
|
||||
tel: json['tel'] as String,
|
||||
sex: json['sex'] as int?,
|
||||
nickName: json['nickName'] as String?,
|
||||
isExistPassword: json['isExistPassword'] as bool,
|
||||
isPointsSignSetting: json['isPointsSignSetting'] as bool,
|
||||
isSign: json['isSign'] as bool,
|
||||
points: json['points'] as int?,
|
||||
imgList: (json['imgList'] as List<dynamic>)
|
||||
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue