From 413807f039d3409b1b0175df1dbe0f49e74c386a Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 18 Jul 2025 19:06:38 +0200 Subject: [PATCH] Add camera dart --- covas_mobile/lib/l10n/app_en.arb | 4 ++-- covas_mobile/lib/l10n/app_fr.arb | 4 ++-- covas_mobile/lib/pages/Camera.dart | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/covas_mobile/lib/l10n/app_en.arb b/covas_mobile/lib/l10n/app_en.arb index 2479b84..b85d511 100644 --- a/covas_mobile/lib/l10n/app_en.arb +++ b/covas_mobile/lib/l10n/app_en.arb @@ -46,7 +46,7 @@ "edit_email": "Edit email address", "birth_date": "Birth date", "edit_birth": "Edit birth date", -"create_profile_button": "Create profile" - +"create_profile_button": "Create profile", +"take_picture": "Take a picture" } \ No newline at end of file diff --git a/covas_mobile/lib/l10n/app_fr.arb b/covas_mobile/lib/l10n/app_fr.arb index 859597e..2a623cd 100644 --- a/covas_mobile/lib/l10n/app_fr.arb +++ b/covas_mobile/lib/l10n/app_fr.arb @@ -46,6 +46,6 @@ "edit_email": "Modifier l'email", "birth_date": "Date de naissance", "edit_birth": "Modifier la date de naissance", -"create_profile_button": "Créer le profil" - +"create_profile_button": "Créer le profil", +"take_picture": "Take a picture" } \ No newline at end of file diff --git a/covas_mobile/lib/pages/Camera.dart b/covas_mobile/lib/pages/Camera.dart index 6c79f94..0189dc0 100644 --- a/covas_mobile/lib/pages/Camera.dart +++ b/covas_mobile/lib/pages/Camera.dart @@ -7,6 +7,10 @@ import 'DisplayPictureScreen.dart'; import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; import '../classes/auth_service.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:provider/provider.dart'; +import '../locale_provider.dart'; // Créé plus loin Future main() async { // Ensure that plugin services are initialized so that `availableCameras()` @@ -92,7 +96,9 @@ class CameraState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('Take a picture')), + appBar: AppBar( + title: Text(AppLocalizations.of(context)?.take_picture ?? + "Take a picture")), // You must wait until the controller is initialized before displaying the // camera preview. Use a FutureBuilder to display a loading spinner until the // controller has finished initializing.