簡體   English   中英

我有一個關於在 flutter 中使用擴展圖像的問題

[英]I have a question about using extended_image in flutter

嗨,我在使用顫振的擴展圖像時遇到了問題。

圖片是通過將url放在getExtendedImage方法中來渲染的,但是如果url是新更新的,不會立即反映,只有在熱重載或其他頁面訪問時才會更新渲染圖片。

一旦 url 被修改,我該如何反映?

 AnimationController extendedController;

void initState() {
    // TODO: implement initState
    NameController.text = GlobalProfile.loggedInUser.name;
    NickNameController.text = GlobalProfile.loggedInUser.nickName;
    PhoneNumController.text = GlobalProfile.loggedInUser.phone;
    // extendedController = AnimationController();
    super.initState();
    extendedController = AnimationController(
        vsync: this,
        duration: const Duration(seconds: 1),
        lowerBound: 0.0,
        upperBound: 1.0);
  }

//get_resize_image_name(GlobalProfile.loggedInUser.profileUrlList,120) returns url
getExtendedImage(get_resize_image_name(GlobalProfile.loggedInUser.profileUrlList,120), 0,extendedController),

使用 setState(){} 更新您的小部件

https://api.flutter.dev/flutter/widgets/State/setState.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM