/
screens.dart
60 lines (57 loc) · 2.2 KB
/
screens.dart
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
import 'package:ble_inspector/styles.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_blue/flutter_blue.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class CupertinoBluetoothOffPage extends StatelessWidget {
const CupertinoBluetoothOffPage({Key? key, required this.state})
: super(key: key);
final BluetoothState? state;
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
backgroundColor: Styles.scaffoldBackground,
navigationBar: CupertinoNavigationBar(
middle: Text(AppLocalizations.of(context)!.bleInspector),
),
child: SafeArea(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: MediaQuery.of(context).size.width - 20,
decoration: BoxDecoration(
color: Styles.deviceBackground,
borderRadius: BorderRadius.circular(10),
shape: BoxShape.rectangle,
),
child: Padding(
padding: const EdgeInsets.all(8),
child: Column(children: [
SizedBox(height: 50),
Icon(
Icons.bluetooth_disabled,
size: 40.0,
color: Styles.batteryIconColorLow,
),
SizedBox(height: 30),
Text(
'Bluetooth Adapter is ${state != null ? state.toString().substring(15) : 'not available'}.',
style: Styles.deviceName),
SizedBox(height: 30),
Text(AppLocalizations.of(context)!.enableBluetooth,
style: Styles.deviceDataLabel),
SizedBox(height: 50),
]),
),
),
SizedBox(height: 50),
]),
),
),
);
}
}