Skip to content

Commit

Permalink
feat: Patch of brightness for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Losses committed Nov 13, 2024
1 parent b8e3ce6 commit aa007e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'dart:io';

import 'package:rinf/rinf.dart';
import 'package:provider/provider.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/foundation.dart';
import 'package:provider/provider.dart';
import 'package:fluent_ui/fluent_ui.dart';
import 'package:system_theme/system_theme.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
Expand Down Expand Up @@ -119,6 +120,14 @@ void main(List<String> arguments) async {
updateTheme();
}

if (Platform.isMacOS) {
var dispatcher = SchedulerBinding.instance.platformDispatcher;

dispatcher.onPlatformBrightnessChanged = () {
updateTheme();
};
}

initialPath = await getInitialPath();

runApp(
Expand Down

0 comments on commit aa007e5

Please sign in to comment.