地址接口的视线
This commit is contained in:
@@ -33,108 +33,107 @@ class _DeviceListPageState extends State<DeviceListPage> {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
bodysize = cc;
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
// leading: returnIconButtomAddCallback(() {
|
||||
// controller.saveDataApi();
|
||||
// updateParm(isShowToast: false);
|
||||
// }),
|
||||
// leading: returnIconButtomNew,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'设备列表',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Image.asset(
|
||||
'assets/images/new_background.png',
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 10, 0, 23),
|
||||
child: SearchWidget(
|
||||
keyword: controller.model.keyword,
|
||||
color: controller.model.color,
|
||||
hint: "检索设备",
|
||||
onChange: (d) {
|
||||
controller.model.keyword = d;
|
||||
},
|
||||
findCallback: () {
|
||||
controller.getDeviceList();
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.model.deviceList == null ||
|
||||
controller.model.deviceList.isEmpty) {
|
||||
return Expanded(child: NullDataWidget());
|
||||
}
|
||||
|
||||
// 如果 deviceList 不为空,渲染列表
|
||||
return Expanded(
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
children: controller.model.deviceList
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => DeviceInfoWidget(
|
||||
index: e.key,
|
||||
deviceListController: controller,
|
||||
))
|
||||
.toList()
|
||||
.divide(const SizedBox(height: 10))
|
||||
.addToEnd(const SizedBox(height: 100)),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
// leading: returnIconButtomAddCallback(() {
|
||||
// controller.saveDataApi();
|
||||
// updateParm(isShowToast: false);
|
||||
// }),
|
||||
// leading: returnIconButtomNew,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'设备列表',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
],
|
||||
)
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Container(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 10, 0, 23),
|
||||
child: SearchWidget(
|
||||
keyword: controller.model.keyword,
|
||||
color: controller.model.color,
|
||||
hint: "检索设备",
|
||||
onChange: (d) {
|
||||
controller.model.keyword = d;
|
||||
},
|
||||
findCallback: () {
|
||||
controller.getDeviceList();
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.model.deviceList == null ||
|
||||
controller.model.deviceList.isEmpty) {
|
||||
return Expanded(child: NullDataWidget());
|
||||
}
|
||||
|
||||
// Container(
|
||||
// width: bodysize!.maxWidth,
|
||||
// height: bodysize!.maxHeight,
|
||||
// 如果 deviceList 不为空,渲染列表
|
||||
return Expanded(
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
children: controller.model.deviceList
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => DeviceInfoWidget(
|
||||
index: e.key,
|
||||
deviceListController: controller,
|
||||
))
|
||||
.toList()
|
||||
.divide(const SizedBox(height: 10))
|
||||
.addToEnd(const SizedBox(height: 100)),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
// ),
|
||||
),
|
||||
);
|
||||
// Container(
|
||||
// width: bodysize!.maxWidth,
|
||||
// height: bodysize!.maxHeight,
|
||||
|
||||
// ),
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user