feature/update-event #7

Merged
v4l3n71n merged 28 commits from feature/update-event into main 2024-09-04 21:08:27 +00:00
2 changed files with 52 additions and 7 deletions
Showing only changes of commit 70d18ea980 - Show all commits

View File

@ -131,7 +131,7 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
gemini
.textAndImage(
text:
"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, place, 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",
"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 ?? ''))

View File

@ -42,7 +42,12 @@ class UpdateeventImage extends StatefulWidget {
class _UpdateeventImageState extends State<UpdateeventImage>
with ShowErrorDialog, ShowEventDialog {
TextEditingController inputName = TextEditingController();
TextEditingController inputPlace = TextEditingController();
TextEditingController inputAddress = TextEditingController();
TextEditingController inputZipCode = TextEditingController();
TextEditingController inputCity = TextEditingController();
TextEditingController inputCountry = TextEditingController();
TextEditingController inputDate = TextEditingController();
TextEditingController startDatepicker = TextEditingController();
TextEditingController startTimepicker = TextEditingController();
@ -85,7 +90,7 @@ class _UpdateeventImageState extends State<UpdateeventImage>
Future<void> _updateEvent(BuildContext context) async {
var url = Uri.parse("${globals.api}/token");
var name = inputName.text;
var place = inputPlace.text;
var place = inputCity.text;
SharedPreferences prefs = await SharedPreferences.getInstance();
var accessToken = prefs.getString("access_token") ?? "";
List<String> send = ["toto"];
@ -165,7 +170,11 @@ class _UpdateeventImageState extends State<UpdateeventImage>
void start() async {
inputName.text = widget.events["name"];
inputPlace.text = widget.events["place"];
inputCity.text = widget.events["city"];
inputAddress.text = widget.events["address"];
inputZipCode.text = widget.events["zip_code"];
inputCountry.text = widget.events["country"];
print("date start : ${widget.events["date"]}");
DateTime pickedDate = DateTime.parse(widget.events["date"]);
startDatepicker.text = DateFormat("dd-MM-yyyy").format(pickedDate);
@ -220,11 +229,47 @@ class _UpdateeventImageState extends State<UpdateeventImage>
left: 15.0, right: 15.0, top: 15, bottom: 0),
//padding: EdgeInsets.symmetric(horizontal: 15),
child: TextField(
controller: inputPlace,
controller: inputAddress,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Lieu',
hintText: 'Entrer le lieu'),
labelText: 'Adresse',
hintText: 'Entrer une adresse'),
),
),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 15.0, top: 15, bottom: 0),
//padding: EdgeInsets.symmetric(horizontal: 15),
child: TextField(
controller: inputZipCode,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Code postal',
hintText: 'Entrer un code postal'),
),
),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 15.0, top: 15, bottom: 0),
//padding: EdgeInsets.symmetric(horizontal: 15),
child: TextField(
controller: inputCity,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Ville',
hintText: 'Entrer une ville'),
),
),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 15.0, top: 15, bottom: 0),
//padding: EdgeInsets.symmetric(horizontal: 15),
child: TextField(
controller: inputCountry,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Pays',
hintText: 'Entrer un pays'),
),
),
Padding(