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

Fix for Linux ScrollController issue #211

Merged
merged 3 commits into from
Aug 14, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- Upgrade to Flutter `3.24.0`, Dart `3.4.0` and dependencies e.g. `web: 1.0.0` (thx to @diegotori)
- Allow custom icon for Backspace and Search button
- Replace `showBackspaceButton` in `CategoryViewConfig` with `extraTab` to allow choosing between Backspace, Search or no extra button in category tab bar
- Fix scroll issue on Linux

## 2.2.0

Expand Down
42 changes: 29 additions & 13 deletions lib/src/emoji_picker.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'dart:io';

import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
import 'package:emoji_picker_flutter/src/emoji_picker_internal_utils.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

/// All the possible categories that [Emoji] can be put into
Expand Down Expand Up @@ -394,20 +397,33 @@ class EmojiPickerState extends State<EmojiPicker> {
);
}

Widget _buildEmojiView() {
return SizedBox(
height: widget.config.height,
child: widget.customWidget == null
? DefaultEmojiPickerView(
widget.config,
_state,
_showSearchView,
)
: widget.customWidget!(
widget.config,
_state,
_showSearchView,
Widget _wrapScrollBehaviorForPlatforms(Widget child) {
return !kIsWeb && Platform.isLinux
? ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(
scrollbars: false,
),
child: child,
)
: child;
}

Widget _buildEmojiView() {
return _wrapScrollBehaviorForPlatforms(
SizedBox(
height: widget.config.height,
child: widget.customWidget == null
? DefaultEmojiPickerView(
widget.config,
_state,
_showSearchView,
)
: widget.customWidget!(
widget.config,
_state,
_showSearchView,
),
),
);
}

Expand Down
Loading