Merge branch 'dev'

* dev:
  完成报警页面
hmxc
小赖 4 years ago
commit 758b18b3ba

@ -62,6 +62,12 @@ android {
release {
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.release
}
profile{
signingConfig signingConfigs.release
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

@ -13,7 +13,9 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AmapCore.init('');
await AmapLocation.instance.init(iosKey: '');
runApp(MyApp());
}

@ -0,0 +1,7 @@
import 'package:permission_handler/permission_handler.dart';
class PermissionTool {
static Future<bool> getLocationPermission() async {
return await Permission.locationWhenInUse.request().isGranted;
}
}

@ -6,6 +6,7 @@ import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_page.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_page.dart';
import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_page.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@ -48,10 +49,10 @@ class _ApplicationPageState extends State<ApplicationPage>
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ActivityManagerPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, BorrowManagerPage()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, Scaffold()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, WarningPage()),
];
List<AppApplication> _wisdomApplications = [
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, Scaffold()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, WarningPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()),
AppApplication('报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, BusinessAndFixPage()),
AppApplication('物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG, ItemsOutdoorPage()),

@ -13,6 +13,7 @@ import 'package:aku_community_manager/ui/login/login_page.dart';
import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_page.dart';
import 'package:aku_community_manager/ui/tool_pages/scan_page.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_page.dart';
import 'package:aku_ui/aku_ui.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
@ -312,9 +313,12 @@ class _HomePageState extends State<HomePage> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_menuButton(
R.ASSETS_HOME_IC_POLICE_PNG, '一键报警', HomePage()),
_menuButton(R.ASSETS_HOME_IC_VISITORS_PNG, '访客管理',
VisitorManagerPage()),
R.ASSETS_HOME_IC_POLICE_PNG, '一键报警', WarningPage()),
_menuButton(
R.ASSETS_HOME_IC_VISITORS_PNG,
'访客管理',
VisitorManagerPage(),
),
_menuButton(
R.ASSETS_HOME_IC_SERVICE_PNG,
'报事报修',

@ -0,0 +1,43 @@
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:flutter/material.dart';
class WarningDetailPage extends StatefulWidget {
WarningDetailPage({Key key}) : super(key: key);
@override
_WarningDetailPageState createState() => _WarningDetailPageState();
}
class _WarningDetailPageState extends State<WarningDetailPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
appBarColor: Color(0xFFF9F9F9),
title: '功能说明',
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
Text(
'一键报警',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.w,
fontWeight: FontWeight.bold,
),
),
AkuBox.h(20),
Text(
'点击“呼叫110”后您可以直接拨打本地110。页面中提供了您当前所在位置以便您与警方沟通。GPS信号弱时位置可能存在偏移',
style: TextStyle(
color: Color(0xFF666666),
fontSize: 28.w,
),
),
],
),
// body: ,
);
}
}

@ -0,0 +1,252 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/permission_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_detail_page.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_sub_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_cupertino_button.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class WarningPage extends StatefulWidget {
WarningPage({Key key}) : super(key: key);
@override
_WarningPageState createState() => _WarningPageState();
}
class _WarningPageState extends State<WarningPage> {
AmapController _amapController;
Location _location;
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '一键报警',
actions: [
AkuMaterialButton(
padding: EdgeInsets.symmetric(horizontal: 32.w),
onPressed: () {
Get.to(WarningDetailPage());
},
child: Text(
'功能说明',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
),
),
),
],
body: Stack(
children: [
AmapView(
zoomLevel: 15,
showZoomControl: false,
showCompass: false,
showScaleControl: false,
onMapCreated: (controller) async {
_amapController = controller;
_getLocation();
},
),
///
Positioned(
top: 0,
left: 0,
right: 0,
child: Container(
margin: EdgeInsets.all(32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
color: Color(0xE8FFFFFF),
boxShadow: [
BoxShadow(
offset: Offset(0, 4.w),
blurRadius: 6.w,
spreadRadius: 4.w,
color: Color(0x1A5C5959),
),
],
),
padding: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 24.w,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'当前位置(仅供参考)',
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
),
),
AkuBox.h(20),
Row(
children: [
Image.asset(
R.ASSETS_MANAGE_LOCATION_PNG,
height: 29.w,
width: 21.w,
),
AkuBox.w(10),
Expanded(
child: Text(
_location?.address ?? '加载中',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
),
],
),
],
),
),
),
///
Positioned(
bottom: 0,
left: 0,
right: 0,
height: 271.w,
child: Container(
color: Colors.white.withOpacity(0.9),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'谎报警情,依法追责',
style: TextStyle(
color: Color(0xFFE02020),
fontSize: 32.sp,
fontWeight: FontWeight.w900,
),
),
AkuBox.h(8),
Text(
'谎报警情将可能被处以五日以上十日以下拘留',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
),
),
AkuBox.h(40),
],
),
),
),
///
Positioned(
bottom: 173.w,
left: 0,
right: 0,
child: Center(
child: Container(
height: 196.w,
width: 196.w,
alignment: Alignment.center,
child: AkuCupertinoButton(
minWidth: 0,
onPressed: () {
Get.to(WarningSubPage());
},
child: Container(
height: 172.w,
width: 172.w,
alignment: Alignment.center,
child: Image.asset(
R.ASSETS_MANAGE_POLICE_PNG,
height: 86.w,
width: 86.w,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular((172 / 2).w),
gradient: LinearGradient(
colors: [
Color(0xFFFF8880),
Color(0xFFEF0909),
],
begin: Alignment.topRight,
end: Alignment.bottomLeft,
),
boxShadow: [
BoxShadow(
color: Color(0x54FD7770),
offset: Offset(0, 10.w),
blurRadius: 20.w,
spreadRadius: 4.w,
),
],
),
),
),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.9),
borderRadius: BorderRadius.circular((196 / 2).w),
),
),
),
),
///
Positioned(
bottom: 300.w,
right: 34.w,
child: AkuCupertinoButton(
minWidth: 0,
onPressed: () {
_getLocation();
},
child: Container(
alignment: Alignment.center,
child: Image.asset(
R.ASSETS_MANAGE_DINGWEI_PNG,
height: 40.w,
width: 40.w,
),
height: 66.w,
width: 66.w,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
offset: Offset(3.w, 4.w),
blurRadius: 6.w,
spreadRadius: 1.w,
color: Color(0x1F000000),
)
],
borderRadius: BorderRadius.circular(33.w),
),
),
),
),
],
),
);
}
_getLocation() {
PermissionTool.getLocationPermission().then((state) {
if (state) {
AmapLocation.instance.fetchLocation().then((location) {
_amapController.setCenterCoordinate(location.latLng);
_location = location;
setState(() {});
});
}
});
}
}

@ -0,0 +1,99 @@
import 'dart:async';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_detail_page.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_success.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_cupertino_button.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class WarningSubPage extends StatefulWidget {
WarningSubPage({Key key}) : super(key: key);
@override
_WarningSubPageState createState() => _WarningSubPageState();
}
class _WarningSubPageState extends State<WarningSubPage> {
Timer _timer;
Timer _countTimer;
int _count = 3;
@override
void dispose() {
_timer?.cancel();
_countTimer?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '一键报警',
actions: [
AkuMaterialButton(
onPressed: () {
Get.to(WarningDetailPage());
},
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text('功能说明'),
)
],
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Stack(
children: [
GestureDetector(
onTapDown: (detail) {
BotToast.showText(text: _count.toString());
_countTimer = Timer.periodic(Duration(seconds: 1), (timer) {
_count--;
BotToast.showText(text: _count.toString());
});
_timer = Timer(Duration(seconds: 3), () {
Get.off(WarningSuccess());
});
},
onTapCancel: () {
_count = 3;
_timer?.cancel();
},
onTapUp: (detail) {
_count = 3;
_timer?.cancel();
},
child: Image.asset(
R.ASSETS_MANAGE_WARNING_PNG,
height: 420.w,
width: 420.w,
),
),
],
),
Text(
'深圳华悦茂峰',
style: TextStyle(
fontSize: 44.w,
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
),
),
AkuBox.h(8),
Text(
'请长按上方进行报警',
style: TextStyle(
fontSize: 30.w,
color: AppStyle.minorTextColor,
),
),
],
),
),
);
}
}

@ -0,0 +1,70 @@
import 'dart:async';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/tool_pages/warning/warning_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:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class WarningSuccess extends StatefulWidget {
WarningSuccess({Key key}) : super(key: key);
@override
_WarningSuccessState createState() => _WarningSuccessState();
}
class _WarningSuccessState extends State<WarningSuccess> {
Timer _timer;
@override
void dispose() {
_timer?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '一键报警',
actions: [
AkuMaterialButton(
onPressed: () {
Get.to(WarningDetailPage());
},
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text('功能说明'),
)
],
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
R.ASSETS_MANAGE_WARNING_PNG,
height: 420.w,
width: 420.w,
),
Text(
'深圳华悦茂峰',
style: TextStyle(
fontSize: 44.w,
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
),
),
AkuBox.h(8),
Text(
'报警成功',
style: TextStyle(
fontSize: 30.w,
color: AppStyle.minorTextColor,
),
),
],
),
),
);
}
}

@ -296,6 +296,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.2"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.1+1"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
pin_input_text_field:
dependency: "direct main"
description:

@ -60,6 +60,8 @@ dependencies:
amap_map_fluttify: ^0.29.0
permission_handler: ^5.0.1+1
aku_ui:
git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git

Loading…
Cancel
Save