loading circular
This commit is contained in:
parent
e0bdc7a633
commit
30d485d0e7
@ -54,14 +54,30 @@ class DisplayPictureScreen extends StatefulWidget {
|
|||||||
|
|
||||||
// A widget that displays the picture taken by the user.
|
// A widget that displays the picture taken by the user.
|
||||||
class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||||
with ShowDescImageAdd, ShowErrorDialog {
|
with ShowDescImageAdd, ShowErrorDialog, TickerProviderStateMixin {
|
||||||
|
late AnimationController controller;
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
controller = AnimationController(
|
||||||
|
/// [AnimationController]s can be created with `vsync: this` because of
|
||||||
|
/// [TickerProviderStateMixin].
|
||||||
|
vsync: this,
|
||||||
|
duration: const Duration(seconds: 5),
|
||||||
|
)..addListener(() {
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
controller.repeat(reverse: false);
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_getEventInfosFromImage();
|
_getEventInfosFromImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
controller.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> displayError(String e) async {
|
Future<void> displayError(String e) async {
|
||||||
print("problem gemini : ${e}");
|
print("problem gemini : ${e}");
|
||||||
showErrorDialog(context,
|
showErrorDialog(context,
|
||||||
@ -128,10 +144,19 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
|||||||
appBar: AppBar(title: const Text('Display the Picture')),
|
appBar: AppBar(title: const Text('Display the Picture')),
|
||||||
// The image is stored as a file on the device. Use the `Image.file`
|
// The image is stored as a file on the device. Use the `Image.file`
|
||||||
// constructor with the given path to display the image.
|
// constructor with the given path to display the image.
|
||||||
body: SingleChildScrollView(
|
body: Padding(
|
||||||
child: Column(children: <Widget>[
|
padding: const EdgeInsets.all(20.0),
|
||||||
Image.file(File(widget.imagePath)),
|
child: Column(
|
||||||
Text("Analyse en cours...")
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'Analyse de l\'image en cours',
|
||||||
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
|
),
|
||||||
|
CircularProgressIndicator(
|
||||||
|
value: controller.value,
|
||||||
|
semanticsLabel: 'Loading progress',
|
||||||
|
),
|
||||||
])));
|
])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user