diff --git a/covas_mobile/lib/pages/ItemMenu.dart b/covas_mobile/lib/pages/ItemMenu.dart index b45ee48..901e488 100644 --- a/covas_mobile/lib/pages/ItemMenu.dart +++ b/covas_mobile/lib/pages/ItemMenu.dart @@ -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())); } diff --git a/covas_mobile/lib/pages/UpdateEventImage.dart b/covas_mobile/lib/pages/UpdateEventImage.dart index 3ee5d9c..3c5bace 100644 --- a/covas_mobile/lib/pages/UpdateEventImage.dart +++ b/covas_mobile/lib/pages/UpdateEventImage.dart @@ -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 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 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( + 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), diff --git a/covas_mobile/pubspec.lock b/covas_mobile/pubspec.lock index e3c01b0..84f9170 100644 --- a/covas_mobile/pubspec.lock +++ b/covas_mobile/pubspec.lock @@ -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: diff --git a/covas_mobile/pubspec.yaml b/covas_mobile/pubspec.yaml index 59db286..418204f 100644 --- a/covas_mobile/pubspec.yaml +++ b/covas_mobile/pubspec.yaml @@ -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: