Skip to content

Commit

Permalink
kill xyz image url at api stream
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Nov 30, 2021
1 parent b5868f3 commit 8ebcccf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/basic/config/ImageAddress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Future<void> initImageAddress() async {
_currentImageAddress = await method.getImageSwitchAddress();
}

int currentImageAddress() {
return int.parse(_currentImageAddress);
}

String _currentImageAddressName() {
return _imageAddresses[_currentImageAddress] ?? "";
}
Expand Down Expand Up @@ -50,7 +54,7 @@ Widget imageSwitchAddressSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: Text("图片"),
title: Text("图片分流"),
subtitle: Text(_currentImageAddressName()),
onTap: () async {
await _chooseImageAddress(context);
Expand Down
4 changes: 3 additions & 1 deletion lib/screens/components/Images.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:pikapika/basic/Cross.dart';
import 'package:pikapika/basic/Method.dart';
import 'package:flutter_svg/svg.dart';
import 'package:pikapika/basic/config/ConvertToPNG.dart';
import 'package:pikapika/basic/config/ImageAddress.dart';
import 'dart:io';
import 'dart:ui' as ui show Codec;

Expand Down Expand Up @@ -220,7 +221,8 @@ class _RemoteImageState extends State<RemoteImage> {

@override
void initState() {
_mock = widget.fileServer == "";
_mock = widget.fileServer == "" ||
(widget.fileServer.contains(".xyz/") && currentImageAddress() < 0);
if (!_mock) {
_future = method
.remoteImageData(widget.fileServer, widget.path)
Expand Down

0 comments on commit 8ebcccf

Please sign in to comment.