and so on

This commit is contained in:
2026-08-18 08:52:33 +08:00
parent 87609c7dc4
commit ab75e8c5b0
56 changed files with 1816 additions and 1146 deletions

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/services.dart';
import 'package:image_picker/image_picker.dart';
import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
import '../cubit/report_cubit.dart';
import '../states/report_state.dart';
import '../constants/report_constants.dart';
@@ -30,10 +31,11 @@ class _ReportPageContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.dark,
value: isDark ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark,
child: Scaffold(
backgroundColor: AppColors.cardBackground,
backgroundColor: context.appColors.pageBackground,
body: BlocConsumer<ReportCubit, ReportState>(
listener: (context, state) {
if (state is ReportFormState) {
@@ -60,8 +62,8 @@ class _ReportPageContent extends StatelessWidget {
},
builder: (context, state) {
if (state is ReportSubmitting || state is ReportDevicesLoading) {
return const Center(
child: CircularProgressIndicator(color: AppColors.primary),
return Center(
child: CircularProgressIndicator(color: context.appColors.primary),
);
}
@@ -90,7 +92,7 @@ class _ReportPageContent extends StatelessWidget {
return PreferredSize(
preferredSize: const Size.fromHeight(100),
child: Container(
color: AppColors.background,
color: context.appColors.cardBackground,
child: SafeArea(
bottom: false,
child: Padding(
@@ -102,22 +104,22 @@ class _ReportPageContent extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
Text(
'现场上报',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: context.appColors.textPrimary,
),
),
GestureDetector(
onTap: () {
context.read<ReportCubit>().submitReport();
},
child: const Text(
child: Text(
'提交',
style: TextStyle(
color: AppColors.primary,
color: context.appColors.primary,
fontSize: 18,
fontWeight: FontWeight.w600,
),
@@ -132,9 +134,9 @@ class _ReportPageContent extends StatelessWidget {
},
child: Row(
children: [
const Icon(
Icon(
Icons.location_on,
color: AppColors.primary,
color: context.appColors.primary,
size: 16,
),
const SizedBox(width: 6),
@@ -143,7 +145,7 @@ class _ReportPageContent extends StatelessWidget {
state.location,
style: TextStyle(
fontSize: 14,
color: AppColors.textSecondary,
color: context.appColors.textSecondary,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
@@ -153,7 +155,7 @@ class _ReportPageContent extends StatelessWidget {
Icon(
Icons.arrow_drop_down,
size: 20,
color: AppColors.textHint,
color: context.appColors.textTertiary,
),
],
),
@@ -327,7 +329,7 @@ class _ReportPageContent extends StatelessWidget {
showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
backgroundColor: context.appColors.cardBackground,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
@@ -340,12 +342,12 @@ class _ReportPageContent extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
Text(
'选择场站',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Color(0xFF1D2129),
color: context.appColors.textPrimary,
),
),
const SizedBox(height: 14),
@@ -364,7 +366,7 @@ class _ReportPageContent extends StatelessWidget {
? Text('站点编码: ${site.siteCode}')
: null,
trailing: isSelected
? const Icon(Icons.check, color: Color(0xFF165DFF))
? Icon(Icons.check, color: context.appColors.primary)
: null,
onTap: () {
cubit.selectSite(site);
@@ -462,12 +464,15 @@ class _ReportPageContent extends StatelessWidget {
if (isRobotType) {
if (newState.robots.isEmpty) {
deviceList = [
const Center(
Center(
child: Padding(
padding: EdgeInsets.all(32),
child: Text(
'暂无机器人数据',
style: TextStyle(fontSize: 14, color: Color(0xFF86909C)),
style: TextStyle(
fontSize: 14,
color: context.appColors.textTertiary,
),
),
),
),
@@ -492,12 +497,15 @@ class _ReportPageContent extends StatelessWidget {
} else if (isDroneType) {
if (newState.drones.isEmpty) {
deviceList = [
const Center(
Center(
child: Padding(
padding: EdgeInsets.all(32),
child: Text(
'暂无无人机数据',
style: TextStyle(fontSize: 14, color: Color(0xFF86909C)),
style: TextStyle(
fontSize: 14,
color: context.appColors.textTertiary,
),
),
),
),
@@ -520,7 +528,7 @@ class _ReportPageContent extends StatelessWidget {
showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
backgroundColor: context.appColors.cardBackground,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
@@ -535,10 +543,10 @@ class _ReportPageContent extends StatelessWidget {
children: [
Text(
isRobotType ? '选择机器人' : '选择无人机',
style: const TextStyle(
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Color(0xFF1D2129),
color: context.appColors.textPrimary,
),
),
const SizedBox(height: 14),