Skip to content

Commit 2d1a823

Browse files
committed
Add missing setState
1 parent 40a5f11 commit 2d1a823

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/main.dart

+9-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
3434
);
3535

3636
if (file != null) {
37-
_file = File(file.files.single.path!);
38-
_platformFile = file.files.first;
37+
setState(() {
38+
_file = File(file.files.single.path!);
39+
_platformFile = file.files.first;
40+
});
3941
}
4042

4143
loadingController.forward();
@@ -51,6 +53,11 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
5153
super.initState();
5254
}
5355

56+
//////////////////////////////////
57+
/// @theflutterlover on Instagram
58+
///
59+
/// https://afgprogrammer.com
60+
//////////////////////////////////
5461
@override
5562
Widget build(BuildContext context) {
5663
return Scaffold(
@@ -60,7 +67,6 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
6067
SizedBox(height: 100,),
6168
Image.network(_image, width: 300,),
6269
SizedBox(height: 50,),
63-
// Upload your file
6470
Text('Upload your file', style: TextStyle(fontSize: 25, color: Colors.grey.shade800, fontWeight: FontWeight.bold),),
6571
SizedBox(height: 10,),
6672
Text('File should be jpg, png', style: TextStyle(fontSize: 15, color: Colors.grey.shade500),),

0 commit comments

Comments
 (0)