Skip to content

Commit

Permalink
Added more icons
Browse files Browse the repository at this point in the history
  • Loading branch information
vovagorodok committed Jun 10, 2024
1 parent 9be1cd1 commit 354fd78
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 20 deletions.
4 changes: 2 additions & 2 deletions lib/src/screens/pin_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ class PinScreenState extends State<PinScreen> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton.icon(
icon: const Icon(Icons.upload),
icon: const Icon(Icons.upload_rounded),
label: Text(tr('Set')),
onPressed: _canSetPin() ? _setPin : null,
),
ElevatedButton.icon(
icon: const Icon(Icons.delete),
icon: const Icon(Icons.delete_rounded),
label: Text(tr('Remove')),
onPressed: _canChange() ? _removePin : null,
),
Expand Down
8 changes: 4 additions & 4 deletions lib/src/screens/scanner_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ScannerScreenState extends State<ScannerScreen> {
child: ListTile(
title: Text(device.name),
subtitle: Text("${device.id}\nRSSI: ${device.rssi}"),
leading: const Icon(Icons.bluetooth),
leading: const Icon(Icons.bluetooth_rounded),
onTap: () async {
_stopScan();
await Navigator.push(
Expand Down Expand Up @@ -103,7 +103,7 @@ class ScannerScreenState extends State<ScannerScreen> {
centerTitle: true,
actions: [
IconButton(
icon: const Icon(Icons.settings),
icon: const Icon(Icons.settings_rounded),
onPressed: () async {
_stopScan();
await Navigator.push(
Expand Down Expand Up @@ -132,14 +132,14 @@ class ScannerScreenState extends State<ScannerScreen> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ElevatedButton.icon(
icon: const Icon(Icons.search),
icon: const Icon(Icons.search_rounded),
label: Text(tr('Scan')),
onPressed: !bleScanner.state.scanIsInProgress
? _startScan
: null,
),
ElevatedButton.icon(
icon: const Icon(Icons.search_off),
icon: const Icon(Icons.search_off_rounded),
label: Text(tr('Stop')),
onPressed:
bleScanner.state.scanIsInProgress ? _stopScan : null,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SettingsScreenState extends State<SettingsScreen> {
centerTitle: true,
actions: [
IconButton(
icon: const Icon(Icons.cached),
icon: const Icon(Icons.cached_rounded),
onPressed: () => setState(Settings.clearCache),
),
],
Expand Down
42 changes: 34 additions & 8 deletions lib/src/screens/status_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ class StatusScreenState extends State<StatusScreen> {
}
}

IconData _determineIcon(BleStatus status) {
switch (status) {
case BleStatus.unsupported:
return Icons.bluetooth_disabled_rounded;
case BleStatus.unauthorized:
return Icons.person_off_rounded;
case BleStatus.poweredOff:
return Icons.bluetooth_disabled_rounded;
case BleStatus.locationServicesDisabled:
return Icons.location_off_rounded;
case BleStatus.ready:
return Icons.bluetooth_rounded;
default:
return Icons.autorenew_rounded;
}
}

void _evaluateBleStatus(BleStatus status) {
setState(() {
if (status == BleStatus.ready) {
Expand Down Expand Up @@ -62,15 +79,24 @@ class StatusScreenState extends State<StatusScreen> {
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(25.0),
child: Center(
child: Text(
_determineText(ble.status),
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
_determineText(ble.status),
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30.0,
),
),
const SizedBox(height: 20),
Icon(
_determineIcon(ble.status),
size: 100,
),
),
],
),
),
),
Expand Down
10 changes: 5 additions & 5 deletions lib/src/screens/upload_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ class UploadScreenState extends State<UploadScreen> {
} else if (uploadStatus == WorkStatus.error ||
infoStatus == WorkStatus.error) {
return const Icon(
Icons.error,
Icons.error_rounded,
color: Colors.red,
size: 56,
);
} else if (uploadStatus == WorkStatus.success) {
return const Icon(
Icons.done,
Icons.done_rounded,
color: Colors.green,
size: 56,
);
Expand Down Expand Up @@ -220,7 +220,7 @@ class UploadScreenState extends State<UploadScreen> {
subtitle: Text("v${sw.version}"),
trailing: sw.text != null
? IconButton(
icon: const Icon(Icons.info),
icon: const Icon(Icons.info_rounded),
onPressed: () async => await Navigator.push(
context,
MaterialPageRoute(
Expand Down Expand Up @@ -322,7 +322,7 @@ class UploadScreenState extends State<UploadScreen> {
centerTitle: true,
actions: [
IconButton(
icon: const Icon(Icons.pin),
icon: const Icon(Icons.pin_rounded),
onPressed: _canUpload()
? () async => await Navigator.push(
context,
Expand Down Expand Up @@ -360,7 +360,7 @@ class UploadScreenState extends State<UploadScreen> {
),
if (_canUploadLocalFile())
ElevatedButton.icon(
icon: const Icon(Icons.file_open),
icon: const Icon(Icons.file_open_rounded),
label: Text(tr('UploadFile')),
onPressed: _canUpload() ? _pickFile : null,
),
Expand Down

0 comments on commit 354fd78

Please sign in to comment.