After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 492 KiB |
@ -0,0 +1,54 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'bracelet_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class BraceletModel {
|
||||
final int sbp;
|
||||
final int todaySteps;
|
||||
final int bloodOxygen;
|
||||
final int switchType;
|
||||
final int dbp;
|
||||
final int heartRate;
|
||||
final int remainingPower;
|
||||
final int detectionDays;
|
||||
final int alarmNums;
|
||||
final int fallNums;
|
||||
|
||||
factory BraceletModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$BraceletModelFromJson(json);
|
||||
|
||||
String get switchTypeString {
|
||||
switch (switchType) {
|
||||
case 0:
|
||||
return '开机';
|
||||
case 1:
|
||||
return '关机';
|
||||
case 2:
|
||||
return '开机';
|
||||
case 3:
|
||||
return '低电通知';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
bool get heartNormal => heartRate >= 60 && heartRate <= 100;
|
||||
|
||||
bool get sbpNormal => sbp >= 90 && sbp <= 139;
|
||||
|
||||
bool get dbpNormal => dbp >= 60 && dbp <= 89;
|
||||
|
||||
const BraceletModel({
|
||||
required this.sbp,
|
||||
required this.todaySteps,
|
||||
required this.bloodOxygen,
|
||||
required this.switchType,
|
||||
required this.dbp,
|
||||
required this.heartRate,
|
||||
required this.remainingPower,
|
||||
required this.detectionDays,
|
||||
required this.alarmNums,
|
||||
required this.fallNums,
|
||||
});
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'bracelet_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BraceletModel _$BraceletModelFromJson(Map<String, dynamic> json) =>
|
||||
BraceletModel(
|
||||
sbp: json['sbp'] as int,
|
||||
todaySteps: json['todaySteps'] as int,
|
||||
bloodOxygen: json['bloodOxygen'] as int,
|
||||
switchType: json['switchType'] as int,
|
||||
dbp: json['dbp'] as int,
|
||||
heartRate: json['heartRate'] as int,
|
||||
remainingPower: json['remainingPower'] as int,
|
||||
detectionDays: json['detectionDays'] as int,
|
||||
alarmNums: json['alarmNums'] as int,
|
||||
fallNums: json['fallNums'] as int,
|
||||
);
|
@ -0,0 +1,160 @@
|
||||
import 'package:aku_new_community/gen/assets.gen.dart';
|
||||
import 'package:aku_new_community/widget/bee_back_button.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';
|
||||
|
||||
@Deprecated('第一版带图表,暂时不做')
|
||||
class OldAgeSupportPage extends StatefulWidget {
|
||||
const OldAgeSupportPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_OldAgeSupportPageState createState() => _OldAgeSupportPageState();
|
||||
}
|
||||
|
||||
class _OldAgeSupportPageState extends State<OldAgeSupportPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var date = Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 52.w,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(52.w),
|
||||
color: Colors.white.withOpacity(0.25)),
|
||||
child: '数据更新自 2022年1月1日 18:21:15'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
),
|
||||
],
|
||||
);
|
||||
var data = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
10.w.widthBox,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'58 %'
|
||||
.text
|
||||
.size(40.sp)
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
'剩余电量'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.make(),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
CupertinoIcons.circle_fill,
|
||||
size: 12.sp,
|
||||
color: Color(0xFF57DAD2),
|
||||
),
|
||||
4.w.widthBox,
|
||||
'设备 已开机'
|
||||
.text
|
||||
.size(22.sp)
|
||||
.lineHeight(1.2)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make()
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'检测天数'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
'58'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 天'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
])
|
||||
.size(56.sp)
|
||||
.color(Color(0xFF17928A))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
80.w.widthBox,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'报警次数'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
'5'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 次'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
])
|
||||
.size(56.sp)
|
||||
.color(Color(0xFFF5222D))
|
||||
.make()
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: '智慧养老'.text.size(32.sp).black.make(),
|
||||
backgroundColor: Colors.transparent,
|
||||
leading: BeeBackButton(),
|
||||
),
|
||||
extendBody: true,
|
||||
extendBodyBehindAppBar: true,
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
image: DecorationImage(
|
||||
alignment: Alignment.topCenter,
|
||||
image: AssetImage(Assets.static.oldAgeBack.path))),
|
||||
child: SafeArea(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
children: [
|
||||
38.w.heightBox,
|
||||
date,
|
||||
48.w.heightBox,
|
||||
data,
|
||||
50.w.heightBox,
|
||||
Container(
|
||||
width: 331.w,
|
||||
height: 204.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16.w)),
|
||||
child: Column(
|
||||
children: [],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,508 @@
|
||||
import 'package:aku_new_community/constants/api.dart';
|
||||
import 'package:aku_new_community/gen/assets.gen.dart';
|
||||
import 'package:aku_new_community/models/bracelet/bracelet_model.dart';
|
||||
import 'package:aku_new_community/utils/network/net_util.dart';
|
||||
import 'package:aku_new_community/widget/bee_divider.dart';
|
||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flustars/flustars.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 OldAgeSupportPageSimple extends StatefulWidget {
|
||||
const OldAgeSupportPageSimple({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_OldAgeSupportPageSimpleState createState() =>
|
||||
_OldAgeSupportPageSimpleState();
|
||||
}
|
||||
|
||||
class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
|
||||
BraceletModel? _model;
|
||||
DateTime? _date;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
var cancel = BotToast.showLoading();
|
||||
getData();
|
||||
cancel();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
BotToast.closeAllLoading();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var open = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
CupertinoIcons.circle_fill,
|
||||
size: 16.w,
|
||||
color: Color(0xFF57DAD2),
|
||||
),
|
||||
4.w.widthBox,
|
||||
'设备 ${_model?.switchTypeString}'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.lineHeight(1.2)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
],
|
||||
);
|
||||
return BeeScaffold(
|
||||
title: 'X5手环',
|
||||
extendBody: true,
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
alignment: Alignment.topCenter,
|
||||
image: AssetImage(Assets.static.braceletHeader.path)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Colors.white, Color(0xFFC0E5DC).withOpacity(0.355)]),
|
||||
),
|
||||
child: _model == null
|
||||
? Container()
|
||||
: SafeArea(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
children: [
|
||||
400.w.heightBox,
|
||||
open,
|
||||
16.w.heightBox,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
'数据更新自 ${DateUtil.formatDate(_date!, format: DateFormats.full)}'
|
||||
.text
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
40.w.heightBox,
|
||||
],
|
||||
),
|
||||
40.w.heightBox,
|
||||
overview(),
|
||||
24.w.heightBox,
|
||||
statusCard(),
|
||||
40.w.heightBox,
|
||||
bottomCard(),
|
||||
40.w.heightBox,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future getData() async {
|
||||
Response base =
|
||||
await NetUtil().dio!.get(API.bracelet.data, queryParameters: {
|
||||
'imei': 863204050238280,
|
||||
});
|
||||
if (base.data != null) {
|
||||
_model = BraceletModel.fromJson(base.data);
|
||||
_date = DateTime.now();
|
||||
}
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
Container bottomCard() {
|
||||
var left = Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Assets.icons.bloodRessure.image(width: 40.w, height: 40.w),
|
||||
'血压监督'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
var mid = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'${_model?.sbp}'
|
||||
.richText
|
||||
.withTextSpanChildren([])
|
||||
.size(48.sp)
|
||||
.bold
|
||||
.color(_model!.sbpNormal ? Color(0xFF37C6BD) : Colors.red)
|
||||
.make(),
|
||||
8.w.widthBox,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
16.w.heightBox,
|
||||
' mmhg'
|
||||
.text
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
Spacer(),
|
||||
'收缩压'.text.size(22.sp).color(Colors.black.withOpacity(0.65)).make(),
|
||||
Spacer(),
|
||||
'90-139'
|
||||
.text
|
||||
.size(20.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
var right = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'${_model?.dbp}'
|
||||
.richText
|
||||
.withTextSpanChildren([])
|
||||
.size(48.sp)
|
||||
.bold
|
||||
.color(_model!.dbpNormal ? Color(0xFF37C6BD) : Colors.red)
|
||||
.make(),
|
||||
8.w.widthBox,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
16.w.heightBox,
|
||||
' mmhg'
|
||||
.text
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
Spacer(),
|
||||
'舒张压'.text.size(22.sp).color(Colors.black.withOpacity(0.65)).make(),
|
||||
Spacer(),
|
||||
'60-89'
|
||||
.text
|
||||
.size(20.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 164.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16.w),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(vertical: 24.w),
|
||||
child: Row(
|
||||
children: [
|
||||
32.w.widthBox,
|
||||
left,
|
||||
Spacer(),
|
||||
mid,
|
||||
32.w.widthBox,
|
||||
right,
|
||||
24.w.widthBox,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column statusCard() {
|
||||
var heart = Container(
|
||||
width: 331.w,
|
||||
height: 204.w,
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Assets.icons.heartbeat.image(width: 40.w, height: 40.w),
|
||||
8.w.widthBox,
|
||||
'心率'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
'${_model?.heartRate}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 次/分'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make()
|
||||
])
|
||||
.size(56.sp)
|
||||
.bold
|
||||
.color(_model!.heartNormal ? Color(0xFF37C6BD) : Colors.red)
|
||||
.make(),
|
||||
Spacer(),
|
||||
'正常为60-100次/分'
|
||||
.text
|
||||
.size(20.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
);
|
||||
var fallDown = Container(
|
||||
width: 331.w,
|
||||
height: 204.w,
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Assets.icons.falldown.image(width: 40.w, height: 40.w),
|
||||
8.w.widthBox,
|
||||
'跌倒次数'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
'${_model?.fallNums}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 次'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make()
|
||||
])
|
||||
.size(56.sp)
|
||||
.bold
|
||||
.color(Colors.red)
|
||||
.make(),
|
||||
Spacer(),
|
||||
'如跌倒会报警至物业后台'
|
||||
.text
|
||||
.size(20.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
);
|
||||
var footSteps = Container(
|
||||
width: 331.w,
|
||||
height: 176.w,
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Assets.icons.foot.image(width: 40.w, height: 40.w),
|
||||
8.w.widthBox,
|
||||
'今日步数'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
'${_model?.todaySteps}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 步'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make()
|
||||
])
|
||||
.size(56.sp)
|
||||
.bold
|
||||
.color(Color(0xFF37C6BD))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
);
|
||||
var blood = Container(
|
||||
width: 331.w,
|
||||
height: 176.w,
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Assets.icons.oxygen.image(width: 40.w, height: 40.w),
|
||||
8.w.widthBox,
|
||||
'血氧饱和度'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
'${_model?.bloodOxygen}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' %'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make()
|
||||
])
|
||||
.size(56.sp)
|
||||
.bold
|
||||
.color(_model!.bloodOxygen >= 95
|
||||
? Color(0xFF37C6BD)
|
||||
: Colors.red)
|
||||
.make(),
|
||||
Spacer(),
|
||||
'正常为95%以上'
|
||||
.text
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [heart, 24.w.widthBox, fallDown],
|
||||
),
|
||||
40.w.heightBox,
|
||||
Row(
|
||||
children: [footSteps, 24.w.widthBox, blood],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container overview() {
|
||||
var left = Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'剩余电量'.text.size(28.sp).color(Colors.black.withOpacity(0.65)).make(),
|
||||
'${_model?.remainingPower}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' %'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.25))
|
||||
.make(),
|
||||
])
|
||||
.size(56.sp)
|
||||
.bold
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
);
|
||||
var mid = Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'检测天数'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
'${_model?.detectionDays}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 天'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
])
|
||||
.size(56.sp)
|
||||
.color(Color(0xFF17928A))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
var right = Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
'报警次数'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
'${_model?.alarmNums}'
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
' 次'
|
||||
.textSpan
|
||||
.size(22.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
])
|
||||
.size(56.sp)
|
||||
.color(Color(0xFFF5222D))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return Container(
|
||||
width: 686.w,
|
||||
height: 160.w,
|
||||
padding: EdgeInsets.symmetric(vertical: 26.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16.w),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
40.w.widthBox,
|
||||
left,
|
||||
BeeDivider.vertical(),
|
||||
mid,
|
||||
BeeDivider.vertical(),
|
||||
right
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
class AlarmModel {
|
||||
String? alarmNo;
|
||||
String? alarmType;
|
||||
String? deviceName;
|
||||
String? deviceNo;
|
||||
String? time;
|
||||
int? type;
|
||||
|
||||
AlarmModel(
|
||||
{this.alarmNo,
|
||||
this.alarmType,
|
||||
this.deviceName,
|
||||
this.deviceNo,
|
||||
this.time,
|
||||
this.type});
|
||||
|
||||
AlarmModel.fromJson(Map<String, dynamic> json) {
|
||||
alarmNo = json['alarmNo'];
|
||||
alarmType = json['alarmType'];
|
||||
deviceName = json['deviceName'];
|
||||
deviceNo = json['deviceNo'];
|
||||
time = json['time'];
|
||||
type = json['type'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['alarmNo'] = this.alarmNo;
|
||||
data['alarmType'] = this.alarmType;
|
||||
data['deviceName'] = this.deviceName;
|
||||
data['deviceNo'] = this.deviceNo;
|
||||
data['time'] = this.time;
|
||||
data['type'] = this.type;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'fall_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class FallModel {
|
||||
final String? userName;
|
||||
final String? tel;
|
||||
final String? address;
|
||||
final num? lon;
|
||||
final num? lat;
|
||||
final int? type;
|
||||
factory FallModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$FallModelFromJson(json);
|
||||
|
||||
const FallModel({
|
||||
this.userName,
|
||||
this.tel,
|
||||
this.address,
|
||||
this.lon,
|
||||
this.lat,
|
||||
this.type,
|
||||
});
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'fall_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
FallModel _$FallModelFromJson(Map<String, dynamic> json) => FallModel(
|
||||
userName: json['userName'] as String?,
|
||||
tel: json['tel'] as String?,
|
||||
address: json['address'] as String?,
|
||||
lon: json['lon'] as num?,
|
||||
lat: json['lat'] as num?,
|
||||
type: json['type'] as int?,
|
||||
);
|
@ -0,0 +1,25 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'fire_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class FireModel {
|
||||
String? alarmNo;
|
||||
String? alarmType;
|
||||
String? deviceName;
|
||||
String? deviceNo;
|
||||
String? time;
|
||||
int? type;
|
||||
|
||||
factory FireModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$FireModelFromJson(json);
|
||||
|
||||
FireModel({
|
||||
this.alarmNo,
|
||||
this.alarmType,
|
||||
this.deviceName,
|
||||
this.deviceNo,
|
||||
this.time,
|
||||
this.type,
|
||||
});
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'fire_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
FireModel _$FireModelFromJson(Map<String, dynamic> json) => FireModel(
|
||||
alarmNo: json['alarmNo'] as String?,
|
||||
alarmType: json['alarmType'] as String?,
|
||||
deviceName: json['deviceName'] as String?,
|
||||
deviceNo: json['deviceNo'] as String?,
|
||||
time: json['time'] as String?,
|
||||
type: json['type'] as int?,
|
||||
);
|