Skip to content

Commit 06dbb27

Browse files
committed
Update example
1 parent 07174f6 commit 06dbb27

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

flutter_cache_manager/example/lib/main.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:baseflow_plugin_template/baseflow_plugin_template.dart';
22
import 'package:example/plugin_example/download_page.dart';
33
import 'package:example/plugin_example/floating_action_button.dart';
4+
import 'package:flutter/foundation.dart' show kDebugMode;
45
import 'package:flutter/material.dart';
56
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
67

@@ -68,11 +69,13 @@ class CacheManagerPageState extends State<CacheManagerPage> {
6869

6970
void _removeFile() {
7071
DefaultCacheManager().removeFile(url).then((value) {
71-
//ignore: avoid_print
72-
print('File removed');
72+
if (kDebugMode) {
73+
print('File removed');
74+
}
7375
}).onError((error, stackTrace) {
74-
//ignore: avoid_print
75-
print(error);
76+
if (kDebugMode) {
77+
print(error);
78+
}
7679
});
7780
setState(() {
7881
fileStream = null;

flutter_cache_manager/example/lib/plugin_example/download_page.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ class DownloadPage extends StatelessWidget {
4747

4848
return Scaffold(
4949
body: body,
50-
floatingActionButton: !loading
51-
? Fab(
52-
downloadFile: downloadFile,
53-
)
54-
: null,
50+
floatingActionButton:
51+
!loading ? Fab(downloadFile: downloadFile) : null,
5552
);
5653
},
5754
);

flutter_cache_manager/example/lib/plugin_example/file_info_widget.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FileInfoWidget extends StatelessWidget {
1717
@override
1818
Widget build(BuildContext context) {
1919
return ListView(
20-
children: <Widget>[
20+
children: [
2121
ListTile(
2222
title: const Text('Original URL'),
2323
subtitle: Text(fileInfo.originalUrl),
@@ -36,15 +36,13 @@ class FileInfoWidget extends StatelessWidget {
3636
),
3737
Padding(
3838
padding: const EdgeInsets.all(10),
39-
// ignore: deprecated_member_use
4039
child: ElevatedButton(
4140
onPressed: clearCache,
4241
child: const Text('CLEAR CACHE'),
4342
),
4443
),
4544
Padding(
4645
padding: const EdgeInsets.all(10),
47-
// ignore: deprecated_member_use
4846
child: ElevatedButton(
4947
onPressed: removeFile,
5048
child: const Text('REMOVE FILE'),

flutter_cache_manager/example/lib/plugin_example/progress_indicator.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class ProgressIndicator extends StatelessWidget {
1313
return Center(
1414
child: Row(
1515
mainAxisAlignment: MainAxisAlignment.center,
16-
children: <Widget>[
16+
children: [
1717
SizedBox(
1818
width: 50,
1919
height: 50,
20-
child: CircularProgressIndicator(
20+
child: CircularProgressIndicator.adaptive(
2121
value: progress?.progress,
2222
),
2323
),

0 commit comments

Comments
 (0)