Skip to content

Commit 225aa74

Browse files
open_wearable/lib/wigets/devices/device_detail/device_detail_page.dart: disabled fota for web, iOS and MacOS
1 parent e88a5ce commit 225aa74

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

open_wearable/ios/Podfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ PODS:
5353
- SDWebImage (5.21.0):
5454
- SDWebImage/Core (= 5.21.0)
5555
- SDWebImage/Core (5.21.0)
56+
- share_plus (0.0.1):
57+
- Flutter
5658
- SwiftCBOR (0.4.7)
5759
- SwiftProtobuf (1.29.0)
5860
- SwiftyGif (5.4.5)
@@ -71,6 +73,7 @@ DEPENDENCIES:
7173
- mcumgr_flutter (from `.symlinks/plugins/mcumgr_flutter/ios`)
7274
- objective_c (from `.symlinks/plugins/objective_c/ios`)
7375
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
76+
- share_plus (from `.symlinks/plugins/share_plus/ios`)
7477
- universal_ble (from `.symlinks/plugins/universal_ble/darwin`)
7578
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
7679

@@ -100,6 +103,8 @@ EXTERNAL SOURCES:
100103
:path: ".symlinks/plugins/objective_c/ios"
101104
permission_handler_apple:
102105
:path: ".symlinks/plugins/permission_handler_apple/ios"
106+
share_plus:
107+
:path: ".symlinks/plugins/share_plus/ios"
103108
universal_ble:
104109
:path: ".symlinks/plugins/universal_ble/darwin"
105110
url_launcher_ios:
@@ -117,6 +122,7 @@ SPEC CHECKSUMS:
117122
objective_c: 89e720c30d716b036faf9c9684022048eee1eee2
118123
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
119124
SDWebImage: f84b0feeb08d2d11e6a9b843cb06d75ebf5b8868
125+
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
120126
SwiftCBOR: 465775bed0e8bac7bfb8160bcf7b95d7f75971e4
121127
SwiftProtobuf: b7aa08087e2ab6d162862d143020091254095f69
122128
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4

open_wearable/lib/widgets/devices/device_detail/device_detail_page.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'dart:io';
2+
3+
import 'package:flutter/foundation.dart' show kIsWeb;
14
import 'package:flutter/material.dart';
25
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
36
import 'package:flutter_svg/flutter_svg.dart';
@@ -210,6 +213,28 @@ class _DeviceDetailPageState extends State<DeviceDetailPage> {
210213
trailing: PlatformIconButton(
211214
icon: Icon(Icons.upload),
212215
onPressed: () {
216+
// show an alert on ios and web that firmware update is not supported
217+
if (Platform.isIOS || Platform.isMacOS || kIsWeb) {
218+
showPlatformDialog(
219+
context: context,
220+
builder: (_) => PlatformAlertDialog(
221+
title: PlatformText('Firmware Update'),
222+
content: PlatformText(
223+
'Firmware update is not supported on this platform. '
224+
'Please use an Android device or J-Link to update the firmware.'
225+
),
226+
actions: <Widget>[
227+
PlatformDialogAction(
228+
cupertino: (_, __) => CupertinoDialogActionData(isDefaultAction: true),
229+
child: PlatformText('OK'),
230+
onPressed: () => Navigator.of(context).pop(),
231+
),
232+
],
233+
),
234+
);
235+
return;
236+
}
237+
213238
Provider.of<FirmwareUpdateRequestProvider>(
214239
context,
215240
listen: false,

0 commit comments

Comments
 (0)