release 1.0.1: add check widget if mounted when setState

master
Jpeng 5 years ago
parent 32547e8642
commit e8667fb5c5

@ -4,3 +4,6 @@
## 1.0.0 ## 1.0.0
* init release * init release
## 1.0.1
* add check mounted when setState

@ -7,14 +7,14 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.4" version: "1.0.5"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
@ -47,7 +47,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "1.0.0" version: "1.0.1"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -66,28 +66,28 @@ packages:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.6" version: "1.1.7"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.6.2" version: "1.6.4"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
name: pedantic name: pedantic
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.7.0" version: "1.8.0+1"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
name: quiver name: quiver
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.3" version: "2.0.5"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -120,7 +120,7 @@ packages:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.4" version: "1.0.5"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:

@ -125,6 +125,7 @@ class GifImageState extends State<GifImage>{
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
if (widget.image != oldWidget.image) { if (widget.image != oldWidget.image) {
fetchGif(widget.image).then((imageInfors){ fetchGif(widget.image).then((imageInfors){
if(mounted)
setState(() { setState(() {
_infos = imageInfors; _infos = imageInfors;
_fetchComplete=true; _fetchComplete=true;
@ -143,6 +144,7 @@ class GifImageState extends State<GifImage>{
void _listener(){ void _listener(){
if(_curIndex!=widget.controller.value&&_fetchComplete){ if(_curIndex!=widget.controller.value&&_fetchComplete){
if(mounted)
setState(() { setState(() {
_curIndex = widget.controller.value.toInt(); _curIndex = widget.controller.value.toInt();
}); });
@ -154,6 +156,7 @@ class GifImageState extends State<GifImage>{
super.didChangeDependencies(); super.didChangeDependencies();
if(_infos==null){ if(_infos==null){
fetchGif(widget.image).then((imageInfors){ fetchGif(widget.image).then((imageInfors){
if(mounted)
setState(() { setState(() {
_infos = imageInfors; _infos = imageInfors;
_fetchComplete=true; _fetchComplete=true;

@ -19,7 +19,7 @@ packages:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.6" version: "1.1.7"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter

@ -1,6 +1,6 @@
name: flutter_gifimage name: flutter_gifimage
description: a gifimage for flutter,for solving gif cannot be controlled speed,progress description: a gifimage for flutter,for solving gif cannot be controlled speed,progress
version: 1.0.0 version: 1.0.1
author: Jpeng <peng8350@gmail.com> author: Jpeng <peng8350@gmail.com>
homepage: https://github.com/peng8350/flutter_gifimage homepage: https://github.com/peng8350/flutter_gifimage

Loading…
Cancel
Save