File tree Expand file tree Collapse file tree 4 files changed +12
-14
lines changed
flutter_cache_manager/example/lib Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11import 'package:baseflow_plugin_template/baseflow_plugin_template.dart' ;
22import 'package:example/plugin_example/download_page.dart' ;
33import 'package:example/plugin_example/floating_action_button.dart' ;
4+ import 'package:flutter/foundation.dart' show kDebugMode;
45import 'package:flutter/material.dart' ;
56import '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 ;
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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' ),
Original file line number Diff line number Diff 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 ),
You can’t perform that action at this time.
0 commit comments