add input categories

This commit is contained in:
Valentin CZERYBA 2024-10-03 23:54:54 +02:00
parent 112eab3125
commit 47d80791e5
4 changed files with 33 additions and 0 deletions

View File

@ -16,6 +16,8 @@ import '../classes/events.dart';
import 'ListItemMenu.dart';
import 'package:textfield_tags/textfield_tags.dart';
void main() {
initializeDateFormatting("fr_FR", null).then((_) => (const MyApp()));
}

View File

@ -3,6 +3,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:textfield_tags/textfield_tags.dart';
import 'dart:convert';
import 'dart:io';
@ -56,6 +57,7 @@ class _UpdateeventImageState extends State<UpdateeventImage>
TextEditingController startTimepicker = TextEditingController();
TextEditingController endDatepicker = TextEditingController();
TextEditingController endTimepicker = TextEditingController();
final _stringTagController = StringTagController();
onTapFunctionDatePicker(
{required BuildContext context, required String position}) async {
@ -392,6 +394,26 @@ class _UpdateeventImageState extends State<UpdateeventImage>
onTap: () => onTapFunctionTimePicker(
context: context, position: "end")),
),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 15.0, top: 15, bottom: 0),
//padding: EdgeInsets.symmetric(horizontal: 15),
child: TextFieldTags<String>(
textfieldTagsController: _stringTagController,
initialTags: ['python', 'java'],
textSeparators: const [' ', ','],
validator: (String tag) {
if (tag == 'php') {
return 'Php not allowed';
}
return null;
},
inputFieldBuilder: (context, inputFieldValues) {
return TextField(
controller: inputFieldValues.textEditingController,
focusNode: inputFieldValues.focusNode,
);
})),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 15.0, top: 15, bottom: 0),

View File

@ -581,6 +581,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.2"
textfield_tags:
dependency: "direct main"
description:
name: textfield_tags
sha256: d1f2204114157a1296bb97c20d7f8c8c7fd036212812afb2e19de7bb34acc55b
url: "https://pub.dev"
source: hosted
version: "3.0.1"
typed_data:
dependency: transitive
description:

View File

@ -45,6 +45,7 @@ dependencies:
flutter_dotenv: ^5.1.0
image_picker: ^1.1.2
date_format_field: ^0.1.0
textfield_tags: ^3.0.1
dev_dependencies:
flutter_test: