Skip to content

Commit

Permalink
TW-1781: remove deprecated change to have new change
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn committed May 22, 2024
1 parent 8201719 commit 66cd62d
Show file tree
Hide file tree
Showing 12 changed files with 422 additions and 359 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
26 changes: 13 additions & 13 deletions lib/pages/chat/input_bar/input_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class InputBar extends StatelessWidget with PasteImageMixin {
this.rawKeyboardFocusNode,
this.suggestionsController,
this.showEmojiPickerNotifier,
Key? key,
}) : super(key: key);
super.key,
});

static const debounceDuration = Duration(milliseconds: 50);

Expand Down Expand Up @@ -340,28 +340,28 @@ class InputBar extends StatelessWidget with PasteImageMixin {
}
}

KeyEventResult _onBlockUpDownArrowEvent(FocusNode _, RawKeyEvent event) {
if (event.isKeyPressed(service.LogicalKeyboardKey.arrowUp) ||
event.isKeyPressed(service.LogicalKeyboardKey.arrowDown)) {
KeyEventResult _onBlockUpDownArrowEvent(FocusNode _, KeyEvent event) {
if (event.logicalKey == service.LogicalKeyboardKey.arrowUp ||
event.logicalKey == service.LogicalKeyboardKey.arrowDown) {
return KeyEventResult.handled;
}
return KeyEventResult.ignored;
}

KeyEventResult _onIgnoreUpDownArrowEvent(FocusNode _, RawKeyEvent event) {
KeyEventResult _onIgnoreUpDownArrowEvent(FocusNode _, KeyEvent event) {
return KeyEventResult.ignored;
}

void onRawKeyEvent(RawKeyEvent event) {
void onRawKeyEvent(KeyEvent event) {
if (focusSuggestionController.hasSuggestions) {
typeAheadFocusNode?.onKey = _onBlockUpDownArrowEvent;
if (event.isKeyPressed(service.LogicalKeyboardKey.arrowUp)) {
typeAheadFocusNode?.onKeyEvent = _onBlockUpDownArrowEvent;
if (event.logicalKey == service.LogicalKeyboardKey.arrowUp) {
focusSuggestionController.up();
} else if (event.isKeyPressed(service.LogicalKeyboardKey.arrowDown)) {
} else if (event.logicalKey == service.LogicalKeyboardKey.arrowDown) {
focusSuggestionController.down();
}
} else {
typeAheadFocusNode?.onKey = _onIgnoreUpDownArrowEvent;
typeAheadFocusNode?.onKeyEvent = _onIgnoreUpDownArrowEvent;
}
}

Expand Down Expand Up @@ -389,10 +389,10 @@ class InputBar extends StatelessWidget with PasteImageMixin {
focusSuggestionController: focusSuggestionController,
room: room,
onEnter: _onEnter,
child: RawKeyboardListener(
child: KeyboardListener(
key: typeAheadKey,
focusNode: rawKeyboardFocusNode ?? FocusNode(),
onKey: (event) {
onKeyEvent: (event) {
onRawKeyEvent(event);
},
child: TypeAheadField<Map<String, String?>>(
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/background_push.dart
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class BackgroundPush {
await _flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestPermission();
?.requestNotificationsPermission();
}
_pushToken = await (Platform.isIOS
? apnChannel.invokeMethod("getToken")
Expand Down
10 changes: 4 additions & 6 deletions lib/utils/url_launcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,10 @@ class UrlLauncher with GoToDraftChatMixin {
if (url != null) {
if (PlatformInfos.isMobile) {
await browser.open(
url: Uri.parse(url!),
options: ChromeSafariBrowserClassOptions(
android: AndroidChromeCustomTabsOptions(
shareState: CustomTabsShareState.SHARE_STATE_ON,
),
ios: IOSSafariOptions(barCollapsingEnabled: true),
url: WebUri(url!),
settings: ChromeSafariBrowserSettings(
shareState: CustomTabsShareState.SHARE_STATE_ON,
barCollapsingEnabled: true,
),
);
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/warning_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class WarningDialogWidget extends StatelessWidget {
final List<DialogAction>? actions;

const WarningDialogWidget({
Key? key,
super.key,
this.title,
this.message,
this.actions,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
6 changes: 4 additions & 2 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import file_selector_macos
import firebase_core
import flutter_app_badger
import flutter_image_compress_macos
import flutter_inappwebview_macos
import flutter_local_notifications
import flutter_secure_storage_macos
import flutter_web_auth_2
Expand All @@ -34,8 +35,8 @@ import path_provider_foundation
import photo_manager
import record_macos
import screen_brightness_macos
import share_plus_macos
import shared_preferences_macos
import share_plus
import shared_preferences_foundation
import sqflite
import super_native_extensions
import url_launcher_macos
Expand All @@ -59,6 +60,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FlutterAppBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterAppBadgerPlugin"))
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin"))
Expand Down
Loading

0 comments on commit 66cd62d

Please sign in to comment.