Fixed App.dart
This commit is contained in:
parent
8f801b847f
commit
b394a2732b
1 changed files with 0 additions and 32 deletions
|
|
@ -13,36 +13,4 @@ class App extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> uploadPicture() async {
|
|
||||||
final imageTaken = await ImagePicker.pickImage(source: ImageSource.camera);
|
|
||||||
setState(() {
|
|
||||||
image = imageTaken;
|
|
||||||
});
|
|
||||||
task = provider.uploadFile(imageTaken);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget buildImage() {
|
|
||||||
if (image == null) {
|
|
||||||
return Text('No image yet');
|
|
||||||
}
|
|
||||||
return Image.file(image);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget buildFromTask() {
|
|
||||||
if (task == null) {
|
|
||||||
return Text('No task yet');
|
|
||||||
}
|
|
||||||
return StreamBuilder(
|
|
||||||
stream: task.events,
|
|
||||||
builder: (context, AsyncSnapshot<StorageTaskEvent> snapshot) {
|
|
||||||
if (!snapshot.hasData) {
|
|
||||||
return Text('No task yet');
|
|
||||||
} else if (task.isComplete) {
|
|
||||||
return Icon(Icons.check);
|
|
||||||
}
|
|
||||||
return CircularProgressIndicator();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue