89 lines
2.2 KiB
Dart
89 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
import 'package:starwork_flutter/base/app_permission.dart';
|
|
|
|
import 'home_controller.dart';
|
|
|
|
class HomeView extends GetView<HomeController> {
|
|
const HomeView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
child: Container(
|
|
width: 1.sw,
|
|
padding: EdgeInsets.symmetric(horizontal: 15.w),
|
|
child: Column(
|
|
children: [
|
|
_buildPageHead(),
|
|
_buildSystemNotificationPermissionRow(),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
_buildPageHead() {
|
|
return Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
'19104656的互联',
|
|
style: TextStyle(
|
|
fontSize: 18.sp,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
Icon(
|
|
Icons.arrow_right_rounded,
|
|
size: 24.sp,
|
|
)
|
|
],
|
|
),
|
|
Icon(
|
|
Icons.add_circle_outline_rounded,
|
|
size: 24.sp,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
_buildSystemNotificationPermissionRow() {
|
|
return Visibility(
|
|
visible: !controller.isOpenNotificationPermission.value,
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
color: Color(0xFFfdefdf),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Text(
|
|
'系统通知未开启,报警消息无法通知'.tr,
|
|
style: TextStyle(
|
|
color: Color(0xFFea8720),
|
|
),
|
|
),
|
|
Container(
|
|
child: Text(
|
|
'去开启'.tr,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|