Skip to content

Extract fl_lib to avoid bloating#77

Merged
GT-610 merged 4 commits into
mainfrom
extract-fl-lib
Jun 2, 2026
Merged

Extract fl_lib to avoid bloating#77
GT-610 merged 4 commits into
mainfrom
extract-fl-lib

Conversation

@GT-610

@GT-610 GT-610 commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added debug logging interface with log viewing, copying, and clearing capabilities
    • Enhanced logging system with improved file and line context information
    • Improved Chinese font rendering support on Windows
    • New UI widgets for better visual consistency across the application
  • Chores

    • Internal library restructuring and dependency updates
    • Removed unused storage security plugin

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@GT-610, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 47 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e23e80c-bf3f-40d3-8883-6c77daefc188

📥 Commits

Reviewing files that changed from the base of the PR and between 48271d9 and bff98d3.

📒 Files selected for processing (20)
  • lib/app.dart
  • lib/kit/core/build.dart
  • lib/kit/core/ext/widget.dart
  • lib/kit/core/func.dart
  • lib/kit/core/platform.dart
  • lib/kit/core/rnode.dart
  • lib/kit/pages/debug_page.dart
  • lib/kit/provider/debug.dart
  • lib/kit/res/font.dart
  • lib/kit/res/ui.dart
  • lib/kit/widgets/btn.dart
  • lib/kit/widgets/card.dart
  • lib/kit/widgets/input.dart
  • lib/kit/widgets/loading.dart
  • lib/kit/widgets/text.dart
  • lib/kit/widgets/virtual_window_frame.dart
  • lib/pages/components/settings_helpers.dart
  • lib/pages/download_page/download_page.dart
  • lib/pages/settings_page/settings_page.dart
  • lib/utils/logging.dart
📝 Walkthrough

Walkthrough

This PR migrates the app from the fl_lib external package to a new local kit package. It introduces core utilities (reactive framework, build/platform detection, logging), reusable widgets, UI resources, and debug infrastructure, then updates all app code and platform configurations to use kit components and new dependency management.

Changes

Kit Package Creation and App Migration

Layer / File(s) Summary
Core utilities and reactive framework
lib/kit/core/build.dart, lib/kit/core/platform.dart, lib/kit/core/rnode.dart, lib/kit/core/func.dart, lib/kit/core/logger.dart
Build mode detection, platform detection and OS checks, reactive node/value notifier implementation with listener management, throttle helper for rate-limiting, and contextual logging with stack-frame parsing.
Extension helpers for common types
lib/kit/core/ext/datetime.dart, lib/kit/core/ext/obj.dart, lib/kit/core/ext/string.dart, lib/kit/core/ext/widget.dart
DateTime formatting (hourMinute), object-to-reactive wrapping (vn), nullable mapping (nullOr), URL launching from strings, and widget padding helpers (paddingAll, paddingOnly).
UI resources and styling constants
lib/kit/res/ui.dart, lib/kit/res/font.dart
Centralized text styles (sizes, bold/grey/red variants), spacing constants, placeholder widget, color state, and platform-aware Chinese font fallback for Windows.
Reusable widget components
lib/kit/widgets/appbar.dart, lib/kit/widgets/btn.dart, lib/kit/widgets/card.dart, lib/kit/widgets/input.dart, lib/kit/widgets/loading.dart, lib/kit/widgets/text.dart, lib/kit/widgets/virtual_window_frame.dart
Modular Flutter widgets: custom app bar with sizing, multi-layout button support (text/icon/row/column/elevated/dialog), card wrapper with rounded corners, configurable text input with password visibility toggle, sized loading indicators, and desktop window frame with caption.
Debug provider and page
lib/kit/provider/debug.dart, lib/kit/pages/debug_page.dart
Debug log collection with color-coded levels and optional stack-trace scrollers, truncation management, and a dedicated page with copy/clear actions and list rendering.
Kit package barrel export
lib/kit/kit.dart
Single import surface re-exporting all core utilities, widgets, pages, providers, and resources from the kit package.
App and page migration to kit
lib/app.dart, lib/main.dart, lib/pages/*.dart, lib/utils/logging.dart
Update app entry point to use kit.VirtualWindowFrame and kit.SizedLoading, migrate all page and helper files to import kit instead of fl_lib, update logging infrastructure to use kit loggers, and initialize SharedPreferences instead of fl.PrefStore.
Dependency and platform plugin updates
pubspec.yaml, linux/flutter/generated_*.{cc,cmake}, macos/Flutter/GeneratedPluginRegistrant.swift, windows/flutter/generated_*.{cc,cmake}
Add path_provider and shared_preferences dependencies; remove flutter_secure_storage_* plugin registrations and add local_notifier and screen_retriever_* plugins across Linux, macOS, and Windows platforms.

Possibly Related PRs

  • GT-610/setsuna#76: Updates settings UI helper code that overlaps with the lib/pages/components/settings_helpers.dart module refactored in this PR to use the new kit widgets.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Extract fl_lib to avoid bloating' directly reflects the main change: extracting functionality from fl_lib into a new local kit package to reduce bloat.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (21)
lib/pages/download_page/components/add_task_dialog.dart (1)

6-6: 💤 Low value

Consider using consistent import alias for kit package.

This file imports ../../../kit/kit.dart without an alias, while all other files in this migration use as kit. This inconsistency makes the codebase less uniform—for example, this file uses Btn.ok() directly while other files would use kit.Btn.ok().

♻️ Suggested change for consistency
-import '../../../kit/kit.dart';
+import '../../../kit/kit.dart' as kit;

Then update usages:

-Btn.tile(...)
+kit.Btn.tile(...)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/pages/download_page/components/add_task_dialog.dart` at line 6, Replace
the plain import of the kit package with a consistent alias and update usages:
change the import line importing '../../../kit/kit.dart' to use "as kit", then
update any direct references such as Btn.ok(), Btn.cancel(), TextStyles, etc. in
this file to prefixed references like kit.Btn.ok(), kit.Btn.cancel(),
kit.TextStyles (or other kit symbols) so the file matches the rest of the
migration's use of the kit alias.
lib/app.dart (2)

3-4: ⚡ Quick win

Consolidate duplicate kit imports.

The kit package is imported twice on lines 3-4. These can be combined into a single import statement.

♻️ Suggested consolidation
-import 'kit/kit.dart' as kit;
-import 'kit/kit.dart' show ChineseThemeData;
+import 'kit/kit.dart' as kit show ChineseThemeData;

As per coding guidelines, the dart formatter should be used for consistent import handling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/app.dart` around lines 3 - 4, Consolidate the two imports of kit/kit.dart
into a single import: remove the separate plain import and keep one import that
both assigns the alias kit and also exposes ChineseThemeData (so references to
kit.* and ChineseThemeData still work); update the import statement accordingly
and run dart format to ensure consistent ordering and formatting.

3-27: ⚡ Quick win

Reorder imports to follow project guidelines.

Imports should be ordered: dart:package:flutter/package: → relative paths. Currently, the kit/kit.dart imports (lines 3-4) appear before package: imports (lines 5-7).

♻️ Suggested reordering
 import 'dart:async';
 
-import 'kit/kit.dart' as kit;
-import 'kit/kit.dart' show ChineseThemeData;
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
 import 'package:window_manager/window_manager.dart';
+
+import 'kit/kit.dart' as kit show ChineseThemeData;
 import 'constants/app_branding.dart';

As per coding guidelines, imports should follow the specified order and flutter format . should be used for automatic code formatting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/app.dart` around lines 3 - 27, The import order in lib/app.dart is
incorrect: move the two kit imports (import 'kit/kit.dart' as kit; and import
'kit/kit.dart' show ChineseThemeData;) so they appear after the dart: and
package:flutter/ imports and after other package: imports (i.e., follow dart: →
package:flutter/... → package:... → relative/project imports order used across
this repo), then run flutter format . to apply automatic formatting; use the
symbols kit, ChineseThemeData and existing package imports
(package:flutter/material.dart, package:provider/provider.dart, etc.) to locate
and reorder the lines.
lib/utils/logging.dart (1)

3-5: ⚡ Quick win

Reorder the new imports to keep Dart groups consistent.

package:logging/logging.dart should stay above the relative ../kit/... imports. As per coding guidelines, **/*.dart: Order imports as: dart: → package:flutter/ → package: → relative paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/utils/logging.dart` around lines 3 - 5, Reorder the import statements so
package imports come before relative imports: move
"package:logging/logging.dart" above the two relative imports
("../kit/provider/debug.dart" and "../kit/core/logger.dart") so the file follows
the dart import grouping (dart:, package:, then relative paths); ensure no other
import order changes are introduced and keep existing import names unchanged.
lib/pages/settings_page/settings_page.dart (1)

3-17: ⚡ Quick win

Reorder these imports to match the repo's Dart convention.

../../kit/kit.dart should be grouped with the other relative imports after the package: imports. As per coding guidelines, **/*.dart: Order imports as: dart: → package:flutter/ → package: → relative paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/pages/settings_page/settings_page.dart` around lines 3 - 17, Reorder the
import lines in settings_page.dart so the relative import ../../kit/kit.dart is
moved out of the top and placed with the other relative imports after all
package imports; follow the repo convention: dart: imports first, then
package:flutter and other package: imports (e.g., package:material,
package:provider, package:package_info_plus, package:url_launcher), and finally
relative imports such as ../../kit/kit.dart, ../../constants/...,
../../generated/..., ../../models/..., ../../services/..., ../../utils/..., and
./components/appearance_dialog.dart so the import groups and ordering match the
project's Dart style.
lib/kit/core/rnode.dart (1)

59-63: ⚡ Quick win

VNode setter notifies even when the value is unchanged.

Unlike Flutter's ValueNotifier, this fires notify() on every assignment, including no-op writes, causing avoidable rebuilds. Consider short-circuiting when _value == newVal.

♻️ Proposed change
   set value(T newVal) {
+    if (_value == newVal) return;
     _value = newVal;
     notify();
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/core/rnode.dart` around lines 59 - 63, The VNode setter currently
always calls notify() on assignment; change the set value(T newVal) in the VNode
(the setter that writes to _value and calls notify()) to short-circuit when the
incoming newVal equals the current _value (i.e., if (_value == newVal) return;)
before assigning and calling notify(), so notifications only occur on real
changes.
lib/kit/core/func.dart (1)

12-12: ⚡ Quick win

Prefer a concrete callback type over Function?.

Function? is effectively untyped. Since it is only invoked as continueClick?.call(), a void Function()? signature gives stronger typing and clearer intent.

♻️ Proposed change
-    Function? continueClick,
+    void Function()? continueClick,

As per coding guidelines: "Use strong typing and avoid dynamic type."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/core/func.dart` at line 12, The parameter continueClick is currently
declared as untyped Function? — change its type to a nullable concrete callback
signature void Function()? by updating the parameter declaration for
continueClick in the function/class (look for the parameter named continueClick
in lib/kit/core/func.dart) and any matching fields/constructor parameters or
usages (e.g., where continueClick?.call() is invoked) so the type is
consistently void Function()? throughout the class/function.
lib/kit/core/platform.dart (1)

28-28: 💤 Low value

Typo in public API name: seperatorseparator.

This is a newly exported member, so correcting the spelling now avoids a breaking rename later.

✏️ Proposed fix
-  static final String seperator = isWindows ? '\\' : '/';
+  static final String separator = isWindows ? '\\' : '/';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/core/platform.dart` at line 28, Rename the misspelled public static
field `seperator` to `separator` (i.e., change `static final String seperator` →
`static final String separator`) in the Platform class, then update all
references, exports, documentation and tests that use `seperator` to the new
`separator` identifier so the public API is corrected consistently; ensure no
remaining references to `seperator` remain.
lib/kit/widgets/appbar.dart (2)

51-51: ⚡ Quick win

Use SCREAMING_SNAKE_CASE for compile-time constants.

The static const appBarHeight should follow SCREAMING_SNAKE_CASE naming convention. As per coding guidelines, "Use SCREAMING_SNAKE_CASE for compile-time constants".

♻️ Proposed fix
-static const double appBarHeight = kToolbarHeight - 10;
+static const double APP_BAR_HEIGHT = kToolbarHeight - 10;

And update references to use APP_BAR_HEIGHT instead of appBarHeight.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/appbar.dart` at line 51, Rename the compile-time constant
appBarHeight to follow SCREAMING_SNAKE_CASE (APP_BAR_HEIGHT) in the AppBar
widget file and update all references accordingly; specifically change the
static const declaration named appBarHeight to APP_BAR_HEIGHT (in the class
where it's declared) and replace every usage of appBarHeight throughout the
codebase with APP_BAR_HEIGHT to keep naming consistent with compile-time
constant conventions.

6-19: ⚡ Quick win

Add trailing commas for multi-line constructs.

Multi-line widget constructors and function calls should include trailing commas. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix
 const CustomAppBar({
   super.key,
   this.title,
   this.actions,
   this.centerTitle = true,
   this.leading,
   this.backgroundColor,
   this.bottom,
   this.scrolledUnderElevation = 0,
-  this.surfaceTintColor = Colors.transparent,
+  this.surfaceTintColor = Colors.transparent,
 });

 return AppBar(
   key: key,
   title: title,
   actions: actions,
   centerTitle: centerTitle,
   leading: leading,
   backgroundColor: backgroundColor,
   toolbarHeight: appBarHeight,
   bottom: bottom,
   scrolledUnderElevation: scrolledUnderElevation,
-  surfaceTintColor: surfaceTintColor,
+  surfaceTintColor: surfaceTintColor,
 );

Also applies to: 32-43

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/appbar.dart` around lines 6 - 19, The CustomAppBar
constructor and other multi-line widget constructors (e.g., the parameter list
for CustomAppBar and the multi-line build members around the class) are missing
trailing commas; update the constructor parameter list in class CustomAppBar
(and any other multi-line widget or function calls in the same file, including
the section around the bottom/fields and the multi-line block referenced near
lines 32-43) to include trailing commas after each parameter/item to satisfy the
style guide and ensure proper formatting.
lib/kit/widgets/btn.dart (2)

34-47: ⚡ Quick win

Add trailing commas for multi-line constructors.

All named constructors should include trailing commas after the last parameter to enable proper auto-formatting. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix (example for Btn.text)
 const Btn.text({
   super.key,
   required this.text,
   this.onTap = _defaultOnTap,
   this.textStyle,
   this.padding,
-  this.onLongTap,
+  this.onLongTap,
 })  : type = BtnType.text,
       gap = null,
       mainAxisAlignment = null,
       mainAxisSize = null,
       borderRadius = null,
       popVal = null,
       icon = null;

Apply similar changes to all other named constructors.

Also applies to: 49-62, 64-77, 79-92, 94-110, 112-125, 127-142, 144-158

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/btn.dart` around lines 34 - 47, The named constructors (e.g.,
Btn.text) are missing trailing commas after their last parameter which prevents
proper Dart auto-formatting; for each multi-line named constructor in Btn
(Btn.text and the other named constructors referenced) add a trailing comma
after the final parameter list (for example after this.onLongTap,) so the
constructor argument list ends with a comma, then run dartfmt to verify
formatting across all constructors.

203-218: ⚡ Quick win

Add trailing commas in widget trees.

Multi-line Column, Row, and ElevatedButton widget trees should include trailing commas. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix (example)
 Widget child = Column(
   children: [
     icon ?? _kPlaceholderIcon,
     SizedBox(height: gap ?? _kGap),
-    Text(text, style: textStyle),
+    Text(text, style: textStyle),
   ],
 );

Apply similar changes to other widget trees in _row and _elevated.

Also applies to: 228-241, 254-267

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/btn.dart` around lines 203 - 218, The multi-line widget trees
(e.g., the Column assigned to local variable child, the Padding wrapping child,
and the returned InkWell) are missing trailing commas; update these multi-line
constructors to include trailing commas so Dart formatter produces readable,
multi-line layout (apply the same change to other widget trees in the file such
as the _row and _elevated widget builders referenced in the comment).
Specifically, add trailing commas after the Column children list, after the
Padding(...) argument list when present, and after the InkWell(...) argument
list (and mirror this pattern in the _row and _elevated functions) so all
multi-line widget constructors end with a trailing comma.
lib/kit/core/ext/widget.dart (1)

4-5: ⚡ Quick win

Add trailing commas for multi-line constructs.

Multi-line function expressions should include trailing commas to enable flutter format . to work correctly with the 80-character line limit. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix
 Widget paddingAll(double value) =>
-      Padding(padding: EdgeInsets.all(value), child: this);
+      Padding(padding: EdgeInsets.all(value), child: this,);

 Widget paddingOnly({
   double left = 0,
   double top = 0,
   double right = 0,
   double bottom = 0,
 }) =>
     Padding(
       padding: EdgeInsets.only(
         left: left,
         top: top,
         right: right,
         bottom: bottom,
       ),
       child: this,
-    );
+    ),;

Also applies to: 13-21

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/core/ext/widget.dart` around lines 4 - 5, The multi-line widget
extension methods (e.g., the paddingAll method) are missing trailing commas,
which prevents proper Flutter formatting; update each multi-line expression
(such as Widget paddingAll(double value) => Padding(padding:
EdgeInsets.all(value), child: this); and the other extension methods in the same
file) to place trailing commas after positional/ named parameters and after the
child where appropriate so the construct ends with a comma and the formatter can
reflow lines correctly.
lib/kit/widgets/loading.dart (2)

39-41: ⚡ Quick win

Use SCREAMING_SNAKE_CASE for static compile-time constants.

The static const instances small, medium, and large should follow SCREAMING_SNAKE_CASE naming convention. As per coding guidelines, "Use SCREAMING_SNAKE_CASE for compile-time constants".

♻️ Proposed fix
-static const small = SizedLoading(25);
-static const medium = SizedLoading(45);
-static const large = SizedLoading(65);
+static const SMALL = SizedLoading(25);
+static const MEDIUM = SizedLoading(45);
+static const LARGE = SizedLoading(65);

Update usage sites accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/loading.dart` around lines 39 - 41, The static const
instances small, medium, and large in the SizedLoading widget are compile-time
constants and must use SCREAMING_SNAKE_CASE; rename the symbols to SMALL,
MEDIUM, and LARGE (references: SizedLoading, small/medium/large) and update all
usage sites to the new names so callers reference SizedLoading.SMALL, .MEDIUM,
and .LARGE.

12-18: ⚡ Quick win

Add trailing commas for multi-line constructs.

The constructor, function definitions, and widget trees should include trailing commas. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix
 const SizedLoading(
   this.size, {
   this.padding = 7,
   this.valueColor,
   this.builder = linearBuilder,
-  super.key,
+  super.key,
 });

 static Widget linearBuilder(
   BuildContext context,
-  Animation<Color>? valueColor,
+  Animation<Color>? valueColor,
 ) {
   return LinearProgressIndicator(
     valueColor: valueColor ??
         AlwaysStoppedAnimation(Theme.of(context).colorScheme.primary),
   );
 }

 return SizedBox(
   width: size - 2 * padding,
   height: size - 2 * padding,
   child: Center(child: builder(context, valueColor)).paddingAll(padding),
-).paddingAll(3);
+).paddingAll(3),;

Also applies to: 20-27, 31-36

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/loading.dart` around lines 12 - 18, The SizedLoading
constructor declaration (const SizedLoading) and other multi-line constructs
(including the parameter lists around padding, valueColor, builder, and
super.key, as well as the function/widget definitions noted at lines 20-27 and
31-36) need trailing commas added so Dart formatter produces proper multi-line
formatting; update the parameter lists and any multi-line widget trees or
function signatures (e.g., the constructor for SizedLoading and the functions
referencing linearBuilder) to include trailing commas after each
argument/parameter and after the final parameter (including super.key) where
applicable.
lib/kit/res/ui.dart (1)

5-8: ⚡ Quick win

Add trailing commas for multi-line constructs.

Multi-line TextStyle, BoxDecoration, and widget definitions should include trailing commas to enable flutter format . with the 80-character line limit. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix (partial example)
 static const text11Bold = TextStyle(
   fontSize: 11,
-  fontWeight: FontWeight.w500,
+  fontWeight: FontWeight.w500,
 );

 static Widget dot({Color? color, double? size}) => Container(
       width: size ?? 7,
       height: size ?? 7,
       decoration: BoxDecoration(
         color: color ?? primaryColor,
         shape: BoxShape.circle,
       ),
-    );
+    ),;

Apply similar changes to other multi-line constructs.

Also applies to: 11-13, 17-20, 23-26, 39-46, 48-51

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/res/ui.dart` around lines 5 - 8, The multi-line constructors (e.g.,
the TextStyle constant text11Bold) in lib/kit/res/ui.dart are missing trailing
commas; add trailing commas to every multi-line TextStyle, BoxDecoration, and
widget definition in this file (including the other TextStyle constants and any
multi-line BoxDecoration/widget blocks referenced in the comment ranges) so
dartfmt/Flutter format will layout them across multiple lines correctly; ensure
each multi-line argument list and constructor invocation ends with a comma.
lib/kit/widgets/card.dart (2)

9-15: ⚡ Quick win

Add trailing comma in constructor.

The constructor should include a trailing comma after the last parameter. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix
 const CardX({
   super.key,
   required this.child,
   this.color,
   this.radius,
-  this.clipBehavior = Clip.hardEdge,
+  this.clipBehavior = Clip.hardEdge,
 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/card.dart` around lines 9 - 15, The CardX constructor
declaration is missing a trailing comma after the last parameter; update the
constructor (const CardX({...})) to place a trailing comma after the
clipBehavior = Clip.hardEdge parameter so the multi-line parameter list follows
the project's trailing-comma style.

17-17: ⚡ Quick win

Use SCREAMING_SNAKE_CASE for static compile-time constants.

The static const borderRadius should follow SCREAMING_SNAKE_CASE naming convention. As per coding guidelines, "Use SCREAMING_SNAKE_CASE for compile-time constants".

♻️ Proposed fix
-static const borderRadius = BorderRadius.all(Radius.circular(13));
+static const BORDER_RADIUS = BorderRadius.all(Radius.circular(13));

And update the reference on line 26:

-borderRadius: radius ?? borderRadius,
+borderRadius: radius ?? BORDER_RADIUS,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/card.dart` at line 17, Rename the static compile-time
constant `borderRadius` to SCREAMING_SNAKE_CASE (e.g., `BORDER_RADIUS`) and
update its declaration to `static const BORDER_RADIUS =
BorderRadius.all(Radius.circular(13));`; then update all references to this
symbol (e.g., `borderRadius`) to use the new `BORDER_RADIUS` identifier so code
compiles and follows the constant naming convention.
lib/kit/res/font.dart (1)

7-11: ⚡ Quick win

Add trailing commas for multi-line constructs.

Multi-line lists, switch expressions, and function bodies should include trailing commas to enable flutter format . with the 80-character line limit. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix
 const _fontFamilyFallback = [
   'system-font',
   'sans-serif',
-  'Microsoft YaHei',
+  'Microsoft YaHei',
 ];

 TextTheme _fixChinese(Brightness brightness) {
   final newTextTheme = switch (brightness) {
     Brightness.dark =>
       _typography.white.apply(fontFamilyFallback: _fontFamilyFallback),
     Brightness.light =>
-      _typography.black.apply(fontFamilyFallback: _fontFamilyFallback),
+      _typography.black.apply(fontFamilyFallback: _fontFamilyFallback),
   };
   return newTextTheme.merge(this);
 }

 return switch (Platform.localeName) {
   final locale when locale.startsWith('zh') =>
     copyWith(textTheme: textTheme._fixChinese(brightness)),
-  _ => this,
+  _ => this,
 };

Also applies to: 16-24, 31-35

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/res/font.dart` around lines 7 - 11, The multi-line list literal
_fontFamilyFallback (and other multi-line constructs in this file) is missing a
trailing comma; update the list and any other multi-line lists or collection
literals in lib/kit/res/font.dart (e.g., the other multi-line list blocks
referenced in the review) to include a trailing comma after the last element so
flutter format can apply the 80-char rule and produce the intended formatting.
Ensure each multi-line list/collection expression ends with a comma (and
similarly add trailing commas to multi-line argument or parameter lists if
present).
lib/kit/widgets/input.dart (1)

33-63: ⚡ Quick win

Add trailing commas for multi-line constructs.

The constructor, widget trees, and method calls should include trailing commas. As per coding guidelines, "Use trailing commas in multi-line constructs".

♻️ Proposed fix (partial example)
 const Input({
   super.key,
   this.controller,
   this.maxLines = 1,
   this.minLines,
   this.hint,
   this.label,
   this.onSubmitted,
   this.onChanged,
   this.obscureText = false,
   this.icon,
   this.type,
   this.action,
   this.node,
   this.autoCorrect = false,
   this.suggestion,
   this.errorText,
   this.autoFocus = false,
   this.onViewPwdTap,
   this.noWrap = false,
   this.suffix,
   this.counterBuilder,
   this.onTap,
   this.onTapOutside,
   this.contextMenuBuilder,
   this.maxLength,
-  this.enabled,
+  this.enabled,
 }) : assert(
        !(obscureText && suffix != null),
-       'suffix != null && obscureText',
+       'suffix != null && obscureText',
      );

Apply similar changes to widget trees and other multi-line constructs.

Also applies to: 73-85, 89-120, 127-137

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/input.dart` around lines 33 - 63, The Input constructor and
other multi-line constructs (e.g., the Input widget build trees and method
calls) are missing trailing commas; update the Input constructor parameter list
(the const Input({...}) and its assert), the widget tree expressions inside the
Input class (build method, any nested widgets), and multi-line method calls like
counterBuilder/contextMenuBuilder declarations to add trailing commas at the end
of each multi-line argument/list/collection so the formatter produces proper
line breaks and consistent formatting.
lib/kit/widgets/virtual_window_frame.dart (1)

7-15: ⚡ Quick win

Consider documenting the intended usage of WindowFrameConfig.

The setShowCaption method updates static state but doesn't trigger widget rebuilds. If this is only intended to be called during app initialization (before widgets are built), consider adding a doc comment to clarify this. If runtime updates are expected, consider using a ChangeNotifier or ValueNotifier to enable reactive updates.

💡 Example documentation approach
 abstract final class WindowFrameConfig {
   static bool _showCaption = true;
 
   static bool get showCaption => _showCaption && isDesktop;
 
+  /// Sets whether to show the window caption.
+  /// This should only be called during app initialization before
+  /// VirtualWindowFrame widgets are built.
   static void setShowCaption(bool value) {
     _showCaption = value;
   }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/widgets/virtual_window_frame.dart` around lines 7 - 15, Document the
intended usage of WindowFrameConfig and either make it reactive or mark it as
initialization-only: add a doc comment above the WindowFrameConfig class
explaining that setShowCaption updates the static _showCaption and does not
trigger widget rebuilds (so it must be called before widgets are built) if
that's the intended behavior; otherwise, replace or wrap _showCaption with a
reactive mechanism (e.g., a static ValueNotifier<bool> or a
ChangeNotifier-backed API) and expose showCaption via that notifier so widgets
can listen and rebuild when setShowCaption is called; reference
WindowFrameConfig, setShowCaption, _showCaption, showCaption and isDesktop in
the doc and implementation change to make the expected lifecycle explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/kit/core/rnode.dart`:
- Around line 22-29: notify currently iterates _listeners directly and swallows
all exceptions; make a stable snapshot before iterating (e.g., iterate over a
List.of(_listeners) so addListener/removeListener during dispatch won't cause
ConcurrentModificationError) and replace the empty catch with proper error
handling: catch (error, stack) and forward the information to your logger or
report it (e.g., FlutterError.reportError or a process logger) instead of
silently discarding it so listener failures are visible and debuggable.

In `@lib/kit/provider/debug.dart`:
- Around line 9-13: The _level2Color map in DebugProvider uses the key 'ERROR'
but log.e() emits Level.SEVERE via record.level.name, causing error rows to use
the fallback color; update the map named _level2Color to include 'SEVERE' (or
replace 'ERROR' with 'SEVERE') so record.level.name (from DebugProvider's
lookup) finds the intended color, e.g., adjust entries for 'ERROR'/'SEVERE'
while keeping 'INFO' and 'WARNING' as-is.

In `@lib/kit/res/ui.dart`:
- Around line 53-54: The static mutable variables colorSeed and primaryColor in
ui.dart create global mutable state; replace them with an injectable, immutable
theme/config provider: create a ColorTheme or UiConfig class that exposes final
colorSeed and primaryColor, register it with Provider (ChangeNotifier or a plain
immutable provider) at app root, and update consumers to read
Provider.of<ColorTheme>(context).colorSeed / .primaryColor instead of using the
static variables so state is managed via Provider and becomes testable and
instance-scoped.

In `@lib/kit/widgets/virtual_window_frame.dart`:
- Around line 59-77: The wm.WindowCaption widget in virtual_window_frame.dart is
missing a trailing comma which breaks the project's multi-line formatting rules;
update the children list by adding a trailing comma after the closing
parenthesis of wm.WindowCaption (the widget built when isLinux || isWindows) so
the multi-line widget follows formatting conventions and the analyzer/formatter
can apply proper layout.

In `@lib/pages/settings_page/settings_page.dart`:
- Around line 538-545: The linkText widget currently calls launchUrl directly
(onTap: () => launchUrl(Uri.parse(url))) and drops the Future; change it to call
and await the centralized helper _launchExternalUri(Uri) used elsewhere (e.g.,
from _buildAboutRichText) so all external launches use the same UX/error
handling; update the onTap to an async handler that awaits
_launchExternalUri(Uri.parse(url)) and ensure _launchExternalUri or the new
onTap wraps the call in a try-catch to handle PlatformException/errors and
surface feedback via the existing error reporting mechanism.

---

Nitpick comments:
In `@lib/app.dart`:
- Around line 3-4: Consolidate the two imports of kit/kit.dart into a single
import: remove the separate plain import and keep one import that both assigns
the alias kit and also exposes ChineseThemeData (so references to kit.* and
ChineseThemeData still work); update the import statement accordingly and run
dart format to ensure consistent ordering and formatting.
- Around line 3-27: The import order in lib/app.dart is incorrect: move the two
kit imports (import 'kit/kit.dart' as kit; and import 'kit/kit.dart' show
ChineseThemeData;) so they appear after the dart: and package:flutter/ imports
and after other package: imports (i.e., follow dart: → package:flutter/... →
package:... → relative/project imports order used across this repo), then run
flutter format . to apply automatic formatting; use the symbols kit,
ChineseThemeData and existing package imports (package:flutter/material.dart,
package:provider/provider.dart, etc.) to locate and reorder the lines.

In `@lib/kit/core/ext/widget.dart`:
- Around line 4-5: The multi-line widget extension methods (e.g., the paddingAll
method) are missing trailing commas, which prevents proper Flutter formatting;
update each multi-line expression (such as Widget paddingAll(double value) =>
Padding(padding: EdgeInsets.all(value), child: this); and the other extension
methods in the same file) to place trailing commas after positional/ named
parameters and after the child where appropriate so the construct ends with a
comma and the formatter can reflow lines correctly.

In `@lib/kit/core/func.dart`:
- Line 12: The parameter continueClick is currently declared as untyped
Function? — change its type to a nullable concrete callback signature void
Function()? by updating the parameter declaration for continueClick in the
function/class (look for the parameter named continueClick in
lib/kit/core/func.dart) and any matching fields/constructor parameters or usages
(e.g., where continueClick?.call() is invoked) so the type is consistently void
Function()? throughout the class/function.

In `@lib/kit/core/platform.dart`:
- Line 28: Rename the misspelled public static field `seperator` to `separator`
(i.e., change `static final String seperator` → `static final String separator`)
in the Platform class, then update all references, exports, documentation and
tests that use `seperator` to the new `separator` identifier so the public API
is corrected consistently; ensure no remaining references to `seperator` remain.

In `@lib/kit/core/rnode.dart`:
- Around line 59-63: The VNode setter currently always calls notify() on
assignment; change the set value(T newVal) in the VNode (the setter that writes
to _value and calls notify()) to short-circuit when the incoming newVal equals
the current _value (i.e., if (_value == newVal) return;) before assigning and
calling notify(), so notifications only occur on real changes.

In `@lib/kit/res/font.dart`:
- Around line 7-11: The multi-line list literal _fontFamilyFallback (and other
multi-line constructs in this file) is missing a trailing comma; update the list
and any other multi-line lists or collection literals in lib/kit/res/font.dart
(e.g., the other multi-line list blocks referenced in the review) to include a
trailing comma after the last element so flutter format can apply the 80-char
rule and produce the intended formatting. Ensure each multi-line list/collection
expression ends with a comma (and similarly add trailing commas to multi-line
argument or parameter lists if present).

In `@lib/kit/res/ui.dart`:
- Around line 5-8: The multi-line constructors (e.g., the TextStyle constant
text11Bold) in lib/kit/res/ui.dart are missing trailing commas; add trailing
commas to every multi-line TextStyle, BoxDecoration, and widget definition in
this file (including the other TextStyle constants and any multi-line
BoxDecoration/widget blocks referenced in the comment ranges) so dartfmt/Flutter
format will layout them across multiple lines correctly; ensure each multi-line
argument list and constructor invocation ends with a comma.

In `@lib/kit/widgets/appbar.dart`:
- Line 51: Rename the compile-time constant appBarHeight to follow
SCREAMING_SNAKE_CASE (APP_BAR_HEIGHT) in the AppBar widget file and update all
references accordingly; specifically change the static const declaration named
appBarHeight to APP_BAR_HEIGHT (in the class where it's declared) and replace
every usage of appBarHeight throughout the codebase with APP_BAR_HEIGHT to keep
naming consistent with compile-time constant conventions.
- Around line 6-19: The CustomAppBar constructor and other multi-line widget
constructors (e.g., the parameter list for CustomAppBar and the multi-line build
members around the class) are missing trailing commas; update the constructor
parameter list in class CustomAppBar (and any other multi-line widget or
function calls in the same file, including the section around the bottom/fields
and the multi-line block referenced near lines 32-43) to include trailing commas
after each parameter/item to satisfy the style guide and ensure proper
formatting.

In `@lib/kit/widgets/btn.dart`:
- Around line 34-47: The named constructors (e.g., Btn.text) are missing
trailing commas after their last parameter which prevents proper Dart
auto-formatting; for each multi-line named constructor in Btn (Btn.text and the
other named constructors referenced) add a trailing comma after the final
parameter list (for example after this.onLongTap,) so the constructor argument
list ends with a comma, then run dartfmt to verify formatting across all
constructors.
- Around line 203-218: The multi-line widget trees (e.g., the Column assigned to
local variable child, the Padding wrapping child, and the returned InkWell) are
missing trailing commas; update these multi-line constructors to include
trailing commas so Dart formatter produces readable, multi-line layout (apply
the same change to other widget trees in the file such as the _row and _elevated
widget builders referenced in the comment). Specifically, add trailing commas
after the Column children list, after the Padding(...) argument list when
present, and after the InkWell(...) argument list (and mirror this pattern in
the _row and _elevated functions) so all multi-line widget constructors end with
a trailing comma.

In `@lib/kit/widgets/card.dart`:
- Around line 9-15: The CardX constructor declaration is missing a trailing
comma after the last parameter; update the constructor (const CardX({...})) to
place a trailing comma after the clipBehavior = Clip.hardEdge parameter so the
multi-line parameter list follows the project's trailing-comma style.
- Line 17: Rename the static compile-time constant `borderRadius` to
SCREAMING_SNAKE_CASE (e.g., `BORDER_RADIUS`) and update its declaration to
`static const BORDER_RADIUS = BorderRadius.all(Radius.circular(13));`; then
update all references to this symbol (e.g., `borderRadius`) to use the new
`BORDER_RADIUS` identifier so code compiles and follows the constant naming
convention.

In `@lib/kit/widgets/input.dart`:
- Around line 33-63: The Input constructor and other multi-line constructs
(e.g., the Input widget build trees and method calls) are missing trailing
commas; update the Input constructor parameter list (the const Input({...}) and
its assert), the widget tree expressions inside the Input class (build method,
any nested widgets), and multi-line method calls like
counterBuilder/contextMenuBuilder declarations to add trailing commas at the end
of each multi-line argument/list/collection so the formatter produces proper
line breaks and consistent formatting.

In `@lib/kit/widgets/loading.dart`:
- Around line 39-41: The static const instances small, medium, and large in the
SizedLoading widget are compile-time constants and must use
SCREAMING_SNAKE_CASE; rename the symbols to SMALL, MEDIUM, and LARGE
(references: SizedLoading, small/medium/large) and update all usage sites to the
new names so callers reference SizedLoading.SMALL, .MEDIUM, and .LARGE.
- Around line 12-18: The SizedLoading constructor declaration (const
SizedLoading) and other multi-line constructs (including the parameter lists
around padding, valueColor, builder, and super.key, as well as the
function/widget definitions noted at lines 20-27 and 31-36) need trailing commas
added so Dart formatter produces proper multi-line formatting; update the
parameter lists and any multi-line widget trees or function signatures (e.g.,
the constructor for SizedLoading and the functions referencing linearBuilder) to
include trailing commas after each argument/parameter and after the final
parameter (including super.key) where applicable.

In `@lib/kit/widgets/virtual_window_frame.dart`:
- Around line 7-15: Document the intended usage of WindowFrameConfig and either
make it reactive or mark it as initialization-only: add a doc comment above the
WindowFrameConfig class explaining that setShowCaption updates the static
_showCaption and does not trigger widget rebuilds (so it must be called before
widgets are built) if that's the intended behavior; otherwise, replace or wrap
_showCaption with a reactive mechanism (e.g., a static ValueNotifier<bool> or a
ChangeNotifier-backed API) and expose showCaption via that notifier so widgets
can listen and rebuild when setShowCaption is called; reference
WindowFrameConfig, setShowCaption, _showCaption, showCaption and isDesktop in
the doc and implementation change to make the expected lifecycle explicit.

In `@lib/pages/download_page/components/add_task_dialog.dart`:
- Line 6: Replace the plain import of the kit package with a consistent alias
and update usages: change the import line importing '../../../kit/kit.dart' to
use "as kit", then update any direct references such as Btn.ok(), Btn.cancel(),
TextStyles, etc. in this file to prefixed references like kit.Btn.ok(),
kit.Btn.cancel(), kit.TextStyles (or other kit symbols) so the file matches the
rest of the migration's use of the kit alias.

In `@lib/pages/settings_page/settings_page.dart`:
- Around line 3-17: Reorder the import lines in settings_page.dart so the
relative import ../../kit/kit.dart is moved out of the top and placed with the
other relative imports after all package imports; follow the repo convention:
dart: imports first, then package:flutter and other package: imports (e.g.,
package:material, package:provider, package:package_info_plus,
package:url_launcher), and finally relative imports such as ../../kit/kit.dart,
../../constants/..., ../../generated/..., ../../models/..., ../../services/...,
../../utils/..., and ./components/appearance_dialog.dart so the import groups
and ordering match the project's Dart style.

In `@lib/utils/logging.dart`:
- Around line 3-5: Reorder the import statements so package imports come before
relative imports: move "package:logging/logging.dart" above the two relative
imports ("../kit/provider/debug.dart" and "../kit/core/logger.dart") so the file
follows the dart import grouping (dart:, package:, then relative paths); ensure
no other import order changes are introduced and keep existing import names
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b016f3d3-04d0-4de3-9abe-5c2828056825

📥 Commits

Reviewing files that changed from the base of the PR and between d08dd52 and 48271d9.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (38)
  • lib/app.dart
  • lib/kit/core/build.dart
  • lib/kit/core/ext/datetime.dart
  • lib/kit/core/ext/obj.dart
  • lib/kit/core/ext/string.dart
  • lib/kit/core/ext/widget.dart
  • lib/kit/core/func.dart
  • lib/kit/core/logger.dart
  • lib/kit/core/platform.dart
  • lib/kit/core/rnode.dart
  • lib/kit/kit.dart
  • lib/kit/pages/debug_page.dart
  • lib/kit/provider/debug.dart
  • lib/kit/res/font.dart
  • lib/kit/res/ui.dart
  • lib/kit/widgets/appbar.dart
  • lib/kit/widgets/btn.dart
  • lib/kit/widgets/card.dart
  • lib/kit/widgets/input.dart
  • lib/kit/widgets/loading.dart
  • lib/kit/widgets/text.dart
  • lib/kit/widgets/virtual_window_frame.dart
  • lib/main.dart
  • lib/pages/builtin_instance_settings_page.dart
  • lib/pages/components/settings_helpers.dart
  • lib/pages/download_page/components/add_task_dialog.dart
  • lib/pages/instance_page/components/instance_dialog.dart
  • lib/pages/remote_instance_settings_page.dart
  • lib/pages/remote_instance_status_page.dart
  • lib/pages/settings_page/settings_page.dart
  • lib/utils/logging.dart
  • linux/flutter/generated_plugin_registrant.cc
  • linux/flutter/generated_plugins.cmake
  • macos/Flutter/GeneratedPluginRegistrant.swift
  • packages/fl_lib
  • pubspec.yaml
  • windows/flutter/generated_plugin_registrant.cc
  • windows/flutter/generated_plugins.cmake
💤 Files with no reviewable changes (6)
  • macos/Flutter/GeneratedPluginRegistrant.swift
  • windows/flutter/generated_plugin_registrant.cc
  • linux/flutter/generated_plugins.cmake
  • windows/flutter/generated_plugins.cmake
  • linux/flutter/generated_plugin_registrant.cc
  • packages/fl_lib

Comment thread lib/kit/core/rnode.dart Outdated
Comment thread lib/kit/provider/debug.dart
Comment thread lib/kit/res/ui.dart
Comment on lines +53 to +54
static var colorSeed = const Color.fromARGB(255, 72, 15, 15);
static var primaryColor = colorSeed;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Avoid mutable static state; use Provider for color theme management.

The mutable static variables colorSeed and primaryColor introduce global state that bypasses the recommended state management pattern. This makes it difficult to track changes, test the code, and follow Flutter best practices. As per coding guidelines, "Use Provider for dependency injection and state management".

Consider refactoring to use a Provider-based theme or color configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kit/res/ui.dart` around lines 53 - 54, The static mutable variables
colorSeed and primaryColor in ui.dart create global mutable state; replace them
with an injectable, immutable theme/config provider: create a ColorTheme or
UiConfig class that exposes final colorSeed and primaryColor, register it with
Provider (ChangeNotifier or a plain immutable provider) at app root, and update
consumers to read Provider.of<ColorTheme>(context).colorSeed / .primaryColor
instead of using the static variables so state is managed via Provider and
becomes testable and instance-scoped.

Comment thread lib/kit/widgets/virtual_window_frame.dart
Comment thread lib/pages/settings_page/settings_page.dart
@GT-610 GT-610 merged commit 1a43f8f into main Jun 2, 2026
2 checks passed
@GT-610 GT-610 deleted the extract-fl-lib branch June 2, 2026 04:15
@coderabbitai coderabbitai Bot mentioned this pull request Jun 7, 2026
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.

1 participant