diff --git a/covas_mobile/lib/pages/DisplayPictureScreen.dart b/covas_mobile/lib/pages/DisplayPictureScreen.dart index 9546380..b69e025 100644 --- a/covas_mobile/lib/pages/DisplayPictureScreen.dart +++ b/covas_mobile/lib/pages/DisplayPictureScreen.dart @@ -54,14 +54,30 @@ class DisplayPictureScreen extends StatefulWidget { // A widget that displays the picture taken by the user. class DisplayPictureScreenState extends State - with ShowDescImageAdd, ShowErrorDialog { + with ShowDescImageAdd, ShowErrorDialog, TickerProviderStateMixin { + late AnimationController controller; @override 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(); _getEventInfosFromImage(); } + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + Future displayError(String e) async { print("problem gemini : ${e}"); showErrorDialog(context, @@ -128,10 +144,19 @@ class DisplayPictureScreenState extends State appBar: AppBar(title: const Text('Display the Picture')), // The image is stored as a file on the device. Use the `Image.file` // constructor with the given path to display the image. - body: SingleChildScrollView( - child: Column(children: [ - Image.file(File(widget.imagePath)), - Text("Analyse en cours...") - ]))); + body: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text( + 'Analyse de l\'image en cours', + style: Theme.of(context).textTheme.titleLarge, + ), + CircularProgressIndicator( + value: controller.value, + semanticsLabel: 'Loading progress', + ), + ]))); } }