Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@


.flutter-plugins-dependencies

# Miscellaneous
*.class
*.lock
Expand Down
35 changes: 6 additions & 29 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
## [2.2.0+3] - February 23, 2020
* Minor docs changes

## [2.2.0+2] - December 2, 2019
* Changed defaults for `spacing` and `runSpacing` to 8.0

## [2.2.0+1] - November 29, 2019
**BREAKING CHANGES**
* Added mandatory `initialItems` property.
## [4.0.2] - June 20, 2023
* Version Bumps.

## [2.1.0+2] - November 28, 2019
* Added support for Flutter Web

## [2.1.0] - November 26, 2019
**BREAKING CHANGES**
* Some properties are renamed and added.
* Added dart docs. Refined docs will be added in future.
## [4.0.1] - April 20, 2022
* Flutter 3.0 fixes.

## [2.0.0+2] - November 19, 2019
* Setting `additionCallback` to null, disables the feature to add tags.

## [2.0.0+1] - November 17, 2019
**BREAKING CHANGES**
* Complete Refactor and Improvements.

## [1.1.0] - March 23, 2019.
## [4.0.0] - April 20, 2022
* Forked from https://github.com/sarbagyastha/flutter_tagging as it appears abandoned

* Updated dependency.
* Added access to newer properties from flutter_typeahead.

## [1.0.1] - December 30, 2018.

* Added Description.

## [1.0.0] - December 30, 2018.

* Initial Release.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Flutter Tagging
# Flutter Tagging Plus

Forked from https://github.com/culjo/flutter_tagging as it seems abandoned.

Based on https://github.com/sarbagyastha/flutter_tagging/



# Details

[![Pub Package](https://img.shields.io/pub/v/flutter_tagging?color=dark-green&style=flat-square)](https://pub.dartlang.org/packages/flutter_tagging) [![licence](https://img.shields.io/badge/licence-BSD--3--Clause-orange.svg)](https://github.com/sarbagyastha/flutter_tagging/blob/master/LICENSE)

A flutter package with tagging or multi-select functionality.
Useful for adding Tag or Label Selection Forms.
Expand Down Expand Up @@ -110,4 +117,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
```
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ linter:
- prefer_iterable_whereType
- prefer_function_declarations_over_variables
- unnecessary_lambdas
- prefer_equal_for_default_values
- avoid_init_to_null
- unnecessary_getters_setters
#- unnecessary_getters # prefer # Disabled pending fix: https://github.com/dart-lang/linter/issues/23
Expand All @@ -48,7 +47,6 @@ linter:
- prefer_final_fields # prefer
- use_setters_to_change_properties
- avoid_setters_without_getters
- avoid_returning_null # avoid
- avoid_returning_this # avoid
- type_annotate_public_apis # prefer
#- prefer_typing_uninitialized_variables # consider
Expand Down
46 changes: 46 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
2 changes: 1 addition & 1 deletion example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 52bd2ccb8bf0575ea77ebb6db877b0606be291d8
revision: 7e9793dee1b85a243edd0e06cb1658e98b077561
channel: stable

project_type: app
108 changes: 12 additions & 96 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,16 @@
# Flutter Tagging Example
# example

```dart
class _MyHomePageState extends State<MyHomePage> {
String text = "Nothing to show";
A new Flutter project.

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: FlutterTagging(
textFieldDecoration: InputDecoration(
border: OutlineInputBorder(),
hintText: "Tags",
labelText: "Enter tags"),
addButtonWidget: _buildAddButton(),
chipsColor: Colors.pinkAccent,
chipsFontColor: Colors.white,
deleteIcon: Icon(Icons.cancel,color: Colors.white),
chipsPadding: EdgeInsets.all(2.0),
chipsFontSize: 14.0,
chipsSpacing: 5.0,
chipsFontFamily: 'helvetica_neue_light',
suggestionsCallback: (pattern) async {
return await TagSearchService.getSuggestions(pattern);
},
onChanged: (result) {
setState(() {
text = result.toString();
});
},
),
),
SizedBox(
height: 20.0,
),
Center(
child: Text(
text,
style: TextStyle(color: Colors.pink),
),
)
],
),
),
);
}
## Getting Started

Widget _buildAddButton() {
return Container(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.0)),
color: Colors.pinkAccent,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.add,
color: Colors.white,
size: 15.0,
),
Text(
"Add New Tag",
style: TextStyle(color: Colors.white, fontSize: 14.0),
),
],
),
);
}
}
This project is a starting point for a Flutter application.

class TagSearchService {
static Future<List> getSuggestions(String query) async {
await Future.delayed(Duration(milliseconds: 400), null);
List<dynamic> tagList = <dynamic>[];
tagList.add({'name': "Flutter", 'value': 1});
tagList.add({'name': "HummingBird", 'value': 2});
tagList.add({'name': "Dart", 'value': 3});
List<dynamic> filteredTagList = <dynamic>[];
if (query.isNotEmpty) {
filteredTagList.add({'name': query, 'value': 0});
}
for (var tag in tagList) {
if (tag['name'].toLowerCase().contains(query)) {
filteredTagList.add(tag);
}
}
return filteredTagList;
}
}
```
A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
60 changes: 60 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
linter:
rules:
# STYLE
- camel_case_types
- library_names
- file_names
- library_prefixes
- non_constant_identifier_names
- constant_identifier_names # prefer
- directives_ordering
#- lines_longer_than_80_chars # avoid
- curly_braces_in_flow_control_structures

# DOCUMENTATION
- slash_for_doc_comments
- package_api_docs # prefer # ?
- public_member_api_docs # prefer # ?
#- comment_references # Unused because https://github.com/dart-lang/sdk/issues/36974

# USAGE
- avoid_relative_lib_imports # prefer
- prefer_adjacent_string_concatenation
- prefer_interpolation_to_compose_strings # prefer
- unnecessary_brace_in_string_interps # avoid
- prefer_collection_literals
- avoid_function_literals_in_foreach_calls # avoid
- prefer_iterable_whereType
- prefer_function_declarations_over_variables
- unnecessary_lambdas
- avoid_init_to_null
- unnecessary_getters_setters
#- unnecessary_getters # prefer # Disabled pending fix: https://github.com/dart-lang/linter/issues/23
#- prefer_expression_function_bodies # consider
- unnecessary_this
- prefer_initializing_formals
- type_init_formals
- empty_constructor_bodies
- unnecessary_new
- unnecessary_const
- avoid_catches_without_on_clauses # avoid
- use_rethrow_when_possible

# DESIGN
- use_to_and_as_if_applicable # prefer
- one_member_abstracts # avoid
- avoid_classes_with_only_static_members # avoid
- prefer_final_fields # prefer
- use_setters_to_change_properties
- avoid_setters_without_getters
- avoid_returning_this # avoid
- type_annotate_public_apis # prefer
#- prefer_typing_uninitialized_variables # consider
- omit_local_variable_types # avoid
- avoid_return_types_on_setters
- prefer_generic_function_type_aliases
- avoid_private_typedef_functions # prefer
#- use_function_type_syntax_for_parameters # consider
- avoid_positional_boolean_parameters # avoid
- hash_and_equals
- avoid_null_checks_in_equality_operators
13 changes: 13 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
27 changes: 17 additions & 10 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,32 @@ if (flutterVersionName == null) {
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdkVersion flutter.compileSdkVersion

lintOptions {
disable 'InvalidPackage'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "np.com.sarbagya.tagging"
minSdkVersion 16
targetSdkVersion 29
applicationId "com.example.example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -55,7 +64,5 @@ flutter {
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
7 changes: 7 additions & 0 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Loading