Update Url Launcher

This commit is contained in:
Sarah Jamie Lewis 2022-02-02 10:45:58 -08:00
parent beebff1fdd
commit 247f4073b8
3 changed files with 7 additions and 7 deletions

View File

@ -51,13 +51,14 @@ class Flwtch extends StatefulWidget {
}
}
class FlwtchState extends State<Flwtch> with WindowListener, WidgetsBindingObserver {
class FlwtchState extends State<Flwtch> with WindowListener {
final TextStyle biggerFont = const TextStyle(fontSize: 18);
late Cwtch cwtch;
late ProfileListState profs;
final MethodChannel notificationClickChannel = MethodChannel('im.cwtch.flwtch/notificationClickHandler');
final MethodChannel shutdownMethodChannel = MethodChannel('im.cwtch.flwtch/shutdownClickHandler');
final MethodChannel shutdownLinuxMethodChannel = MethodChannel('im.cwtch.linux.shutdown');
final GlobalKey<NavigatorState> navKey = GlobalKey<NavigatorState>();
Future<dynamic> shutdownDirect(MethodCall call) {
@ -186,7 +187,6 @@ class FlwtchState extends State<Flwtch> with WindowListener, WidgetsBindingObser
// coder beware: args["RemotePeer"] is actually a handle, and could be eg a groupID
Future<void> _externalNotificationClicked(MethodCall call) async {
var args = jsonDecode(call.arguments);
var profile = profs.getProfile(args["ProfileOnion"])!;
var convo = profile.contactList.getContact(args["Handle"])!;
Provider.of<AppState>(navKey.currentContext!, listen: false).initialScrollIndex = convo.unreadMessages;
@ -231,7 +231,6 @@ class FlwtchState extends State<Flwtch> with WindowListener, WidgetsBindingObser
globalAppState.focus = false;
}
@override
void dispose() {
cwtch.Shutdown();

View File

@ -132,14 +132,15 @@ static void my_application_activate(GApplication* application) {
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
// Create a specific channel for shutting down cwtch when the close button is triggered
// We have registered the "destroy" handle above for this reason
FlEngine *engine = fl_view_get_engine(view);
g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
g_autoptr(FlBinaryMessenger) messenger = fl_engine_get_binary_messenger(engine);
channel =
fl_method_channel_new(messenger,
"im.cwtch.linux.shutdown", FL_METHOD_CODEC(codec));
channel = fl_method_channel_new(messenger, "im.cwtch.linux.shutdown", FL_METHOD_CODEC(codec));
gtk_widget_grab_focus(GTK_WIDGET(view));

View File

@ -41,7 +41,7 @@ dependencies:
scrollable_positioned_list: ^0.2.0-nullsafety.0
file_picker: ^4.3.2
file_picker_desktop: ^1.1.0
url_launcher: ^6.0.12
url_launcher: ^6.0.18
desktoasts: ^0.0.2
window_manager: ^0.1.4