add modal description
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:io';
|
||||
import '../classes/descriptionImage.dart';
|
||||
import '../classes/alert.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
import 'package:flutter_gemini/flutter_gemini.dart';
|
||||
|
||||
void main() {
|
||||
@@ -44,7 +45,8 @@ class DisplayPictureScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
// A widget that displays the picture taken by the user.
|
||||
class DisplayPictureScreenState extends State<DisplayPictureScreen> {
|
||||
class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
with ShowDescImageAdd, ShowErrorDialog {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -63,7 +65,8 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen> {
|
||||
gemini
|
||||
.textAndImage(
|
||||
text: "What is this picture ?", images: [file.readAsBytesSync()])
|
||||
.then((value) => print(value?.content?.parts?.last.text ?? ''))
|
||||
.then((value) => showDescImageAddDialog(
|
||||
context, value?.content?.parts?.last.text ?? ''))
|
||||
.catchError((e) => print("problem gemini : ${e}"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user