Merge branch 'master' of http://test.akuhotel.com:8099/zhangmeng/aku_community_manager
@ -1,47 +1,30 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.akucommunity.aku_community_manager">
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.akucommunity.aku_community_manager">
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="aku_community_manager"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
<application android:name="io.flutter.app.FlutterApplication" android:label="aku_community_manager" android:icon="@mipmap/ic_launcher">
|
||||
<meta-data android:name="com.amap.api.v2.apikey" android:value="872b909f2ebc8150b809d692c4349f22"/>
|
||||
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<!-- Displays an Android View that continues showing the launch screen
|
||||
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
|
||||
<!-- Displays an Android View that continues showing the launch screen
|
||||
Drawable until Flutter paints its first frame, then this splash
|
||||
screen fades out. A splash screen is useful to avoid any visual
|
||||
gap between the end of Android's launch screen and the painting of
|
||||
Flutter's first frame. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.SplashScreenDrawable"
|
||||
android:resource="@drawable/launch_background"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
||||
</application>
|
||||
</manifest>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 807 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 32 KiB |
@ -0,0 +1,92 @@
|
||||
import 'package:aku_community_manager/const/resource.dart';
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
|
||||
class BorrowData {
|
||||
static List<BorrowModel> get checkModels => models.where((e) {
|
||||
return e.borrowGoods.status == BORROW_STATUS.WAIT_CHECK;
|
||||
}).toList();
|
||||
static List<BorrowModel> get borrowModels => models.where((e) {
|
||||
return e.borrowGoods.status == BORROW_STATUS.BORROWING;
|
||||
}).toList();
|
||||
|
||||
static List<BorrowModel> get doneModels => models.where((e) {
|
||||
return e.borrowGoods.status == BORROW_STATUS.DONE;
|
||||
}).toList();
|
||||
|
||||
static List<BorrowModel> models = [
|
||||
BorrowModel(
|
||||
title: '归还梯子一个',
|
||||
borrowPerson: '李慧珍',
|
||||
borrowTime: 5,
|
||||
goodsStatus: GOODS_STATUS.BROKEN,
|
||||
phone: '19981712931',
|
||||
borrowGoods: SingleBorrowGoods(
|
||||
name: '梯子',
|
||||
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
|
||||
code: '3193713894',
|
||||
status: BORROW_STATUS.WAIT_CHECK,
|
||||
),
|
||||
date: DateTime(2020, 5, 5, 12, 35, 45),
|
||||
),
|
||||
BorrowModel(
|
||||
title: '归还梯子一个',
|
||||
borrowPerson: '李慧珍',
|
||||
borrowTime: 5,
|
||||
goodsStatus: GOODS_STATUS.BROKEN,
|
||||
phone: '19981712931',
|
||||
borrowGoods: SingleBorrowGoods(
|
||||
name: '梯子',
|
||||
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
|
||||
code: '3193713894',
|
||||
status: BORROW_STATUS.DONE,
|
||||
),
|
||||
date: DateTime(2020, 5, 5, 12, 35, 45),
|
||||
),
|
||||
BorrowModel(
|
||||
title: '借用电钻一把',
|
||||
borrowPerson: '刘虎门',
|
||||
borrowTime: 12,
|
||||
goodsStatus: GOODS_STATUS.NORMAL,
|
||||
phone: '19981738879',
|
||||
borrowGoods: SingleBorrowGoods(
|
||||
name: '电钻',
|
||||
assetpath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
|
||||
code: '31937293841',
|
||||
status: BORROW_STATUS.BORROWING,
|
||||
),
|
||||
date: DateTime(2020, 4, 5, 12, 35, 45),
|
||||
),
|
||||
BorrowModel(
|
||||
borrowPerson: '刘海保',
|
||||
borrowTime: 5,
|
||||
title: '借用榔头一把',
|
||||
goodsStatus: GOODS_STATUS.NORMAL,
|
||||
phone: '19981738879',
|
||||
borrowGoods: SingleBorrowGoods(
|
||||
name: '榔头',
|
||||
assetpath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
|
||||
code: '3193794102481',
|
||||
status: BORROW_STATUS.BORROWING,
|
||||
),
|
||||
date: DateTime(2020, 3, 5, 12, 35, 45),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BorrowObject> borrowObjects = [
|
||||
BorrowObject.init(
|
||||
name: '电钻',
|
||||
assetPath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
|
||||
allNumber: 5,
|
||||
),
|
||||
BorrowObject.init(
|
||||
name: '梯子',
|
||||
assetPath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
|
||||
allNumber: 3,
|
||||
),
|
||||
BorrowObject.init(
|
||||
name: '三角榔头',
|
||||
assetPath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
|
||||
allNumber: 8,
|
||||
),
|
||||
];
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
enum BORROW_STATUS {
|
||||
///出借中
|
||||
BORROWING,
|
||||
|
||||
///待检查
|
||||
WAIT_CHECK,
|
||||
|
||||
///未出借
|
||||
NOT_BORROW,
|
||||
|
||||
///已归还
|
||||
DONE,
|
||||
}
|
||||
|
||||
enum GOODS_STATUS {
|
||||
NORMAL,
|
||||
BROKEN,
|
||||
LOST,
|
||||
}
|
||||
|
||||
class BorrowModel {
|
||||
String borrowPerson;
|
||||
String phone;
|
||||
int borrowTime;
|
||||
GOODS_STATUS goodsStatus;
|
||||
String title;
|
||||
SingleBorrowGoods borrowGoods;
|
||||
DateTime date;
|
||||
|
||||
BorrowModel({
|
||||
@required this.borrowPerson,
|
||||
@required this.phone,
|
||||
@required this.borrowTime,
|
||||
@required this.goodsStatus,
|
||||
@required this.borrowGoods,
|
||||
@required this.title,
|
||||
@required this.date,
|
||||
});
|
||||
}
|
||||
|
||||
class BorrowObject {
|
||||
String name;
|
||||
int allNumber;
|
||||
dynamic assetPath;
|
||||
int borrowNumber;
|
||||
int get restNumber => allNumber - borrowNumber;
|
||||
List<SingleBorrowGoods> items;
|
||||
|
||||
BorrowObject.init({
|
||||
this.name,
|
||||
this.allNumber,
|
||||
this.assetPath,
|
||||
}) {
|
||||
this.borrowNumber = 0;
|
||||
items = List.generate(
|
||||
this.allNumber,
|
||||
(index) => SingleBorrowGoods(
|
||||
name: '${this.name}${index + 1}',
|
||||
code: (179264234 + Random().nextInt(999999)).toString(),
|
||||
status: BORROW_STATUS.NOT_BORROW,
|
||||
assetpath: this.assetPath,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SingleBorrowGoods {
|
||||
String name;
|
||||
String code;
|
||||
dynamic assetpath;
|
||||
BORROW_STATUS status;
|
||||
String get borrowValue => {
|
||||
BORROW_STATUS.BORROWING: '出借中',
|
||||
BORROW_STATUS.DONE: '已归还',
|
||||
BORROW_STATUS.NOT_BORROW: '未出借',
|
||||
BORROW_STATUS.WAIT_CHECK: '待检查',
|
||||
}[status];
|
||||
SingleBorrowGoods({
|
||||
this.name,
|
||||
this.code,
|
||||
this.assetpath,
|
||||
this.status,
|
||||
});
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AgreementPage extends StatelessWidget {
|
||||
const AgreementPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '服务协议',
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrivacyPage extends StatelessWidget {
|
||||
const PrivacyPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '隐私协议',
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AddBorrowItemPage extends StatefulWidget {
|
||||
final BorrowObject object;
|
||||
AddBorrowItemPage({Key key, @required this.object}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddBorrowItemPageState createState() => _AddBorrowItemPageState();
|
||||
}
|
||||
|
||||
class _AddBorrowItemPageState extends State<AddBorrowItemPage> {
|
||||
TextEditingController _textEditingController = TextEditingController();
|
||||
String code = '';
|
||||
File file;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
code = (10000000 + Random().nextInt(999999)).toString();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '物品详情',
|
||||
actions: [
|
||||
AkuMaterialButton(
|
||||
minWidth: 120.w,
|
||||
onPressed: () {
|
||||
if (TextUtil.isEmpty(_textEditingController.text)) {
|
||||
BotToast.showText(text: '名称不能为空');
|
||||
} else if (file == null) {
|
||||
BotToast.showText(text: '图片不能为空');
|
||||
} else {
|
||||
widget.object.items.insert(
|
||||
0,
|
||||
SingleBorrowGoods(
|
||||
name: _textEditingController.text,
|
||||
code: code,
|
||||
assetpath: file,
|
||||
status: BORROW_STATUS.NOT_BORROW,
|
||||
));
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'完成',
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(
|
||||
'物品名称',
|
||||
TextField(
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
controller: _textEditingController,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '请输入物品名称',
|
||||
),
|
||||
)),
|
||||
Divider(height: 1.w),
|
||||
_buildRow(
|
||||
'物品单号',
|
||||
Text(
|
||||
code,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
_buildRow(
|
||||
'物品图片',
|
||||
file == null
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
akuPickImage().then((value) {
|
||||
if (value != null) file = value;
|
||||
setState(() {});
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.image,
|
||||
size: 60.w,
|
||||
color: AppStyle.minorTextColor,
|
||||
),
|
||||
Text(
|
||||
'上传图片',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 22.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
border: Border.all(
|
||||
width: 1.w,
|
||||
color: AppStyle.minorTextColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.file(
|
||||
file,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
AkuBox.h(28),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(String title, Widget child) {
|
||||
return Row(
|
||||
children: [
|
||||
AkuBox.h(96),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
AkuBox.w(80),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AddBorrowObjectPage extends StatefulWidget {
|
||||
AddBorrowObjectPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddBorrowObjectPageState createState() => _AddBorrowObjectPageState();
|
||||
}
|
||||
|
||||
class _AddBorrowObjectPageState extends State<AddBorrowObjectPage> {
|
||||
TextEditingController _textEditingController = TextEditingController();
|
||||
TextEditingController _numberController = TextEditingController();
|
||||
File file;
|
||||
List<BorrowObject> get objects => BorrowData.borrowObjects;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final userProvider = Provider.of<UserProvider>(context);
|
||||
return AkuScaffold(
|
||||
title: '物品详情',
|
||||
actions: [
|
||||
userProvider.userInfoModel.role != USER_ROLE.MANAGER
|
||||
? AkuMaterialButton(
|
||||
minWidth: 120.w,
|
||||
onPressed: () {
|
||||
if (TextUtil.isEmpty(_textEditingController.text)) {
|
||||
BotToast.showText(text: '名称不能为空');
|
||||
} else if (file == null) {
|
||||
BotToast.showText(text: '图片不能为空');
|
||||
} else if (int.tryParse(_numberController.text) == null) {
|
||||
BotToast.showText(text: '数量错误');
|
||||
} else {
|
||||
objects.insert(
|
||||
0,
|
||||
BorrowObject.init(
|
||||
name: _textEditingController.text,
|
||||
allNumber: int.parse(_numberController.text),
|
||||
assetPath: file,
|
||||
),
|
||||
);
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'完成',
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(
|
||||
'总类名称',
|
||||
TextField(
|
||||
onChanged: (_) {
|
||||
setState(() {});
|
||||
},
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
controller: _textEditingController,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '请输入总类名称',
|
||||
),
|
||||
)),
|
||||
Divider(height: 1.w),
|
||||
_buildRow(
|
||||
'物品数量',
|
||||
TextField(
|
||||
onChanged: (_) {
|
||||
setState(() {});
|
||||
},
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
controller: _numberController,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '请输入物品数量',
|
||||
),
|
||||
)),
|
||||
Divider(height: 1.w),
|
||||
AkuBox.h(24),
|
||||
_buildRow(
|
||||
'物品图片',
|
||||
file == null
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
akuPickImage().then((value) {
|
||||
if (value != null) file = value;
|
||||
setState(() {});
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.image,
|
||||
size: 60.w,
|
||||
color: AppStyle.minorTextColor,
|
||||
),
|
||||
Text(
|
||||
'上传图片',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 22.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
border: Border.all(
|
||||
width: 1.w,
|
||||
color: AppStyle.minorTextColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.file(
|
||||
file,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
AkuBox.h(28),
|
||||
],
|
||||
),
|
||||
),
|
||||
AkuBox.h(470),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 64.w),
|
||||
child: AkuBottomButton(
|
||||
title: '确定',
|
||||
onTap: TextUtil.isEmpty(_textEditingController.text) ||
|
||||
TextUtil.isEmpty(_numberController.text) ||
|
||||
file == null ||
|
||||
int.tryParse(_numberController.text) == null
|
||||
? null
|
||||
: () {
|
||||
BorrowData.borrowObjects.add(
|
||||
BorrowObject.init(
|
||||
name: _textEditingController.text,
|
||||
allNumber: int.parse(_numberController.text),
|
||||
assetPath: file,
|
||||
),
|
||||
);
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(String title, Widget child) {
|
||||
return Row(
|
||||
children: [
|
||||
AkuBox.h(96),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
AkuBox.w(80),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_object_page.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_items_page.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:aku_community_manager/const/resource.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AllBorrowGoods extends StatefulWidget {
|
||||
AllBorrowGoods({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AllBorrowGoodsState createState() => _AllBorrowGoodsState();
|
||||
}
|
||||
|
||||
class _AllBorrowGoodsState extends State<AllBorrowGoods> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final userProvider = Provider.of<UserProvider>(context);
|
||||
return AkuScaffold(
|
||||
title: '全部物品',
|
||||
actions: [
|
||||
userProvider.userInfoModel.role == USER_ROLE.MANAGER
|
||||
? AkuMaterialButton(
|
||||
minWidth: 120.w,
|
||||
onPressed: () {
|
||||
Get.to(AddBorrowObjectPage());
|
||||
},
|
||||
child: Text(
|
||||
'新增',
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
body: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 32.w,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildCard(BorrowData.borrowObjects[index]);
|
||||
},
|
||||
itemCount: BorrowData.borrowObjects.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildCard(BorrowObject object) {
|
||||
return GestureDetector(
|
||||
onTap: () => Get.to(BorrowItemPage(object: object)),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(24.w),
|
||||
margin: EdgeInsets.only(top: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(4.w),
|
||||
child: (object.assetPath is String)
|
||||
? Image.asset(
|
||||
object.assetPath,
|
||||
width: 184.w,
|
||||
height: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
object.assetPath,
|
||||
width: 184.w,
|
||||
height: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
AkuBox.w(24),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(R.ASSETS_MANAGE_ARTICLE_PNG, '物品名称', object.name),
|
||||
AkuBox.h(12),
|
||||
_buildRow(R.ASSETS_MANAGE_BORROW_PNG, '借出数量',
|
||||
object.borrowNumber.toString()),
|
||||
AkuBox.h(12),
|
||||
_buildRow(R.ASSETS_MANAGE_REMAINING_PNG, '剩余数量',
|
||||
object.items.length.toString()),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(String assetPath, String title, String subTitle) {
|
||||
return Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
assetPath,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
'$title\:',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
subTitle,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BorrowItemDetailPage extends StatefulWidget {
|
||||
final SingleBorrowGoods item;
|
||||
BorrowItemDetailPage({Key key, this.item}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BorrowItemDetailPageState createState() => _BorrowItemDetailPageState();
|
||||
}
|
||||
|
||||
class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
|
||||
bool _isEditing = false;
|
||||
TextEditingController _textEditingController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_textEditingController = TextEditingController(text: widget.item.name);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_textEditingController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final userProvider = Provider.of<UserProvider>(context);
|
||||
return AkuScaffold(
|
||||
title: '物品详情',
|
||||
actions: [
|
||||
userProvider.userInfoModel.role == USER_ROLE.MANAGER
|
||||
? AkuMaterialButton(
|
||||
minWidth: 120.w,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_isEditing = !_isEditing;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
_isEditing ? '完成' : '编辑',
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(
|
||||
'物品名称',
|
||||
TextField(
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
controller: _textEditingController,
|
||||
enabled: _isEditing,
|
||||
onChanged: (text) {
|
||||
widget.item.name = text;
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
),
|
||||
)),
|
||||
Divider(height: 1.w),
|
||||
_buildRow(
|
||||
'物品单号',
|
||||
Text(
|
||||
widget.item.code,
|
||||
style: TextStyle(
|
||||
color: _isEditing
|
||||
? AppStyle.minorTextColor
|
||||
: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
_buildRow(
|
||||
'出借状态',
|
||||
Text(
|
||||
'未出借',
|
||||
style: TextStyle(
|
||||
color: _isEditing
|
||||
? AppStyle.minorTextColor
|
||||
: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
_buildRow(
|
||||
'物品图片',
|
||||
(widget.item.assetpath is String)
|
||||
? Image.asset(
|
||||
widget.item.assetpath,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
widget.item.assetpath,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
AkuBox.h(28),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(String title, Widget child) {
|
||||
return Row(
|
||||
children: [
|
||||
AkuBox.h(96),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
AkuBox.w(80),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_item_page.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BorrowItemPage extends StatefulWidget {
|
||||
final BorrowObject object;
|
||||
BorrowItemPage({Key key, @required this.object}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BorrowItemPageState createState() => _BorrowItemPageState();
|
||||
}
|
||||
|
||||
class _BorrowItemPageState extends State<BorrowItemPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final userProvider = Provider.of<UserProvider>(context);
|
||||
return AkuScaffold(
|
||||
title: '物品查看',
|
||||
actions: [
|
||||
userProvider.userInfoModel.role == USER_ROLE.MANAGER
|
||||
? AkuMaterialButton(
|
||||
minWidth: 120.w,
|
||||
onPressed: () {
|
||||
Get.to(AddBorrowItemPage(object: widget.object));
|
||||
},
|
||||
child: Text(
|
||||
'新增',
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
body: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildCard(widget.object.items[index]);
|
||||
},
|
||||
itemCount: widget.object.items.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildCard(SingleBorrowGoods item) {
|
||||
final userProvider = Provider.of<UserProvider>(context);
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(BorrowItemDetailPage(item: item));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AkuBox.h(93),
|
||||
AkuBox.w(24),
|
||||
Text(
|
||||
item.name,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 32.sp,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
userProvider.userInfoModel.role == USER_ROLE.MANAGER
|
||||
? AkuMaterialButton(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||
onPressed: () {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text('删除物品'),
|
||||
content: Text('确定要删除${item.name}该物品吗?'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('取消'),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text('删除'),
|
||||
onPressed: () {
|
||||
widget.object.items.remove(item);
|
||||
setState(() {});
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.delete,
|
||||
color: AppStyle.minorTextColor,
|
||||
size: 40.w,
|
||||
),
|
||||
Text(
|
||||
'删除',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 1.w,
|
||||
),
|
||||
AkuBox.h(28),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AkuBox.w(24),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(4.w),
|
||||
child: (item.assetpath is String)
|
||||
? Image.asset(
|
||||
item.assetpath,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
item.assetpath,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
AkuBox.w(24),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(
|
||||
R.ASSETS_MANAGE_IC_RENWU_PNG, '物品单号', item.code),
|
||||
_buildRow(
|
||||
R.ASSETS_MANAGE_BORROW_PNG,
|
||||
'出借状态',
|
||||
'未借出',
|
||||
color: AppStyle.secondaryColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
AkuBox.h(32),
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(
|
||||
String assetPath,
|
||||
String title,
|
||||
String subTitle, {
|
||||
Color color = AppStyle.primaryTextColor,
|
||||
}) {
|
||||
return Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
assetPath,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
'$title\:',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
subTitle,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,221 @@
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_manager_check_page.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class BorrowManagerCard extends StatefulWidget {
|
||||
final BorrowModel model;
|
||||
BorrowManagerCard({Key key, this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BorrowManagerCardState createState() => _BorrowManagerCardState();
|
||||
}
|
||||
|
||||
class _BorrowManagerCardState extends State<BorrowManagerCard> {
|
||||
USER_ROLE get role =>
|
||||
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 16.w),
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AkuChipBox(title: '借还管理'),
|
||||
AkuBox.w(24),
|
||||
Text(
|
||||
DateUtil.formatDate(widget.model.date),
|
||||
style: TextStyle(),
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
widget.model.borrowGoods.borrowValue,
|
||||
style: TextStyle(
|
||||
color: AppStyle.failColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
AkuBox.h(24),
|
||||
Text(
|
||||
widget.model.title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
AkuBox.h(16),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
(widget.model.borrowGoods.assetpath is String)
|
||||
? Image.asset(
|
||||
widget.model.borrowGoods.assetpath,
|
||||
height: 184.w,
|
||||
width: 183.w,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
widget.model.borrowGoods.assetpath,
|
||||
height: 184.w,
|
||||
width: 183.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
AkuBox.w(24),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '借用人员',
|
||||
widget.model.borrowPerson),
|
||||
_buildRow(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话',
|
||||
widget.model.phone),
|
||||
_buildRow(R.ASSETS_MANAGE_IC_TIME_PNG, '借用时常',
|
||||
'${widget.model.borrowTime}天'),
|
||||
_buildRow(
|
||||
R.ASSETS_MANAGE_INFO_PNG,
|
||||
'物品状态',
|
||||
widget.model.goodsStatus == GOODS_STATUS.BROKEN
|
||||
? '损坏'
|
||||
: widget.model.goodsStatus == GOODS_STATUS.LOST
|
||||
? '丢失'
|
||||
: '正常',
|
||||
color: widget.model.goodsStatus == GOODS_STATUS.NORMAL
|
||||
? AppStyle.primaryTextColor
|
||||
: AppStyle.failColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
..._buildCard(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _buildCard() {
|
||||
if (role != USER_ROLE.MANAGER)
|
||||
return [];
|
||||
else if (widget.model.borrowGoods.status == BORROW_STATUS.DONE) {
|
||||
return [];
|
||||
} else
|
||||
return [
|
||||
Divider(height: 48.w),
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
MaterialButton(
|
||||
minWidth: 160.w,
|
||||
height: 64.w,
|
||||
child: Text(
|
||||
'电话联系',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
launch('tel:${widget.model.phone}');
|
||||
},
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4.w),
|
||||
side: BorderSide(color: AppStyle.primaryColor, width: 2.w),
|
||||
),
|
||||
),
|
||||
AkuBox.w(24),
|
||||
widget.model.borrowGoods.status == BORROW_STATUS.BORROWING
|
||||
? AkuMaterialButton(
|
||||
minWidth: 160.w,
|
||||
height: 64.w,
|
||||
color: AppStyle.primaryColor,
|
||||
radius: 4.w,
|
||||
onPressed: () {
|
||||
BotToast.showText(text: '已提醒用户');
|
||||
},
|
||||
child: Text(
|
||||
'提醒归还',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
widget.model.borrowGoods.status == BORROW_STATUS.WAIT_CHECK
|
||||
? AkuMaterialButton(
|
||||
minWidth: 160.w,
|
||||
height: 64.w,
|
||||
color: AppStyle.primaryColor,
|
||||
radius: 4.w,
|
||||
onPressed: () {
|
||||
Get.to(BorrowManagerCheckPage(model: widget.model));
|
||||
},
|
||||
child: Text(
|
||||
'检查信息',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
_buildRow(
|
||||
String assetPath,
|
||||
String title,
|
||||
String subTitle, {
|
||||
Color color = AppStyle.primaryTextColor,
|
||||
}) {
|
||||
return Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
assetPath,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
'$title\:',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
subTitle,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class BorrowManagerCheckPage extends StatefulWidget {
|
||||
final BorrowModel model;
|
||||
BorrowManagerCheckPage({Key key, @required this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BorrowManagerCheckPageState createState() => _BorrowManagerCheckPageState();
|
||||
}
|
||||
|
||||
class _BorrowManagerCheckPageState extends State<BorrowManagerCheckPage> {
|
||||
GOODS_STATUS borrowStatus = GOODS_STATUS.NORMAL;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '检查物品',
|
||||
bottom: AkuBottomButton(
|
||||
title: '确认归还',
|
||||
onTap: () {
|
||||
widget.model.goodsStatus = borrowStatus;
|
||||
widget.model.borrowGoods.status = BORROW_STATUS.DONE;
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildRow(
|
||||
'物品名称',
|
||||
Text(
|
||||
widget.model.borrowGoods.name,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(height: 1.w),
|
||||
_buildRow(
|
||||
'物品单号',
|
||||
Text(
|
||||
widget.model.borrowGoods.code,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(height: 1.w),
|
||||
_buildRow(
|
||||
'归还数量',
|
||||
Text(
|
||||
'1',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
Divider(height: 1.w),
|
||||
_buildRow(
|
||||
'物品情况',
|
||||
Row(
|
||||
children: [
|
||||
_buildCard(GOODS_STATUS.NORMAL),
|
||||
AkuBox.w(24),
|
||||
_buildCard(GOODS_STATUS.BROKEN),
|
||||
AkuBox.w(24),
|
||||
_buildCard(GOODS_STATUS.LOST),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(height: 1.w),
|
||||
AkuBox.h(16),
|
||||
_buildRow(
|
||||
'物品图片',
|
||||
(widget.model.borrowGoods.assetpath is String)
|
||||
? Image.asset(
|
||||
widget.model.borrowGoods.assetpath,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
widget.model.borrowGoods.assetpath,
|
||||
height: 184.w,
|
||||
width: 184.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
AkuBox.h(28),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(String title, Widget child) {
|
||||
return Row(
|
||||
children: [
|
||||
AkuBox.h(96),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
AkuBox.w(80),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_buildCard(GOODS_STATUS status) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
borrowStatus = status;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: 56.w,
|
||||
width: 112.w,
|
||||
child: Text(
|
||||
{
|
||||
GOODS_STATUS.NORMAL: '完好',
|
||||
GOODS_STATUS.BROKEN: '损坏',
|
||||
GOODS_STATUS.LOST: '丢失',
|
||||
}[status],
|
||||
style: TextStyle(
|
||||
color: borrowStatus == status
|
||||
? AppStyle.secondaryColor
|
||||
: AppStyle.minorTextColor,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
color: borrowStatus == status
|
||||
? AppStyle.secondaryColor
|
||||
: AppStyle.minorTextColor,
|
||||
width: 2.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
|
||||
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_manager_card.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BorrowManagerPage extends StatefulWidget {
|
||||
BorrowManagerPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BorrowManagerPageState createState() => _BorrowManagerPageState();
|
||||
}
|
||||
|
||||
class _BorrowManagerPageState extends State<BorrowManagerPage>
|
||||
with TickerProviderStateMixin {
|
||||
USER_ROLE get role =>
|
||||
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
|
||||
TabController _tabController;
|
||||
List<String> get _tabs {
|
||||
switch (role) {
|
||||
case USER_ROLE.MANAGER:
|
||||
return ['全部', '出借中', '待检查', '已归还'];
|
||||
default:
|
||||
return ['全部', '出借中', '已归还'];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: _tabs.length, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '物品清单',
|
||||
appBarBottom: PreferredSize(
|
||||
child: AkuTabBar(
|
||||
controller: _tabController,
|
||||
tabs: _tabs,
|
||||
),
|
||||
preferredSize: Size.fromHeight(96.w)),
|
||||
actions: [
|
||||
AkuMaterialButton(
|
||||
minWidth: 178.w,
|
||||
onPressed: () {
|
||||
Get.to(AllBorrowGoods());
|
||||
},
|
||||
child: Text(
|
||||
'全部物品',
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: _getChildren(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _getChildren() {
|
||||
switch (role) {
|
||||
case USER_ROLE.MANAGER:
|
||||
return [
|
||||
getView(BorrowData.models),
|
||||
getView(BorrowData.borrowModels),
|
||||
getView(BorrowData.checkModels),
|
||||
getView(BorrowData.doneModels),
|
||||
];
|
||||
break;
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Widget getView(List<BorrowModel> models) {
|
||||
return ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return BorrowManagerCard(
|
||||
model: models[index],
|
||||
);
|
||||
},
|
||||
itemCount: models.length,
|
||||
);
|
||||
}
|
@ -0,0 +1,270 @@
|
||||
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DecorationFollowCheck extends StatefulWidget {
|
||||
final DecorationModel model;
|
||||
DecorationFollowCheck({Key key, @required this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DecorationFollowCheckState createState() => _DecorationFollowCheckState();
|
||||
}
|
||||
|
||||
class _DecorationFollowCheckState extends State<DecorationFollowCheck> {
|
||||
Map<CHECK_TYPE, bool> checkStatus = {
|
||||
CHECK_TYPE.ELECTRIC: true,
|
||||
CHECK_TYPE.WATER: true,
|
||||
CHECK_TYPE.WALL: true,
|
||||
CHECK_TYPE.DOOR_AND_WINDOWS: true,
|
||||
CHECK_TYPE.SECURITY: true,
|
||||
};
|
||||
|
||||
bool get success {
|
||||
for (var item in checkStatus.keys) {
|
||||
if (checkStatus[item] == false) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
TextEditingController _textEditingController = TextEditingController();
|
||||
@override
|
||||
void dispose() {
|
||||
_textEditingController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '跟踪检查',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 32.w,
|
||||
vertical: 16.w,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 56.w,
|
||||
width: 56.w,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'家',
|
||||
style: TextStyle(
|
||||
color: AppStyle.secondaryColor,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(28.w),
|
||||
color: Color(0xFFE9F2FF),
|
||||
),
|
||||
),
|
||||
AkuBox.w(30),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.model.userHomeModel.plot,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.model.userHomeModel.detailAddr,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 26.w,
|
||||
horizontal: 32.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
color: Color(0xFFF9F9F9),
|
||||
),
|
||||
),
|
||||
AkuBox.h(16),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 56.w,
|
||||
width: 56.w,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'装',
|
||||
style: TextStyle(
|
||||
color: AppStyle.secondaryColor,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(28.w),
|
||||
color: Color(0xFFE9F2FF),
|
||||
),
|
||||
),
|
||||
AkuBox.w(30),
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.model.decorationTeamModel.name,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 26.w,
|
||||
horizontal: 32.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
color: Color(0xFFF9F9F9),
|
||||
),
|
||||
),
|
||||
AkuBox.h(16),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'${DateUtil.formatDate(
|
||||
DateTime.now(),
|
||||
format: 'yyyy-MM-dd',
|
||||
)} 周期检查',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
AkuBox.h(96),
|
||||
Text(
|
||||
success ? '正常' : '异常',
|
||||
style: TextStyle(
|
||||
color: success
|
||||
? AppStyle.successColor
|
||||
: AppStyle.failColor,
|
||||
fontSize: 28.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
_buildRow(CHECK_TYPE.ELECTRIC),
|
||||
_buildRow(CHECK_TYPE.WATER),
|
||||
_buildRow(CHECK_TYPE.WALL),
|
||||
_buildRow(CHECK_TYPE.DOOR_AND_WINDOWS),
|
||||
_buildRow(CHECK_TYPE.SECURITY),
|
||||
TextField(
|
||||
minLines: 3,
|
||||
maxLines: 99,
|
||||
controller: _textEditingController,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 16.w,
|
||||
horizontal: 24.w,
|
||||
),
|
||||
hintText: '请输入检查描述',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
borderSide: BorderSide(
|
||||
width: 2.w,
|
||||
color: Color(0xFFE8E8E8),
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
borderSide: BorderSide(
|
||||
width: 2.w,
|
||||
color: Color(0xFFE8E8E8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottom: AkuBottomButton(
|
||||
onTap: () {
|
||||
widget.model.checkInfomations.add(
|
||||
CheckInfomation(
|
||||
checkDate: DateTime.now(),
|
||||
checkType: '周期检查',
|
||||
info: _textEditingController.text,
|
||||
details: checkStatus.entries.map((e) {
|
||||
return CheckDetail(type: e.key, status: e.value);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
widget.model.type = DecorationType.DONE;
|
||||
Get.off(DecorationSuccessPage());
|
||||
},
|
||||
title: '确认提交',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildRow(
|
||||
CHECK_TYPE type,
|
||||
) {
|
||||
return Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
checkAssetMap[type],
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
checkTypeMap[type],
|
||||
style: TextStyle(
|
||||
fontSize: 28.w,
|
||||
color: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
DecorationCheckBox(
|
||||
initValue: checkStatus[type],
|
||||
onChange: (state) {
|
||||
checkStatus[type] = state;
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DecorationSuccessPage extends StatefulWidget {
|
||||
DecorationSuccessPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DecorationSuccessPageState createState() => _DecorationSuccessPageState();
|
||||
}
|
||||
|
||||
class _DecorationSuccessPageState extends State<DecorationSuccessPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '跟踪检查',
|
||||
backgroundColor: Color(0xFFF9F9F9),
|
||||
body: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 100.w,
|
||||
width: 100.w,
|
||||
child: Placeholder(),
|
||||
),
|
||||
Text(
|
||||
'提交成功',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 40.sp,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'你的装修跟踪检查记录已提交',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 26.sp,
|
||||
),
|
||||
),
|
||||
AkuBox.h(80),
|
||||
AkuMaterialButton(
|
||||
height: 88.w,
|
||||
minWidth: 280.w,
|
||||
radius: 8.w,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
},
|
||||
color: AppStyle.primaryColor,
|
||||
child: Text(
|
||||
'查看',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AkuBottomButton extends StatefulWidget {
|
||||
final VoidCallback onTap;
|
||||
final String title;
|
||||
AkuBottomButton({Key key, this.onTap, @required this.title})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AkuBottomButtonState createState() => _AkuBottomButtonState();
|
||||
}
|
||||
|
||||
class _AkuBottomButtonState extends State<AkuBottomButton> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuMaterialButton(
|
||||
height: 98.w,
|
||||
color: AppStyle.primaryColor,
|
||||
nullColor: AppStyle.minorColor,
|
||||
onPressed: widget.onTap,
|
||||
child: Text(
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.onTap == null
|
||||
? AppStyle.minorTextColor
|
||||
: AppStyle.primaryTextColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|