mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
replace errorWidget with errorBuilder in CachedNetworkSVGImage
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -14,7 +14,7 @@ class CachedNetworkSVGImage extends StatefulWidget {
|
|||||||
Key? key,
|
Key? key,
|
||||||
String? cacheKey,
|
String? cacheKey,
|
||||||
Widget? placeholder,
|
Widget? placeholder,
|
||||||
Widget? errorWidget,
|
WidgetBuilder? errorBuilder,
|
||||||
double? width,
|
double? width,
|
||||||
double? height,
|
double? height,
|
||||||
Map<String, String>? headers,
|
Map<String, String>? headers,
|
||||||
@@ -31,7 +31,7 @@ class CachedNetworkSVGImage extends StatefulWidget {
|
|||||||
}) : _url = url,
|
}) : _url = url,
|
||||||
_cacheKey = cacheKey,
|
_cacheKey = cacheKey,
|
||||||
_placeholder = placeholder,
|
_placeholder = placeholder,
|
||||||
_errorWidget = errorWidget,
|
_errorBuilder = errorBuilder,
|
||||||
_width = width,
|
_width = width,
|
||||||
_height = height,
|
_height = height,
|
||||||
_headers = headers,
|
_headers = headers,
|
||||||
@@ -50,7 +50,7 @@ class CachedNetworkSVGImage extends StatefulWidget {
|
|||||||
final String _url;
|
final String _url;
|
||||||
final String? _cacheKey;
|
final String? _cacheKey;
|
||||||
final Widget? _placeholder;
|
final Widget? _placeholder;
|
||||||
final Widget? _errorWidget;
|
final WidgetBuilder? _errorBuilder;
|
||||||
final double? _width;
|
final double? _width;
|
||||||
final double? _height;
|
final double? _height;
|
||||||
final Map<String, String>? _headers;
|
final Map<String, String>? _headers;
|
||||||
@@ -172,7 +172,8 @@ class _CachedNetworkSVGImageState extends State<CachedNetworkSVGImage> {
|
|||||||
|
|
||||||
Widget _buildPlaceholderWidget() => Center(child: widget._placeholder);
|
Widget _buildPlaceholderWidget() => Center(child: widget._placeholder);
|
||||||
|
|
||||||
Widget _buildErrorWidget() => Center(child: widget._errorWidget);
|
Widget _buildErrorWidget() =>
|
||||||
|
Center(child: widget._errorBuilder?.call(context));
|
||||||
|
|
||||||
Widget? _buildSVGImage() {
|
Widget? _buildSVGImage() {
|
||||||
if (_svgString == null) {
|
if (_svgString == null) {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
placeholderBuilder: (_) => Text(latex),
|
placeholderBuilder: (_) => Text(latex),
|
||||||
errorWidget: Text(latex),
|
errorBuilder: (_) => Text(latex),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user