8000 Reactive Theming on macOS by bdlukaa · Pull Request #45 · bdlukaa/system_theme · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@bdlukaa
Copy link
Owner
@bdlukaa bdlukaa commented Dec 30, 2025

#6

system_theme.reactive.theme.mov

@gemini-code-assist
Copy link

Summary of Changes

Hello @bdlukaa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the system_theme Flutter plugin by introducing reactive theming capabilities for macOS, allowing applications to dynamically respond to system accent color changes. This was achieved through a comprehensive migration of the macOS plugin to Swift Package Manager, alongside necessary updates to the example project's Xcode configurations. Additionally, the iOS example project now includes a standard CocoaPods setup, and all pubspec.lock files have been updated to reflect the latest package dependencies and Dart SDK constraints, ensuring broader compatibility and maintainability.

Highlights

  • Reactive Theming for macOS: The system_theme plugin now supports listening for real-time changes to the system accent color on macOS, similar to its existing functionality on Windows.
  • macOS Plugin Migration to Swift Package Manager (SPM): The macOS plugin implementation has been refactored to use Swift Package Manager, including the creation of a Package.swift file and restructuring of source files.
  • macOS Example Project Updates: The macOS example project has been updated to integrate with the new SPM-based plugin, including project.pbxproj modifications, Runner.xcscheme updates, and an increased MACOSX_DEPLOYMENT_TARGET to 10.15.
  • iOS Example Project Setup: A standard Podfile has been added to the iOS example project, along with updates to Debug.xcconfig and Release.xcconfig, to properly configure CocoaPods for dependency management.
  • Dependency and SDK Updates: Various package dependencies in pubspec.lock files have been updated, and the Dart SDK constraint has been adjusted.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully adds support for reactive theming on macOS by listening for system accent color changes. The implementation correctly uses an EventChannel and NSSystemColorsDidChangeNotification on the native side. The migration of the macOS plugin to a Swift Package is also a great modernization step.

I've left a few comments:

  • A critical issue in the system_theme.podspec where the macOS platform version needs to be updated to prevent build failures for CocoaPods users.
  • Two suggestions in the SystemThemePlugin.swift file to improve code clarity and maintainability by using a system constant and removing a redundant availability check.

Overall, this is a solid contribution. Addressing the comments will make it even better.

Copy link
Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds reactive theming support for macOS by implementing event streaming for system accent color changes. The implementation mirrors the existing Windows functionality, allowing Flutter applications to respond dynamically to macOS system theme changes.

Key changes:

  • Implemented macOS event streaming for accent color changes using NotificationCenter observers
  • Restructured the macOS plugin to use Swift Package Manager structure alongside CocoaPods
  • Updated Dart library to include macOS in platforms that support listening to accent color changes

Reviewed changes

Copilot reviewed 15 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
system_theme/macos/system_theme/Sources/system_theme/SystemThemePlugin.swift New Swift plugin implementation with FlutterStreamHandler support for reactive theme updates
system_theme/macos/system_theme/Package.swift Swift Package Manager manifest for the macOS plugin
system_theme/macos/system_theme.podspec Updated source files path to match new Swift package structure
system_theme/macos/Classes/SystemThemePlugin.swift Removed old plugin implementation (replaced by new structure)
system_theme/lib/system_theme.dart Added macOS to platforms supporting accent color change listeners
system_theme/example/macos/Runner/AppDelegate.swift Updated to use @main annotation and added secure restorable state support
system_theme/example/macos/Runner.xcodeproj/project.pbxproj Updated Xcode project to use Swift Package Manager and increased deployment target to 10.15
system_theme/example/macos/Runner.xcworkspace/contents.xcworkspacedata Added Pods project reference to workspace
system_theme/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme Updated build scheme with Flutter framework preparation script
system_theme/example/ios/Podfile Added iOS Podfile configuration
system_theme/example/ios/Flutter/Release.xcconfig Added Pods configuration import
system_theme/example/ios/Flutter/Debug.xcconfig Added Pods configuration import
system_theme/.gitignore Added .swiftpm directory to gitignore
.DS_Store macOS system file that should not be committed
system_theme/pubspec.lock Updated transitive dependencies and Dart SDK constraint
system_theme_web/pubspec.lock Updated transitive dependencies and Dart SDK constraint
system_theme/example/pubspec.lock Updated transitive dependencies and Dart SDK constraint
Files not reviewed (1)
  • system_theme/example/macos/Runner.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bdlukaa bdlukaa merged commit eb0b303 into master Dec 30, 2025
@bdlukaa bdlukaa deleted the macos branch December 31, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0