mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-02 00:58:19 +08:00
committed by
GitHub
parent
d4d9fc3405
commit
b3e2dcf2c5
@@ -1,6 +1,5 @@
|
||||
import 'dart:async' show FutureOr;
|
||||
import 'dart:convert' show utf8, jsonDecode;
|
||||
import 'dart:io' show File;
|
||||
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
@@ -122,8 +121,7 @@ Future<void> importFromLocalFile<T>({
|
||||
allowedExtensions: const ['json', 'txt'],
|
||||
);
|
||||
if (result != null) {
|
||||
final path = result.xFile.path;
|
||||
final data = await File(path).readAsString();
|
||||
final data = await result.xFile.readAsString();
|
||||
final T json;
|
||||
try {
|
||||
json = jsonDecode(data);
|
||||
@@ -179,7 +177,7 @@ void importFromInput<T>(
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
color: ColorScheme.of(context).outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -10,9 +10,9 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class CachedNetworkSVGImage extends StatefulWidget {
|
||||
CachedNetworkSVGImage(
|
||||
String url, {
|
||||
this._url, {
|
||||
Key? key,
|
||||
String? cacheKey,
|
||||
this._cacheKey,
|
||||
this._placeholder,
|
||||
this._errorBuilder,
|
||||
this._width,
|
||||
@@ -28,10 +28,8 @@ class CachedNetworkSVGImage extends StatefulWidget {
|
||||
this._colorFilter,
|
||||
this._placeholderBuilder,
|
||||
BaseCacheManager? cacheManager,
|
||||
}) : _url = url,
|
||||
_cacheKey = cacheKey,
|
||||
_cacheManager = cacheManager ?? DefaultCacheManager(),
|
||||
super(key: key ?? ValueKey(cacheKey ?? url));
|
||||
}) : _cacheManager = cacheManager ?? DefaultCacheManager(),
|
||||
super(key: key ?? ValueKey(_cacheKey ?? _url));
|
||||
|
||||
final String _url;
|
||||
final String? _cacheKey;
|
||||
|
||||
Reference in New Issue
Block a user