tags and organizers work
This commit is contained in:
parent
b8e6adf2e8
commit
0dc098554c
@ -21,18 +21,27 @@ void main() {
|
||||
class MyApp extends StatelessWidget {
|
||||
Map<String, dynamic> events = {};
|
||||
String id = "";
|
||||
List<String> organizers = [];
|
||||
List<String> tags = [];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: EditEvent(id: id),
|
||||
home: EditEvent(id: id, organizers: organizers, tags: tags),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class EditEvent extends StatefulWidget {
|
||||
const EditEvent({Key? key, required this.id}) : super(key: key);
|
||||
const EditEvent(
|
||||
{Key? key,
|
||||
required this.id,
|
||||
required this.tags,
|
||||
required this.organizers})
|
||||
: super(key: key);
|
||||
final String id;
|
||||
final List<String> tags;
|
||||
final List<String> organizers;
|
||||
|
||||
@override
|
||||
_EditEventState createState() => _EditEventState();
|
||||
@ -152,8 +161,6 @@ class _EditEventState extends State<EditEvent>
|
||||
String formerMap = "";
|
||||
String formerImage = "";
|
||||
String formerDesc = "";
|
||||
List<String> formerTags = [];
|
||||
List<String> formerOrga = [];
|
||||
|
||||
if (accessToken.isNotEmpty) {
|
||||
var urlGet = Uri.parse("${globals.api}/events/${widget.id}");
|
||||
@ -235,12 +242,6 @@ class _EditEventState extends State<EditEvent>
|
||||
inputGeo.text = formerMap;
|
||||
imgUrl = formerImage;
|
||||
inputDesc.text = formerDesc;
|
||||
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]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -430,8 +431,10 @@ class _EditEventState extends State<EditEvent>
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_getEventInfos();
|
||||
initialTags = List<String>.from(widget.tags as List);
|
||||
initialOrga = List<String>.from(widget.organizers as List);
|
||||
super.initState();
|
||||
_getEventInfos();
|
||||
}
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
@ -404,7 +404,9 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => EditEvent(id: id)),
|
||||
MaterialPageRoute(
|
||||
builder: (_) =>
|
||||
EditEvent(id: id, tags: tags, organizers: organizers)),
|
||||
);
|
||||
},
|
||||
backgroundColor: Colors.blue,
|
||||
|
Loading…
x
Reference in New Issue
Block a user