Dn-a / flutter_tags

With flutter tags you can create selectable or input tags that automatically adapt to the screen width
https://pub.dartlang.org/packages/flutter_tags
MIT License
507 stars 127 forks source link

When tag list is empty then _buildField throws an unhandled exception #1

Closed plumpNation closed 5 years ago

plumpNation commented 5 years ago

To replicate, you should just be able to pass an empty List as tags.

      InputTags(
        tags: [],
        onDelete: () {},
        onInsert: () {}
      )

The error given is:

Unhandled exception:
Unsupported operation: Infinity or NaN toInt
#0      double.toInt (dart:core/runtime/libdouble.dart:178:36)
#1      double.ceil (dart:core/runtime/libdouble.dart:149:32)
#2      _InputTagsState.Eval (evaluate:source)
#3      _InputTagsState._buildField (package:flutter_tags/input_tags.dart:213:24)

You can also replicate by deleting all tags, which prints out this error.

flutter: Another exception was thrown: Unsupported operation: Infinity or NaN toInt
Dn-a commented 5 years ago

Soon I will release the correct version. thanks for the report

Dn-a commented 5 years ago

@plumpNation on the new version flutter tags: "^ 0.1.6" I solved the problem