forked from fossasia/pslab-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgas_sensor_screen.dart
More file actions
116 lines (109 loc) · 3.62 KB
/
Copy pathgas_sensor_screen.dart
File metadata and controls
116 lines (109 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:pslab/l10n/app_localizations.dart';
import 'package:pslab/providers/locator.dart';
import 'package:pslab/view/widgets/common_scaffold_widget.dart';
class GasSensorScreen extends StatefulWidget {
const GasSensorScreen({super.key});
@override
State<GasSensorScreen> createState() => _GasSensorScreenState();
}
class _GasSensorScreenState extends State<GasSensorScreen> {
AppLocalizations appLocalizations = getIt.get<AppLocalizations>();
@override
void initState() {
super.initState();
_setPortraitOrientation();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
}
@override
void didChangeDependencies() {
_setPortraitOrientation();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
super.didChangeDependencies();
}
void _setPortraitOrientation() {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
}
@override
Widget build(BuildContext context) {
return CommonScaffold(
title: appLocalizations.gasSensor,
body: Center(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.air,
size: 120,
color: Colors.grey.shade400,
),
const SizedBox(height: 32),
Text(
appLocalizations.gasSensor,
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
const SizedBox(height: 16),
Text(
appLocalizations.screenNotImplemented,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Colors.grey.shade600,
),
),
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.blue.shade50,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.blue.shade200),
),
child: Column(
children: [
Icon(
Icons.info_outline,
color: Colors.blue.shade700,
size: 32,
),
const SizedBox(height: 8),
Text(
appLocalizations.gasSensorDesc,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.blue.shade900,
fontSize: 14,
),
),
],
),
),
const SizedBox(height: 32),
ElevatedButton.icon(
onPressed: () {
Navigator.pop(context);
},
icon: const Icon(Icons.arrow_back),
label: Text(appLocalizations.back),
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
),
),
],
),
),
),
);
}
}