我只是在做一些实践,并且不知道如何获得存储中存在的所有图像和视频的URI。
这是我的代码,
class Gallery extends StatefulWidget {
@override
_GalleryState createState() => new _GalleryState();
}
class _GalleryState extends State<Gallery> {
List<String> _uriList = new List<String>();
@override
void initState() {
super.initState();
setState((){
_uriList.add("WHat to enter here??");
});
}
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "Gallery",
home: new Scaffold(
appBar: new AppBar(
title: new Text("Gallery"),
),
body: new ListView.builder(
itemCount: _uriList.length,
itemBuilder: (BuildContext context, int index){
},
),
),
);
}
}