Skip to content

Instantly share code, notes, and snippets.

@nbnD
Created September 11, 2022 06:18
Show Gist options
  • Save nbnD/ace6ca409a1041881f1a7548af641ac9 to your computer and use it in GitHub Desktop.
Save nbnD/ace6ca409a1041881f1a7548af641ac9 to your computer and use it in GitHub Desktop.
GridView.builder(
itemCount: fileList.length,
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
itemBuilder: (BuildContext context, int i) {
return Container(
padding: const EdgeInsets.all(10),
child: Stack(
children: <Widget>[
SizedBox(
height: 100,
width: 100,
child: Image.file(File(fileList[i]!.path),fit: BoxFit.cover,),
),
Positioned(
right: 1,
child: GestureDetector(
onTap: () {
setState(() {
dltImages(fileList[i]);
});
},
child: const Icon(Icons.cancel, color: Colors.red),
))
],
),
);
},
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment