Skip to content

Commit 5960d47

Browse files
authored
example app: add tooltips to IconButtons (#703)
1 parent 7ae50ef commit 5960d47

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
TargetAttributes = {
174174
97C146ED1CF9000F007C117D = {
175175
CreatedOnToolsVersion = 7.3.1;
176-
DevelopmentTeam = D6K7BXSRRF;
176+
DevelopmentTeam = VX8P4VC6NH;
177177
ProvisioningStyle = Automatic;
178178
SystemCapabilities = {
179179
com.apple.BackgroundModes = {
@@ -435,7 +435,7 @@
435435
CODE_SIGN_IDENTITY = "Apple Development";
436436
CODE_SIGN_STYLE = Automatic;
437437
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
438-
DEVELOPMENT_TEAM = D6K7BXSRRF;
438+
DEVELOPMENT_TEAM = VX8P4VC6NH;
439439
ENABLE_BITCODE = NO;
440440
FRAMEWORK_SEARCH_PATHS = (
441441
"$(inherited)",

example/lib/download_list_item.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class DownloadListItem extends StatelessWidget {
2222
onPressed: () => onActionTap?.call(task),
2323
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
2424
icon: const Icon(Icons.file_download),
25+
tooltip: 'Start',
2526
);
2627
} else if (task.status == DownloadTaskStatus.running) {
2728
return Row(
@@ -30,7 +31,8 @@ class DownloadListItem extends StatelessWidget {
3031
IconButton(
3132
onPressed: () => onActionTap?.call(task),
3233
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
33-
icon: const Icon(Icons.pause, color: Colors.red),
34+
icon: const Icon(Icons.pause, color: Colors.yellow),
35+
tooltip: 'Pause',
3436
),
3537
],
3638
);
@@ -42,12 +44,14 @@ class DownloadListItem extends StatelessWidget {
4244
onPressed: () => onActionTap?.call(task),
4345
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
4446
icon: const Icon(Icons.play_arrow, color: Colors.green),
47+
tooltip: 'Resume',
4548
),
4649
if (onCancel != null)
4750
IconButton(
4851
onPressed: () => onCancel?.call(task),
4952
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
50-
icon: const Icon(Icons.cancel),
53+
icon: const Icon(Icons.cancel, color: Colors.red),
54+
tooltip: 'Cancel',
5155
),
5256
],
5357
);
@@ -61,6 +65,7 @@ class DownloadListItem extends StatelessWidget {
6165
onPressed: () => onActionTap?.call(task),
6266
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
6367
icon: const Icon(Icons.delete),
68+
tooltip: 'Delete',
6469
)
6570
],
6671
);
@@ -75,6 +80,7 @@ class DownloadListItem extends StatelessWidget {
7580
onPressed: () => onActionTap?.call(task),
7681
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
7782
icon: const Icon(Icons.cancel),
83+
tooltip: 'Cancel',
7884
)
7985
],
8086
);
@@ -88,6 +94,7 @@ class DownloadListItem extends StatelessWidget {
8894
onPressed: () => onActionTap?.call(task),
8995
constraints: const BoxConstraints(minHeight: 32, minWidth: 32),
9096
icon: const Icon(Icons.refresh, color: Colors.green),
97+
tooltip: 'Refresh',
9198
)
9299
],
93100
);

example/lib/home_page.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ class _MyHomePageState extends State<MyHomePage> {
202202
);
203203
}
204204

205-
// Not used in the example.
206-
// Future<void> _cancelDownload(TaskInfo task) async {
207-
// await FlutterDownloader.cancel(taskId: task.taskId!);
208-
// }
209-
210205
Future<void> _pauseDownload(TaskInfo task) async {
211206
await FlutterDownloader.pause(taskId: task.taskId!);
212207
}
@@ -376,13 +371,16 @@ class _MyHomePageState extends State<MyHomePage> {
376371
PopupMenuButton<Function>(
377372
icon: const Icon(Icons.more_vert, color: Colors.white),
378373
shape: RoundedRectangleBorder(
379-
borderRadius: BorderRadius.circular(8)),
374+
borderRadius: BorderRadius.circular(8),
375+
),
380376
itemBuilder: (context) => [
381377
PopupMenuItem(
382378
onTap: () => exit(0),
383379
child: const ListTile(
384-
title: Text('Simulate App Backgrounded',
385-
style: TextStyle(fontSize: 15)),
380+
title: Text(
381+
'Simulate App Backgrounded',
382+
style: TextStyle(fontSize: 15),
383+
),
386384
),
387385
),
388386
],

example/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ environment:
99

1010
dependencies:
1111
android_path_provider: ^0.3.0
12-
cupertino_icons: ^1.0.5
1312
device_info: ^2.0.3
1413
flutter:
1514
sdk: flutter

0 commit comments

Comments
 (0)