Compare commits
4 changed files with 3 additions and 14 deletions
|
|
@ -65,7 +65,7 @@ When possible, use immutable collections instead of the mutable equivalent. For
|
|||
|
||||
When possible, we prefer not to create global variables or methods. You can usually replace a global variable with a Riverpod controller, and a global method with an extension method.
|
||||
|
||||
I'm also not a big fan of unneeded private methods or variables, but this is contextual.
|
||||
I'm also not a big fan of private methods or variables, but this is contextual.
|
||||
|
||||
### Modern Dart syntax
|
||||
|
||||
|
|
|
|||
2
gomuks
2
gomuks
|
|
@ -1 +1 @@
|
|||
Subproject commit ad275f7613894d9d2fa4d16d733a6816e2978de9
|
||||
Subproject commit 38e5033c3a91db0cbea6cbd9f0feef9ff6441038
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
import "dart:async";
|
||||
import "dart:ffi";
|
||||
import "dart:isolate";
|
||||
|
||||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:flutter/foundation.dart";
|
||||
|
|
@ -113,20 +112,12 @@ class GomuksListenerController extends AsyncNotifier<void> {
|
|||
|
||||
ref.onDispose(callable.close);
|
||||
|
||||
final errorCode = await _start(handle, callable.nativeFunction);
|
||||
final errorCode = GomuksStart(handle, callable.nativeFunction);
|
||||
if (errorCode != 0) {
|
||||
throw Exception("GomuksStart returned error code $errorCode");
|
||||
}
|
||||
}
|
||||
|
||||
static Future<int> _start(
|
||||
int handle,
|
||||
Pointer<
|
||||
NativeFunction<Void Function(Pointer<Char>, Int64, GomuksOwnedBuffer)>
|
||||
>
|
||||
callback,
|
||||
) => Isolate.run(() => GomuksStart(handle, callback));
|
||||
|
||||
static final provider = AsyncNotifierProvider<GomuksListenerController, void>(
|
||||
GomuksListenerController.new,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import "package:flutter/foundation.dart";
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:material_emoji_picker/material_emoji_picker.dart";
|
||||
import "package:media_kit/media_kit.dart";
|
||||
import "package:nexus/controllers/client.dart";
|
||||
import "package:nexus/controllers/client_state.dart";
|
||||
import "package:nexus/controllers/gomuks_listener.dart";
|
||||
import "package:nexus/controllers/key.dart";
|
||||
|
|
@ -194,7 +193,6 @@ class const App({super.key}) extends StatelessWidget {
|
|||
AsyncError(:final error, :final stackTrace) => ErrorDialog(
|
||||
error,
|
||||
stackTrace,
|
||||
provider: ClientController.provider,
|
||||
),
|
||||
},
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue