flutter_chip_tags 1.0.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

flutter_chip_tags #

flutter_chip_tags allow developers to create tags from list and add or remove tags from list. It has a TextFormField where user can insert value and it will seprate each tag by space. Similar to GitHub Manage Topics

Getting Started #

For Detailed Example head over to example/lib/main.dart #

Sample #

ChipTags(
  list: _myListCustom,
  chipColor: Colors.black,
  iconColor: Colors.white,
  textColor: Colors.white,
  decoration: InputDecoration(hintText: "Your Custom Hint"),
  keyboardType: TextInputType.text,
),

Properties #

PropertyFunction
listList<String> which you want to display as Tags.
chipColorSets Chip background color. By default it's Blue.
iconColorSets Icon color. By default it's White.
textColorSets Text color. By default it's White.
decorationIt accepts InputDecoration to decorate TextFormField.
keyboradTypeIt accepts TextInputType to set the keyboard layout.

Example Demo #

[1.0.1+1] - 2020-05-06 #

  • Updated Readme

[1.0.1] - 2020-05-06 #

  • UX Fixes

[1.0.0+1] - 2020-04-30 #

  • Typo fixed in Readme.

[1.0.0] - 2020-04-30 #

  • First Stable release.
  • Updated Readme.

[0.0.1] - 2020-04-29. #

  • Initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_chip_tags/flutter_chip_tags.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Clip Tag Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Clip Tags Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  //initialize an empty list
  List<String> _myList = List<String>();
  List<String> _myListCustom = List<String>();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            //Default
            ChipTags(
              list: _myList,
            ),
            Divider(),
            //Customised
            ChipTags(
              list: _myListCustom,
              chipColor: Colors.black,
              iconColor: Colors.white,
              textColor: Colors.white,
              decoration: InputDecoration(hintText: "Your Custom Hint"),
              keyboardType: TextInputType.text,
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_chip_tags: ^1.0.1+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_chip_tags/flutter_chip_tags.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • flutter_chip_tags that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test