Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged Fix iOS Keyboard Entry Jitter with Latest Main #126

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [2.0.1] - 31-August-2022
* Fix keyboard issue

## [2.0.0] - 16-May-2022
* Flutter 3 compatibility

Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<MyHomePage> {
class MyHomePageState extends State<MyHomePage> {
final _chipKey = GlobalKey<ChipsInputState>();

@override
Expand Down
15 changes: 13 additions & 2 deletions lib/src/chips_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class ChipsInputState<T> extends State<ChipsInput<T>>
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);
});
});
}
Expand Down Expand Up @@ -355,6 +355,7 @@ class ChipsInputState<T> extends State<ChipsInput<T>>
_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
Expand Down Expand Up @@ -435,7 +436,7 @@ class ChipsInputState<T> extends State<ChipsInput<T>>
maxLines: 1,
overflow: widget.textOverflow,
style: widget.textStyle ??
theme.textTheme.subtitle1!.copyWith(height: 1.5),
theme.textTheme.titleMedium!.copyWith(height: 1.5),
),
),
Flexible(
Expand Down Expand Up @@ -492,4 +493,14 @@ class ChipsInputState<T> extends State<ChipsInput<T>>

@override
void removeTextPlaceholder() {}

@override
void didChangeInputControl(
TextInputControl? oldControl, TextInputControl? newControl) {}

@override
void insertContent(KeyboardInsertedContent content) {}

@override
void performSelector(String selectorName) {}
}
2 changes: 1 addition & 1 deletion lib/src/suggestions_box_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/text_cursor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class TextCursor extends StatefulWidget {
final bool resumed;

@override
_TextCursorState createState() => _TextCursorState();
TextCursorState createState() => TextCursorState();
}

class _TextCursorState extends State<TextCursor>
class TextCursorState extends State<TextCursor>
with SingleTickerProviderStateMixin {
bool _displayed = false;
late Timer _timer;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down