Skip to content

Commit b6b3db0

Browse files
committed
fix errors, warnings, notices
1 parent 5fc7752 commit b6b3db0

18 files changed

+167
-159
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.2.8+4\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.2.8+4\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.2.8+4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.1.11\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\LENOVO\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2023-06-22 17:33:23.370968","version":"3.10.3"}

flutter_cache_manager/example/lib/main.dart

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:baseflow_plugin_template/baseflow_plugin_template.dart';
22
import 'package:example/plugin_example/download_page.dart';
3-
import 'package:example/plugin_example/floating_action_button.dart';
43
import 'package:flutter/material.dart';
54
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
65

@@ -18,18 +17,20 @@ const url = 'https://blurha.sh/assets/images/img1.jpg';
1817

1918
/// Example [Widget] showing the functionalities of flutter_cache_manager
2019
class CacheManagerPage extends StatefulWidget {
21-
const CacheManagerPage({Key key}) : super(key: key);
20+
const CacheManagerPage({
21+
Key? key,
22+
}) : super(key: key);
2223

2324
static ExamplePage createPage() {
2425
return ExamplePage(Icons.save_alt, (context) => const CacheManagerPage());
2526
}
2627

2728
@override
28-
_CacheManagerPageState createState() => _CacheManagerPageState();
29+
CacheManagerPageState createState() => CacheManagerPageState();
2930
}
3031

31-
class _CacheManagerPageState extends State<CacheManagerPage> {
32-
Stream<FileResponse> fileStream;
32+
class CacheManagerPageState extends State<CacheManagerPage> {
33+
Stream<FileResponse>? fileStream;
3334

3435
void _downloadFile() {
3536
setState(() {
@@ -39,16 +40,6 @@ class _CacheManagerPageState extends State<CacheManagerPage> {
3940

4041
@override
4142
Widget build(BuildContext context) {
42-
if (fileStream == null) {
43-
return Scaffold(
44-
appBar: null,
45-
body: const ListTile(
46-
title: Text('Tap the floating action button to download.')),
47-
floatingActionButton: Fab(
48-
downloadFile: _downloadFile,
49-
),
50-
);
51-
}
5243
return DownloadPage(
5344
fileStream: fileStream,
5445
downloadFile: _downloadFile,
@@ -59,6 +50,7 @@ class _CacheManagerPageState extends State<CacheManagerPage> {
5950

6051
void _clearCache() {
6152
DefaultCacheManager().emptyCache();
53+
6254
setState(() {
6355
fileStream = null;
6456
});

flutter_cache_manager/example/lib/plugin_example/download_page.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ import 'progress_indicator.dart' as p_i;
77

88
/// A [Widget] showing the information about the status of the [FileResponse]
99
class DownloadPage extends StatelessWidget {
10-
final Stream<FileResponse> fileStream;
10+
final Stream<FileResponse>? fileStream;
1111
final VoidCallback downloadFile;
1212
final VoidCallback clearCache;
1313
final VoidCallback removeFile;
1414

1515
const DownloadPage({
16-
Key key,
16+
Key? key,
1717
this.fileStream,
18-
this.downloadFile,
19-
this.clearCache,
20-
this.removeFile,
18+
required this.downloadFile,
19+
required this.clearCache,
20+
required this.removeFile,
2121
}) : super(key: key);
2222

2323
@override

flutter_cache_manager/example/lib/plugin_example/file_info_widget.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ class FileInfoWidget extends StatelessWidget {
88
final VoidCallback removeFile;
99

1010
const FileInfoWidget({
11-
Key key,
12-
this.fileInfo,
13-
this.clearCache,
14-
this.removeFile,
11+
Key? key,
12+
required this.fileInfo,
13+
required this.clearCache,
14+
required this.removeFile,
1515
}) : super(key: key);
1616

1717
@override
@@ -22,11 +22,10 @@ class FileInfoWidget extends StatelessWidget {
2222
title: const Text('Original URL'),
2323
subtitle: Text(fileInfo.originalUrl),
2424
),
25-
if (fileInfo.file != null)
26-
ListTile(
27-
title: const Text('Local file path'),
28-
subtitle: Text(fileInfo.file.path),
29-
),
25+
ListTile(
26+
title: const Text('Local file path'),
27+
subtitle: Text(fileInfo.file.path),
28+
),
3029
ListTile(
3130
title: const Text('Loaded from'),
3231
subtitle: Text(fileInfo.source.toString()),
@@ -38,17 +37,17 @@ class FileInfoWidget extends StatelessWidget {
3837
Padding(
3938
padding: const EdgeInsets.all(10.0),
4039
// ignore: deprecated_member_use
41-
child: RaisedButton(
42-
child: const Text('CLEAR CACHE'),
40+
child: ElevatedButton(
4341
onPressed: clearCache,
42+
child: const Text('CLEAR CACHE'),
4443
),
4544
),
4645
Padding(
4746
padding: const EdgeInsets.all(10.0),
4847
// ignore: deprecated_member_use
49-
child: RaisedButton(
50-
child: const Text('REMOVE FILE'),
48+
child: ElevatedButton(
5149
onPressed: removeFile,
50+
child: const Text('REMOVE FILE'),
5251
),
5352
),
5453
],

flutter_cache_manager/example/lib/plugin_example/floating_action_button.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import 'package:flutter/material.dart';
33
/// A [FloatingActionButton] used for downloading a file in [CacheManagerPage]
44
class Fab extends StatelessWidget {
55
final VoidCallback downloadFile;
6-
const Fab({Key key, this.downloadFile}) : super(key: key);
6+
const Fab({
7+
Key? key,
8+
required this.downloadFile,
9+
}) : super(key: key);
710

811
@override
912
Widget build(BuildContext context) {

flutter_cache_manager/example/lib/plugin_example/progress_indicator.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart';
66
class ProgressIndicator extends StatelessWidget {
77
final DownloadProgress progress;
88

9-
const ProgressIndicator({Key key, this.progress}) : super(key: key);
9+
const ProgressIndicator({
10+
Key? key,
11+
required this.progress,
12+
}) : super(key: key);
1013

1114
@override
1215
Widget build(BuildContext context) {
@@ -18,7 +21,7 @@ class ProgressIndicator extends StatelessWidget {
1821
width: 50.0,
1922
height: 50.0,
2023
child: CircularProgressIndicator(
21-
value: progress?.progress,
24+
value: progress.progress,
2225
),
2326
),
2427
const SizedBox(width: 20.0),

flutter_cache_manager/example/linux/flutter/generated_plugins.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
66
url_launcher_linux
77
)
88

9+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
10+
)
11+
912
set(PLUGIN_BUNDLED_LIBRARIES)
1013

1114
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
1417
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
1518
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
1619
endforeach(plugin)
20+
21+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
23+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24+
endforeach(ffi_plugin)

flutter_cache_manager/example/macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import FlutterMacOS
66
import Foundation
77

8-
import path_provider_macos
8+
import path_provider_foundation
99
import sqflite
1010
import url_launcher_macos
1111

flutter_cache_manager/example/pubspec.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ publish_to: none
55
version: 1.0.0+1
66

77
environment:
8-
sdk: ">=2.10.2 <3.0.0"
8+
sdk: ">=3.0.0 <4.0.0"
99

1010
dependencies:
1111
baseflow_plugin_template:
1212
git:
13-
url: https://github.com/Baseflow/baseflow_plugin_template.git
14-
ref: v1.0.0
15-
cupertino_icons: ^1.0.2
13+
url: https://github.com/usefulteam/baseflow_plugin_template.git
14+
ref: master
15+
cupertino_icons: ^1.0.5
1616
flutter:
1717
sdk: flutter
1818
flutter_cache_manager:
1919
path: ../
20-
url_launcher: ^5.4.11
20+
url_launcher: ^6.1.11
2121

2222
dev_dependencies:
2323
flutter_test:
2424
sdk: flutter
25-
flutter_lints: ^1.0.4
25+
flutter_lints: ^2.0.1
2626

2727

2828
# The following section is specific to Flutter.

flutter_cache_manager/example/windows/flutter/generated_plugin_registrant.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
#include "generated_plugin_registrant.h"
88

9-
#include <url_launcher_windows/url_launcher_plugin.h>
9+
#include <url_launcher_windows/url_launcher_windows.h>
1010

1111
void RegisterPlugins(flutter::PluginRegistry* registry) {
12-
UrlLauncherPluginRegisterWithRegistrar(
13-
registry->GetRegistrarForPlugin("UrlLauncherPlugin"));
12+
UrlLauncherWindowsRegisterWithRegistrar(
13+
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
1414
}

0 commit comments

Comments
 (0)