Skip to content
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
13 changes: 5 additions & 8 deletions lib/src/app_auto_launcher_impl_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher {
@override
Future<bool> enable() async {
_regKey.createValue(
RegistryValue(
RegistryValue.string(
appName,
RegistryValueType.string,
_registryValue,
),
);
Expand All @@ -60,7 +59,7 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher {
bytes[0] = 2;

_startupApprovedRegKey
.createValue(RegistryValue(appName, RegistryValueType.binary, bytes));
.createValue(RegistryValue.binary(appName, bytes));

return true;
}
Expand All @@ -76,15 +75,13 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher {
// Odd first byte will prevent the app from autostarting
// Empty or any other value will allow the app to autostart
Future<bool> _isStartupApproved() async {
final value = _startupApprovedRegKey.getValue(appName);
final data = _startupApprovedRegKey.getBinaryValue(appName);

if (value == null) {
if (data == null) {
return true;
}

final data = value.data;

if (data is! Uint8List || data.isEmpty) {
if (data.isEmpty) {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ environment:
dependencies:
flutter:
sdk: flutter
win32_registry: ^1.1.3
win32_registry: ^2.0.0

dev_dependencies:
dependency_validator: ^3.0.0
flutter_test:
sdk: flutter
mostly_reasonable_lints: ^0.1.2
mostly_reasonable_lints: ^0.1.2
Loading