diff --git a/CHANGELOG.md b/CHANGELOG.md index 823f48a0..e6d1d6ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [2.0.1] - 31-August-2022 +* Fix keyboard issue + ## [2.0.0] - 16-May-2022 * Flutter 3 compatibility diff --git a/example/lib/main.dart b/example/lib/main.dart index 21d35277..492a6062 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -24,10 +24,10 @@ class MyHomePage extends StatefulWidget { const MyHomePage({Key? key}) : super(key: key); @override - _MyHomePageState createState() => _MyHomePageState(); + MyHomePageState createState() => MyHomePageState(); } -class _MyHomePageState extends State { +class MyHomePageState extends State { final _chipKey = GlobalKey(); @override diff --git a/lib/src/chips_input.dart b/lib/src/chips_input.dart index 3c10a20d..f96504fb 100644 --- a/lib/src/chips_input.dart +++ b/lib/src/chips_input.dart @@ -288,7 +288,7 @@ class ChipsInputState extends State> Future.delayed(const Duration(milliseconds: 300), () { WidgetsBinding.instance.addPostFrameCallback((_) async { final renderBox = context.findRenderObject() as RenderBox; - await Scrollable.of(context)?.position.ensureVisible(renderBox); + await Scrollable.of(context).position.ensureVisible(renderBox); }); }); } @@ -355,6 +355,7 @@ class ChipsInputState extends State> _closeInputConnectionIfNeeded(); //Hack for #34 (https://github.com/danvick/flutter_chips_input/issues/34#issuecomment-684505282). TODO: Find permanent fix _textInputConnection ??= TextInput.attach(this, textInputConfiguration); _textInputConnection?.setEditingState(_value); + _textInputConnection?.show(); } @override @@ -435,7 +436,7 @@ class ChipsInputState extends State> maxLines: 1, overflow: widget.textOverflow, style: widget.textStyle ?? - theme.textTheme.subtitle1!.copyWith(height: 1.5), + theme.textTheme.titleMedium!.copyWith(height: 1.5), ), ), Flexible( @@ -492,4 +493,14 @@ class ChipsInputState extends State> @override void removeTextPlaceholder() {} + + @override + void didChangeInputControl( + TextInputControl? oldControl, TextInputControl? newControl) {} + + @override + void insertContent(KeyboardInsertedContent content) {} + + @override + void performSelector(String selectorName) {} } diff --git a/lib/src/suggestions_box_controller.dart b/lib/src/suggestions_box_controller.dart index 127c7452..157d55eb 100644 --- a/lib/src/suggestions_box_controller.dart +++ b/lib/src/suggestions_box_controller.dart @@ -14,7 +14,7 @@ class SuggestionsBoxController { void open() { if (_isOpened) return; assert(overlayEntry != null); - Overlay.of(context)!.insert(overlayEntry!); + Overlay.of(context).insert(overlayEntry!); _isOpened = true; } diff --git a/lib/src/text_cursor.dart b/lib/src/text_cursor.dart index e00da661..2d604588 100644 --- a/lib/src/text_cursor.dart +++ b/lib/src/text_cursor.dart @@ -13,10 +13,10 @@ class TextCursor extends StatefulWidget { final bool resumed; @override - _TextCursorState createState() => _TextCursorState(); + TextCursorState createState() => TextCursorState(); } -class _TextCursorState extends State +class TextCursorState extends State with SingleTickerProviderStateMixin { bool _displayed = false; late Timer _timer; diff --git a/pubspec.yaml b/pubspec.yaml index b33d3aa6..b84066db 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_chips_input description: Flutter library for building input fields with InputChips as input options. -version: 2.0.0 +version: 2.0.1 homepage: https://github.com/danvick/flutter_chips_input environment: