From b8e6adf2e821885e7eed246a35b26c6b141ae9bf Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 9 Dec 2024 23:34:44 +0100 Subject: [PATCH] try tags organizers --- covas_mobile/lib/pages/EditEvent.dart | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/covas_mobile/lib/pages/EditEvent.dart b/covas_mobile/lib/pages/EditEvent.dart index 4f5846b..af5a8f0 100644 --- a/covas_mobile/lib/pages/EditEvent.dart +++ b/covas_mobile/lib/pages/EditEvent.dart @@ -1,5 +1,3 @@ -import 'dart:ffi'; - import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:http/http.dart' as http; @@ -9,7 +7,6 @@ import 'package:textfield_tags/textfield_tags.dart'; import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; import 'ItemMenu.dart'; import '../classes/alert.dart'; @@ -170,17 +167,11 @@ class _EditEventState extends State formerName = convertNulltoEmptyString(events["name"]); formerMap = convertNulltoEmptyString(events["place"]); formerDesc = convertNulltoEmptyString(events["description"]); - formerTags = List.from(events['tags'] as List); - formerOrga = List.from(events['organizers'] as List); + startDate = DateTime.parse(events["start_date"]); - //dateS = DateFormat.yMd().format(startDate); - //print("startdate : ${dateS}"); - //timeS = DateFormat.Hm().format(startDate); endDate = DateTime.parse(events["end_date"]); - //dateE = DateFormat.yMd().format(endDate); - //timeE = DateFormat.Hm().format(endDate); if (events["imgUrl"] != null) { formerImage = events["imgUrl"]; } @@ -241,11 +232,15 @@ class _EditEventState extends State startTimepicker.text = DateFormat("HH:mm").format(startDate).toString(); endDatepicker.text = DateFormat("dd/MM/yyyy").format(endDate).toString(); endTimepicker.text = DateFormat("HH:mm").format(endDate).toString(); - initialOrga = formerOrga; inputGeo.text = formerMap; imgUrl = formerImage; inputDesc.text = formerDesc; - initialTags = formerTags; + for (int i = 0; i < events["tags"].length; i++) { + _stringTagController.addTag(events["tags"][i]); + } + for (int i = 0; i < events["organizers"].length; i++) { + _stringOrgaController.addTag(events["organizers"][i]); + } }); }