1,权限管理模块调整为多级联动
2,添加设备-新增“可视对讲门锁” 3,新增分享到第三方页面--未接入
This commit is contained in:
parent
83b2b7159d
commit
24089f59b9
@ -191,6 +191,8 @@
|
|||||||
"lanChinese":"Chinese",
|
"lanChinese":"Chinese",
|
||||||
"multilingual":"Multilingual",
|
"multilingual":"Multilingual",
|
||||||
"addLock":"Add Lock",
|
"addLock":"Add Lock",
|
||||||
|
"selectLockType":"Select lock type",
|
||||||
|
"videoIntercomDoorLock":"Video intercom door lock",
|
||||||
"addDevice":"Add device",
|
"addDevice":"Add device",
|
||||||
"gateway":"Gateway",
|
"gateway":"Gateway",
|
||||||
"message":"Message",
|
"message":"Message",
|
||||||
|
|||||||
@ -191,6 +191,8 @@
|
|||||||
"lanChinese":"lanChinese",
|
"lanChinese":"lanChinese",
|
||||||
"multilingual":"multilingual",
|
"multilingual":"multilingual",
|
||||||
"addLock":"addLock",
|
"addLock":"addLock",
|
||||||
|
"selectLockType":"selectLockType",
|
||||||
|
"videoIntercomDoorLock":"videoIntercomDoorLock",
|
||||||
"addDevice":"addDevice",
|
"addDevice":"addDevice",
|
||||||
"gateway":"gateway",
|
"gateway":"gateway",
|
||||||
"message":"message",
|
"message":"message",
|
||||||
|
|||||||
@ -191,6 +191,8 @@
|
|||||||
"lanChinese":"中文",
|
"lanChinese":"中文",
|
||||||
"multilingual":"多语言",
|
"multilingual":"多语言",
|
||||||
"addLock":"添加锁",
|
"addLock":"添加锁",
|
||||||
|
"selectLockType":"选择锁类型",
|
||||||
|
"videoIntercomDoorLock":"可视对讲门锁",
|
||||||
"addDevice":"添加设备",
|
"addDevice":"添加设备",
|
||||||
"gateway":"网关",
|
"gateway":"网关",
|
||||||
"message":"消息",
|
"message":"消息",
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/tools/shareModule/sharePopup.dart';
|
||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
|
barTitle: TranslationLoader.lanKeys!.selectLockType!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
@ -40,6 +40,10 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
|||||||
TranslationLoader.lanKeys!.doorLock!.tr, () {
|
TranslationLoader.lanKeys!.doorLock!.tr, () {
|
||||||
Navigator.pushNamed(context, Routers.addLockPage);
|
Navigator.pushNamed(context, Routers.addLockPage);
|
||||||
}),
|
}),
|
||||||
|
lockTypeItem('images/lockType/lockType_doorLock.png',
|
||||||
|
TranslationLoader.lanKeys!.videoIntercomDoorLock!.tr, () {
|
||||||
|
Navigator.pushNamed(context, Routers.addLockPage);
|
||||||
|
}),
|
||||||
lockTypeItem('images/lockType/lockType_padlock.png',
|
lockTypeItem('images/lockType/lockType_padlock.png',
|
||||||
TranslationLoader.lanKeys!.padlock!.tr, () {
|
TranslationLoader.lanKeys!.padlock!.tr, () {
|
||||||
Navigator.pushNamed(context, Routers.addLockPage);
|
Navigator.pushNamed(context, Routers.addLockPage);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:get/get_utils/get_utils.dart';
|
import 'package:get/get_utils/get_utils.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
|
import 'package:star_lock/tools/ExpandedListView.dart';
|
||||||
import 'package:star_lock/tools/submitBtn.dart';
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
import 'package:star_lock/translations/trans_lib.dart';
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
|
|
||||||
@ -97,20 +98,14 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return _buildNameWidget(
|
return _buildNameExpandedList(context, index, "张三");
|
||||||
context, index, 'images/icon_password.png', '密码1');
|
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
return _buildNameWidget(
|
return _buildNameExpandedList(context, index, "李四");
|
||||||
context, index, 'images/icon_card.png', '卡1');
|
|
||||||
} else if (index == 2) {
|
} else if (index == 2) {
|
||||||
return _buildNameWidget(
|
return _buildNameExpandedList(context, index, "王二");
|
||||||
context, index, 'images/icon_fingerprint.png', '指纹1');
|
} else {
|
||||||
} else if (index == 3) {
|
return _buildNameExpandedList(context, index, "麻子");
|
||||||
return _buildNameWidget(
|
|
||||||
context, index, 'images/icon_card.png', '遥控1');
|
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
// return _buildNameWidget(context, index);
|
|
||||||
},
|
},
|
||||||
separatorBuilder: (context, index) {
|
separatorBuilder: (context, index) {
|
||||||
return const Divider(
|
return const Divider(
|
||||||
@ -141,17 +136,13 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return _buildDeviceWidget(
|
return _buildDeviceExpandedList(context, index, "大门锁");
|
||||||
context, index, 'images/icon_lock.png', "大门锁");
|
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
return _buildDeviceWidget(
|
return _buildDeviceExpandedList(context, index, "办公室锁");
|
||||||
context, index, 'images/icon_lock.png', "办公室锁");
|
|
||||||
} else if (index == 2) {
|
} else if (index == 2) {
|
||||||
return _buildDeviceWidget(
|
return _buildDeviceExpandedList(context, index, "会议室锁");
|
||||||
context, index, 'images/icon_lock.png', "会议室锁");
|
|
||||||
} else {
|
} else {
|
||||||
return _buildDeviceWidget(
|
return _buildDeviceExpandedList(context, index, "宴会厅锁");
|
||||||
context, index, 'images/icon_lock.png', "宴会厅锁");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
separatorBuilder: (context, index) {
|
separatorBuilder: (context, index) {
|
||||||
@ -172,10 +163,85 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设备多层级列表
|
||||||
|
Widget _buildDeviceExpandedList(context, index, deviceName) {
|
||||||
|
return ExpandedListTile(
|
||||||
|
onTap: () => print("onTap."),
|
||||||
|
title: deviceName,
|
||||||
|
imgName: 'images/icon_lock.png',
|
||||||
|
typeImgList: const [],
|
||||||
|
child: ListView.separated(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 10,
|
||||||
|
itemBuilder: (_, index) {
|
||||||
|
if (index == 0) {
|
||||||
|
return _buildNameWidget(
|
||||||
|
context, index, 'images/icon_password.png', '张三');
|
||||||
|
} else if (index == 1) {
|
||||||
|
return _buildNameWidget(
|
||||||
|
context, index, 'images/icon_card.png', '李四');
|
||||||
|
} else if (index == 2) {
|
||||||
|
return _buildNameWidget(
|
||||||
|
context, index, 'images/icon_fingerprint.png', '王二');
|
||||||
|
} else if (index == 3) {
|
||||||
|
return _buildNameWidget(
|
||||||
|
context, index, 'images/icon_card.png', '麻子');
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//姓名多层级列表
|
||||||
|
Widget _buildNameExpandedList(context, index, deviceName) {
|
||||||
|
return ExpandedListTile(
|
||||||
|
onTap: () => print("onTap."),
|
||||||
|
title: deviceName,
|
||||||
|
imgName: 'images/controls_user.png',
|
||||||
|
typeImgList: const ['images/icon_password.png', 'images/icon_card.png'],
|
||||||
|
child: ListView.separated(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 5,
|
||||||
|
itemBuilder: (_, index) {
|
||||||
|
if (index == 0) {
|
||||||
|
return _buildDeviceWidget(
|
||||||
|
context, index, 'images/icon_lock.png', "大门锁");
|
||||||
|
} else if (index == 1) {
|
||||||
|
return _buildDeviceWidget(
|
||||||
|
context, index, 'images/icon_lock.png', "办公室锁");
|
||||||
|
} else if (index == 2) {
|
||||||
|
return _buildDeviceWidget(
|
||||||
|
context, index, 'images/icon_lock.png', "会议室锁");
|
||||||
|
} else {
|
||||||
|
return _buildDeviceWidget(
|
||||||
|
context, index, 'images/icon_lock.png', "宴会厅锁");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//单个姓名行
|
||||||
Widget _buildNameWidget(context, index, imageName, getName) {
|
Widget _buildNameWidget(context, index, imageName, getName) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 90.h,
|
height: 60.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
width: ScreenUtil().screenWidth,
|
width: ScreenUtil().screenWidth,
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -184,7 +250,7 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
imageName,
|
'images/controls_user.png',
|
||||||
width: 36.w,
|
width: 36.w,
|
||||||
height: 36.w,
|
height: 36.w,
|
||||||
),
|
),
|
||||||
@ -193,18 +259,8 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
getName,
|
getName,
|
||||||
style: TextStyle(fontSize: 22.sp, color: AppColors.blackColor),
|
style: TextStyle(
|
||||||
),
|
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
Expanded(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 20.w,
|
|
||||||
)),
|
|
||||||
Image.asset(
|
|
||||||
isNameSelect == false
|
|
||||||
? 'images/icon_round_unSelet.png'
|
|
||||||
: 'images/icon_round_selet.png',
|
|
||||||
width: 30.sp,
|
|
||||||
height: 30.sp,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
@ -223,10 +279,11 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//单个设备行
|
||||||
Widget _buildDeviceWidget(context, index, imageName, deviceName) {
|
Widget _buildDeviceWidget(context, index, imageName, deviceName) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 90.h,
|
height: 60.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
width: ScreenUtil().screenWidth,
|
width: ScreenUtil().screenWidth,
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -244,18 +301,8 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
deviceName,
|
deviceName,
|
||||||
style: TextStyle(fontSize: 22.sp, color: AppColors.blackColor),
|
style: TextStyle(
|
||||||
),
|
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
Expanded(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 20.w,
|
|
||||||
)),
|
|
||||||
Image.asset(
|
|
||||||
isDeviceSelect == false
|
|
||||||
? 'images/icon_round_unSelet.png'
|
|
||||||
: 'images/icon_round_selet.png',
|
|
||||||
width: 30.sp,
|
|
||||||
height: 30.sp,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
|
|||||||
@ -54,16 +54,16 @@ class _GetNameListPageState extends State<GetNameListPage> {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return _buildNameWidget(
|
return _buildNameWidget(
|
||||||
context, index, 'images/icon_password.png', '密码1');
|
context, index, 'images/controls_user.png', '张三');
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
return _buildNameWidget(
|
return _buildNameWidget(
|
||||||
context, index, 'images/icon_card.png', '卡1');
|
context, index, 'images/controls_user.png', '李四');
|
||||||
} else if (index == 2) {
|
} else if (index == 2) {
|
||||||
return _buildNameWidget(
|
return _buildNameWidget(
|
||||||
context, index, 'images/icon_fingerprint.png', '指纹1');
|
context, index, 'images/controls_user.png', '王二');
|
||||||
} else if (index == 3) {
|
} else if (index == 3) {
|
||||||
return _buildNameWidget(
|
return _buildNameWidget(
|
||||||
context, index, 'images/icon_card.png', '遥控1');
|
context, index, 'images/controls_user.png', '麻子');
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|||||||
204
star_lock/lib/tools/ExpandedListView.dart
Normal file
204
star_lock/lib/tools/ExpandedListView.dart
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
|
|
||||||
|
class ExpandedListTile extends StatefulWidget {
|
||||||
|
const ExpandedListTile(
|
||||||
|
{Key? key,
|
||||||
|
required this.title,
|
||||||
|
this.child,
|
||||||
|
this.onTap,
|
||||||
|
required this.typeImgList,
|
||||||
|
required this.imgName})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final String imgName;
|
||||||
|
final Widget? child;
|
||||||
|
final List typeImgList;
|
||||||
|
final Function()? onTap;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ExpandedListTileState createState() => _ExpandedListTileState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ExpandedListTileState extends State<ExpandedListTile> {
|
||||||
|
bool _isExpanded = false;
|
||||||
|
final Duration _animationDuration = const Duration(milliseconds: 200);
|
||||||
|
bool _isCheck = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
height: 80.h,
|
||||||
|
child: Row(
|
||||||
|
children: _buildExpandRowList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// InkWell(
|
||||||
|
// onTap: () {
|
||||||
|
// setState(() {
|
||||||
|
// _isExpanded = !_isExpanded;
|
||||||
|
// });
|
||||||
|
// widget.onTap?.call();
|
||||||
|
// },
|
||||||
|
// child: Container(
|
||||||
|
// color: Colors.white,
|
||||||
|
// height: 80.h,
|
||||||
|
// child: Row(
|
||||||
|
// children: _buildExpandRowList(),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
ClipRect(
|
||||||
|
child: AnimatedAlign(
|
||||||
|
heightFactor: _isExpanded ? 1.0 : 0.0,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
duration: _animationDuration,
|
||||||
|
child: widget.child),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Widget> _buildExpandRowList() {
|
||||||
|
List<Widget> widgetList = [];
|
||||||
|
widgetList.add(GestureDetector(
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
width: 80.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
_isCheck
|
||||||
|
? "images/icon_round_selet.png"
|
||||||
|
: "images/icon_round_unSelet.png",
|
||||||
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
//点击左侧是否勾选按钮
|
||||||
|
setState(() {
|
||||||
|
_isCheck = !_isCheck;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
));
|
||||||
|
widgetList.add(GestureDetector(
|
||||||
|
child: Container(
|
||||||
|
width: ScreenUtil().screenWidth - 80.w,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
widget.imgName,
|
||||||
|
width: 36.w,
|
||||||
|
height: 36.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
widget.title,
|
||||||
|
style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
)),
|
||||||
|
AnimatedRotation(
|
||||||
|
turns: _isExpanded ? 0 : -0.5,
|
||||||
|
duration: _animationDuration,
|
||||||
|
child: const Icon(Icons.keyboard_arrow_down),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
//点击右侧上拉下拉按钮
|
||||||
|
setState(() {
|
||||||
|
_isExpanded = !_isExpanded;
|
||||||
|
});
|
||||||
|
widget.onTap?.call();
|
||||||
|
},
|
||||||
|
));
|
||||||
|
// widgetList.add(SizedBox(
|
||||||
|
// width: 30.w,
|
||||||
|
// ));
|
||||||
|
// widgetList.add(GestureDetector(
|
||||||
|
// child: Image.asset(
|
||||||
|
// _isCheck
|
||||||
|
// ? "images/icon_round_selet.png"
|
||||||
|
// : "images/icon_round_unSelet.png",
|
||||||
|
// width: 30.w,
|
||||||
|
// height: 30.w,
|
||||||
|
// ),
|
||||||
|
// onTap: () {
|
||||||
|
// _isCheck = !_isCheck;
|
||||||
|
// },
|
||||||
|
// ));
|
||||||
|
|
||||||
|
// widgetList.add(SizedBox(
|
||||||
|
// width: 20.w,
|
||||||
|
// ));
|
||||||
|
/*
|
||||||
|
widgetList.add(Image.asset(
|
||||||
|
widget.imgName,
|
||||||
|
width: 36.w,
|
||||||
|
height: 36.w,
|
||||||
|
));
|
||||||
|
widgetList.add(SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
));
|
||||||
|
widgetList.add(
|
||||||
|
Text(
|
||||||
|
widget.title,
|
||||||
|
style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (widget.typeImgList.isNotEmpty) {
|
||||||
|
for (var item in widget.typeImgList) {
|
||||||
|
widgetList.add(SizedBox(
|
||||||
|
width: 16.w,
|
||||||
|
));
|
||||||
|
widgetList.add(Image.asset(
|
||||||
|
item,
|
||||||
|
width: 28.w,
|
||||||
|
height: 28.w,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
widgetList.add(Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
)));
|
||||||
|
|
||||||
|
widgetList.add(AnimatedRotation(
|
||||||
|
turns: _isExpanded ? 0 : -0.5,
|
||||||
|
duration: _animationDuration,
|
||||||
|
child: const Icon(Icons.keyboard_arrow_down),
|
||||||
|
));
|
||||||
|
widgetList.add(SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
));
|
||||||
|
*/
|
||||||
|
return widgetList;
|
||||||
|
}
|
||||||
|
}
|
||||||
105
star_lock/lib/tools/shareModule/sharePopup.dart
Normal file
105
star_lock/lib/tools/shareModule/sharePopup.dart
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SharePopup extends StatelessWidget {
|
||||||
|
List<String> nameItems = <String>[
|
||||||
|
'微信',
|
||||||
|
'朋友圈',
|
||||||
|
'QQ',
|
||||||
|
'QQ空间',
|
||||||
|
'微博',
|
||||||
|
'FaceBook',
|
||||||
|
'邮件',
|
||||||
|
'链接'
|
||||||
|
];
|
||||||
|
List<String> urlItems = <String>[
|
||||||
|
'icon_wechat.png',
|
||||||
|
'icon_wechat_moments.png',
|
||||||
|
'icon_qq.png',
|
||||||
|
'icon_qzone.png',
|
||||||
|
'icon_sina.png',
|
||||||
|
'icon_facebook.png',
|
||||||
|
'icon_email.png',
|
||||||
|
'icon_copylink.png'
|
||||||
|
];
|
||||||
|
|
||||||
|
SharePopup({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return _shareWidget(context);
|
||||||
|
// Scaffold(
|
||||||
|
// appBar: AppBar(
|
||||||
|
// title: const Text("分享页面"),
|
||||||
|
// ),
|
||||||
|
// body: _shareWidget(context)
|
||||||
|
/*
|
||||||
|
Center(
|
||||||
|
child: Builder(builder: (BuildContext context) {
|
||||||
|
return ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return _shareWidget(context);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: const Text("我要分享"),
|
||||||
|
// color: Colors.blue
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _shareWidget(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
|
height: 250.0,
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0),
|
||||||
|
child: SizedBox(
|
||||||
|
height: 190.0,
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 4,
|
||||||
|
mainAxisSpacing: 5.0,
|
||||||
|
childAspectRatio: 1.0),
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.fromLTRB(0.0, 6.0, 0.0, 6.0),
|
||||||
|
child: Image.asset(
|
||||||
|
'images/${urlItems[index]}',
|
||||||
|
width: 50.0,
|
||||||
|
height: 50.0,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
)),
|
||||||
|
Text(nameItems[index])
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: nameItems.length,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 0.5,
|
||||||
|
color: Colors.blueGrey,
|
||||||
|
),
|
||||||
|
const Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),
|
||||||
|
child: Text(
|
||||||
|
'取 消',
|
||||||
|
style: TextStyle(fontSize: 18.0, color: Colors.blueGrey),
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -188,6 +188,8 @@ class LanKeyEntity {
|
|||||||
this.lanChinese,
|
this.lanChinese,
|
||||||
this.multilingual,
|
this.multilingual,
|
||||||
this.addLock,
|
this.addLock,
|
||||||
|
this.selectLockType,
|
||||||
|
this.videoIntercomDoorLock,
|
||||||
this.addDevice,
|
this.addDevice,
|
||||||
this.gateway,
|
this.gateway,
|
||||||
this.message,
|
this.message,
|
||||||
@ -570,6 +572,8 @@ class LanKeyEntity {
|
|||||||
lanChinese = json['lanChinese'];
|
lanChinese = json['lanChinese'];
|
||||||
multilingual = json['multilingual'];
|
multilingual = json['multilingual'];
|
||||||
addLock = json['addLock'];
|
addLock = json['addLock'];
|
||||||
|
selectLockType = json['selectLockType'];
|
||||||
|
videoIntercomDoorLock = json['videoIntercomDoorLock'];
|
||||||
addDevice = json['addDevice'];
|
addDevice = json['addDevice'];
|
||||||
gateway = json['gateway'];
|
gateway = json['gateway'];
|
||||||
message = json['message'];
|
message = json['message'];
|
||||||
@ -969,6 +973,8 @@ class LanKeyEntity {
|
|||||||
String? lanChinese;
|
String? lanChinese;
|
||||||
String? multilingual;
|
String? multilingual;
|
||||||
String? addLock;
|
String? addLock;
|
||||||
|
String? selectLockType;
|
||||||
|
String? videoIntercomDoorLock;
|
||||||
String? addDevice;
|
String? addDevice;
|
||||||
String? gateway;
|
String? gateway;
|
||||||
String? message;
|
String? message;
|
||||||
@ -1365,6 +1371,8 @@ class LanKeyEntity {
|
|||||||
map['lanChinese'] = lanChinese;
|
map['lanChinese'] = lanChinese;
|
||||||
map['multilingual'] = multilingual;
|
map['multilingual'] = multilingual;
|
||||||
map['addLock'] = addLock;
|
map['addLock'] = addLock;
|
||||||
|
map['selectLockType'] = selectLockType;
|
||||||
|
map['videoIntercomDoorLock'] = videoIntercomDoorLock;
|
||||||
map['addDevice'] = addDevice;
|
map['addDevice'] = addDevice;
|
||||||
map['gateway'] = gateway;
|
map['gateway'] = gateway;
|
||||||
map['message'] = message;
|
map['message'] = message;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user