add image in update image
This commit is contained in:
@@ -84,7 +84,7 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
"L'IA de Google n'a pas su analyser l'image. Recommecer avec une autre");
|
||||
}
|
||||
|
||||
Future<void> searchEvents(String json) async {
|
||||
Future<void> searchEvents(String json, String imagePath) async {
|
||||
print(json);
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
@@ -105,7 +105,8 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => UpdateeventImage(events: jsonData)));
|
||||
builder: (_) => UpdateeventImage(
|
||||
events: jsonData, imagePath: imagePath)));
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
@@ -134,7 +135,8 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
"Peux-tu donner le nom, la date avec l'année actuelle ou d'une année future proche et le lieu de l'évènement sous format JSON avec les valeurs suivantes : name, address, city, zip_code, country, date sous le format en YYYY-MM-DD HH:mm:ssZ, et sans la présence du mot json dans la chaîne de caractère",
|
||||
images: [file.readAsBytesSync()],
|
||||
modelName: "models/gemini-1.5-pro-latest")
|
||||
.then((value) => searchEvents(value?.content?.parts?.last.text ?? ''))
|
||||
.then((value) => searchEvents(
|
||||
value?.content?.parts?.last.text ?? '', widget.imagePath))
|
||||
.catchError((e) => displayError);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user