作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 CircleAvatar 的 backgroundImage 属性中的 MemoryImage 渲染 base64 图像,并经常重新加载 ListView,每次 ListView 重新加载时,图像中都会出现非常明显的闪烁,从蓝色圆圈开始,然后变成适当的图像。我想知道如何摆脱闪烁。
这是一个完整的例子:
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Image Flickering Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Image Flickering Example'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String img = "\/9j\/4QBqRXhpZgAATU0AKgAAAAgABAEAAAQAAAABAAAASwEBAAQAAAABAAAAZIdpAAQAAAABAAAAPgESAAMAAAABAAAAAAAAAAAAAZIIAAQAAAABAAAAAAAAAAAAAQESAAMAAAABAAAAAAAAAAD\/4AAQSkZJRgABAQAAAQABAAD\/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH\/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH\/wAARCABkAEsDASIAAhEBAxEB\/8QAHgAAAgIDAQEBAQAAAAAAAAAABwgGCQAEBQMBAgr\/xAAvEAACAgICAQMEAgICAQUAAAABAgMEBREGEiEABxMUIjFBFTIII1FhQglDUnGB\/8QAGwEAAwEAAwEAAAAAAAAA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XSl1B+0q2+sYUjt1KkggggDPWegkk3JPXHBr19hgdcv5jmcdi8nYpNWrtVgssojg0JDEjshlk7\/OSCo20csbkkt276YBDimcv35pJbDoWmt2HYBToF2V2692cjzIQNklVVQpAB3nrPTFDXz9sYqaeftgqQsQSPHgjzr87dD5A0PBOxoDyBvevUqwjtDfoMh0Szg\/rwAT+tfnQB3+gPWes9GX4T5fcYxTunp7Ycjg2TtUq9AQMoFh7IlDLsMIkg6+AR+jpt7B9GCWJGctojsEYgE6BZFJA3s6G\/GyTr8k+s9Z6Rwyq\/r\/ANHH\/9k=";
Widget body = Text("...");
void _updateListView() {
Widget listView = ListView.builder(
itemCount: 1,
itemBuilder: (BuildContext context, int index){
return Card(
child: CircleAvatar(
backgroundImage: MemoryImage(base64Decode(img)),
),
);
},
);
setState(() {
body = listView;
});
}
Timer listRefreshTimer;
void listRefresher(){
const oneSec = const Duration(seconds: 1);
listRefreshTimer = new Timer.periodic(oneSec,(Timer t){
_updateListView();
});
}
@override
void initState() {
// TODO: implement initState
super.initState();
listRefresher();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body:body
);
}
}
最佳答案
将解码的结果移动到一个变量中,这样它就不会在每次状态更新时重新运行:
class _MyHomePageState extends State<MyHomePage> {
final img = base64Decode("\/9j\/4QBqRXhpZgAATU0AKgAAAAgABAEAAAQAAAABAAAASwEBAAQAAAABAAAAZIdpAAQAAAABAAAAPgESAAMAAAABAAAAAAAAAAAAAZIIAAQAAAABAAAAAAAAAAAAAQESAAMAAAABAAAAAAAAAAD\/4AAQSkZJRgABAQAAAQABAAD\/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH\/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH\/wAARCABkAEsDASIAAhEBAxEB\/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bqCpAA148eCSfLeRJMXw7BWJGaeq0xVo1X5HDgBye2gykDYUDwNePWes9cUSASCQdxBvguoGjGNNMTWrhcRQjT6TG0oT8qqGWtEXG0LkiRlZyew35YgbJA2FKySKVukRbTjbp0bfXSl1B+0q2+sYUjt1KkggggDPWegkk3JPXHBr19hgdcv5jmcdi8nYpNWrtVgssojg0JDEjshlk7\/OSCo20csbkkt276YBDimcv35pJbDoWmt2HYBToF2V2692cjzIQNklVVQpAB3nrPTFDXz9sYqaeftgqQsQSPHgjzr87dD5A0PBOxoDyBvevUqwjtDfoMh0Szg\/rwAT+tfnQB3+gPWes9GX4T5fcYxTunp7Ycjg2TtUq9AQMoFh7IlDLsMIkg6+AR+jpt7B9GCWJGctojsEYgE6BZFJA3s6G\/GyTr8k+s9Z6Rwyq\/r\/ANHH\/9k=");
Widget body = Text("...");
void _updateListView() {
Widget listView = ListView.builder(
itemCount: 1,
itemBuilder: (BuildContext context, int index) {
return Card(
child: CircleAvatar(
maxRadius: 40,
backgroundImage: MemoryImage(img),
关于flutter - 使用 flutter,每次我重新加载 ListView 时,我的带有 MemoryImage 的 CircleAvatar 都会闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59221538/
我正在使用 CircleAvatar 的 backgroundImage 属性中的 MemoryImage 渲染 base64 图像,并经常重新加载 ListView,每次 ListView 重新加载
我正在使用 CircleAvatar 的 backgroundImage 属性中的 MemoryImage 渲染 base64 图像,并经常重新加载 ListView,每次 ListView 重新加载
我是一名优秀的程序员,十分优秀!