-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/widgetbook #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feat/widgetbook #82
Conversation
WalkthroughThe pull request introduces Widgetbook integration for component documentation and testing, adds URL Launcher plugin support across multiple platforms (Linux, macOS, Windows), includes a new test file for the useMessageMenu hook, and establishes complete Widgetbook Flutter application scaffolding with native platform configurations for Android, iOS, and macOS. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes This review requires understanding multiple heterogeneous platform configurations (Android Gradle/Kotlin, iOS/macOS Xcode/Swift/CocoaPods), URL Launcher plugin integration patterns, and Widgetbook-specific setup across three platforms. While many changes follow standard Flutter boilerplate, the diversity of build systems, the substantial size of Xcode project files, and careful verification of platform-specific integrations demand detailed attention. Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
🤖 Fix all issues with AI agents
In `@test/hooks/use_message_menu_test.dart`:
- Around line 1-3: Tests import use_message_menu.dart but the hook
implementation is missing; create lib/hooks/use_message_menu.dart and implement
the exported symbols toggleEmojiPicker(), closeEmojiPicker(), and the
showEmojiPicker property (e.g., as a boolean state exposed by the hook) so tests
can run; ensure the hook initializes showEmojiPicker to false, toggles its value
in toggleEmojiPicker(), and sets it false in closeEmojiPicker(), and export the
hook API with the exact names used in the tests (toggleEmojiPicker,
closeEmojiPicker, showEmojiPicker).
In `@widgetbook/analysis_options.yaml`:
- Around line 23-25: The lint rules block in analysis_options.yaml is missing
repository-standard rules; add explicit entries for prefer_const_constructors
and prefer_final_locals under the existing rules: set prefer_const_constructors:
true and prefer_final_locals: true so the analyzer enforces these Dart/Flutter
conventions consistently with the main project (modify the rules mapping shown
in the file where the commented rules live).
In `@widgetbook/android/app/src/main/AndroidManifest.xml`:
- Around line 2-5: Replace the hardcoded android:label in the <application> tag
with a string resource reference (use android:label="@string/app_name") and add
the corresponding app_name entry in res/values/strings.xml; update the
manifest's android:label attribute (android:label="@string/app_name") and create
or modify strings.xml to include <string name="app_name">YourAppName</string> so
the label is localizable and reusable.
In `@widgetbook/android/gradle.properties`:
- Around line 1-2: The repo-wide gradle JVM settings in org.gradle.jvmargs
currently force high memory (e.g., -Xmx8G and -XX:MaxMetaspaceSize=4G) which can
break CI or low-RAM dev machines; change widgetbook/android/gradle.properties to
use conservative defaults (for example -Xmx2G and remove or lower
MaxMetaspaceSize/ReservedCodeCacheSize) and add a comment advising developers to
set higher values in their local ~/.gradle/gradle.properties if needed, ensuring
org.gradle.jvmargs remains overrideable by local gradle configuration.
In `@widgetbook/ios/Podfile`:
- Line 33: Replace the call to File.dirname(File.realpath(__FILE__)) used as the
argument to flutter_install_all_ios_pods with the Ruby built-in __dir__ to get
the current file directory; update the invocation of
flutter_install_all_ios_pods (the line containing flutter_install_all_ios_pods
and File.dirname(File.realpath(__FILE__))) so it passes __dir__ instead, keeping
the same behavior but following RuboCop's Style/Dir and more idiomatic Ruby.
In `@widgetbook/ios/Runner.xcodeproj/project.pbxproj`:
- Around line 474-475: The project file currently hard-codes DEVELOPMENT_TEAM =
NQ6ZND3746 in the Runner build configurations; remove that literal team ID from
the Runner build configs and either (a) delete the DEVELOPMENT_TEAM entries from
project.pbxproj so signing is resolved via each developer's/user .xcconfig or
CI, or (b) replace the literal with a placeholder/variable (e.g.
DEVELOPMENT_TEAM = $(DEVELOPMENT_TEAM)) and add the real value in a
user-specific .xcconfig or CI build settings; make the same change for every
Runner build config where DEVELOPMENT_TEAM appears.
In `@widgetbook/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md`:
- Around line 1-5: Add a single trailing newline to the Markdown file README.md
in LaunchImage.imageset to satisfy markdownlint rule MD047; simply open the
README.md and ensure the file ends with a newline character (no other content
changes).
In `@widgetbook/lib/main.directories.g.dart`:
- Around line 13-14: The generated import
package:sloth_widgetbook/stories/colors.dart fails because the root pubspec.yaml
is missing a path dependency for the local package named sloth_widgetbook; fix
this by adding sloth_widgetbook as a dependency that points to the widgetbook
directory (i.e., under dependencies add sloth_widgetbook with path: widgetbook)
so the import in main.directories.g.dart can be resolved by the generator.
In `@widgetbook/lib/stories/colors.dart`:
- Around line 200-224: The build fails because SemanticColors is missing the
getters borderInfo, borderSuccess, and borderWarning which are referenced by
light.borderInfo, light.borderSuccess, and light.borderWarning in the
_ColorPairItem instances inside colors.dart; fix it by either adding these
getters to the SemanticColors class (in lib/theme.dart) with the correct return
type (e.g., Color) and sensible default/derived values, or remove/comment out
the three _ColorPairItem blocks (semanticName 'Border Info', 'Border Success',
'Border Warning') in widgetbook/lib/stories/colors.dart so the code no longer
references the non-existent properties.
In `@widgetbook/macos/Podfile`:
- Around line 29-36: Replace the long path expression used when invoking
flutter_install_all_macos_pods in the Runner target: locate the call
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) and replace
the File.dirname(File.realpath(__FILE__)) argument with the Ruby idiom __dir__
to simplify path resolution while preserving behavior.
In `@widgetbook/macos/Runner/Configs/AppInfo.xcconfig`:
- Around line 8-12: Replace the placeholder bundle identifier in the macOS app
config: update the PRODUCT_BUNDLE_IDENTIFIER value (currently
"com.example.slothWidgetbook") to your app's real reverse‑DNS identifier that
matches your team/app ID and provisioning profile; ensure PRODUCT_NAME
(sloth_widgetbook) and signing settings remain consistent with the new bundle
identifier to avoid provisioning/signing collisions.
In `@widgetbook/pubspec.yaml`:
- Around line 5-7: The environment SDK constraints in the pubspec's environment
block are incompatible with the specified Flutter version; update the Dart SDK
constraint under the environment keys (sdk: ...) to match Flutter 3.38.4+ by
changing the Dart constraint to ^3.10.0 (or alternatively downgrade the flutter
constraint to a 3.35.x series if you must stay on Dart 3.9.2) so the sdk and
flutter entries are consistent.
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:sloth/hooks/use_message_menu.dart'; | ||
| import '../test_helpers.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Check if the use_message_menu.dart hook exists
fd "use_message_menu.dart" lib/Repository: marmot-protocol/sloth
Length of output: 47
🏁 Script executed:
# Also explore the hooks directory structure
git ls-files lib/hooks/Repository: marmot-protocol/sloth
Length of output: 492
🏁 Script executed:
# Verify the test file exists
git ls-files test/hooks/ | grep use_message_menuRepository: marmot-protocol/sloth
Length of output: 102
🏁 Script executed:
# Search for any references to useMessageMenu or use_message_menu in the codebase
rg "use_message_menu|useMessageMenu" --type dartRepository: marmot-protocol/sloth
Length of output: 739
🏁 Script executed:
# Read the test file to understand what hook API is expected
cat test/hooks/use_message_menu_test.dartRepository: marmot-protocol/sloth
Length of output: 1844
🏁 Script executed:
# Check if there are any recent commits or changes related to message menu
git log --oneline --all -- "*message_menu*" | head -20Repository: marmot-protocol/sloth
Length of output: 200
🏁 Script executed:
# Search for any implementation related to message menu, emoji picker, etc.
rg "showEmojiPicker|toggleEmojiPicker|closeEmojiPicker" --type dartRepository: marmot-protocol/sloth
Length of output: 1837
🏁 Script executed:
# Check if there are any message or menu related widgets/files
fd -e dart | xargs rg "message.*menu|menu.*message" -l --type dart | head -20Repository: marmot-protocol/sloth
Length of output: 205
🏁 Script executed:
# Check the wn_message_menu_test.dart to see if it provides context
cat test/widgets/wn_message_menu_test.dartRepository: marmot-protocol/sloth
Length of output: 13183
🏁 Script executed:
# Check chat_screen.dart to see if it references the hook
rg "use_message_menu|useMessageMenu" lib/screens/chat_screen.dartRepository: marmot-protocol/sloth
Length of output: 47
Missing hook implementation—tests cannot run.
The test file imports package:sloth/hooks/use_message_menu.dart, which does not exist in lib/hooks/. Create the hook implementation with methods toggleEmojiPicker() and closeEmojiPicker(), and a property showEmojiPicker, or remove these tests until the hook is implemented.
🧰 Tools
🪛 GitHub Actions: CI
[error] 2-2: Target of URI doesn't exist: 'package:sloth/hooks/use_message_menu.dart'
🤖 Prompt for AI Agents
In `@test/hooks/use_message_menu_test.dart` around lines 1 - 3, Tests import
use_message_menu.dart but the hook implementation is missing; create
lib/hooks/use_message_menu.dart and implement the exported symbols
toggleEmojiPicker(), closeEmojiPicker(), and the showEmojiPicker property (e.g.,
as a boolean state exposed by the hook) so tests can run; ensure the hook
initializes showEmojiPicker to false, toggles its value in toggleEmojiPicker(),
and sets it false in closeEmojiPicker(), and export the hook API with the exact
names used in the tests (toggleEmojiPicker, closeEmojiPicker, showEmojiPicker).
| rules: | ||
| # avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
| # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider enabling additional lint rules per repository guidelines.
Based on learnings, the repository enforces prefer_const_constructors and prefer_final_locals lint rules for Dart/Flutter code. Consider explicitly enabling these rules to maintain consistency with the main project's coding standards.
♻️ Suggested addition
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+ prefer_const_constructors: true
+ prefer_final_locals: true📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| rules: | |
| # avoid_print: false # Uncomment to disable the `avoid_print` rule | |
| # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | |
| rules: | |
| # avoid_print: false # Uncomment to disable the `avoid_print` rule | |
| # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | |
| prefer_const_constructors: true | |
| prefer_final_locals: true |
🤖 Prompt for AI Agents
In `@widgetbook/analysis_options.yaml` around lines 23 - 25, The lint rules block
in analysis_options.yaml is missing repository-standard rules; add explicit
entries for prefer_const_constructors and prefer_final_locals under the existing
rules: set prefer_const_constructors: true and prefer_final_locals: true so the
analyzer enforces these Dart/Flutter conventions consistently with the main
project (modify the rules mapping shown in the file where the commented rules
live).
| <application | ||
| android:label="sloth_widgetbook" | ||
| android:name="${applicationName}" | ||
| android:icon="@mipmap/ic_launcher"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a string resource for the app label.
Hardcoded labels hinder localization and reuse; prefer @string/app_name and define it in res/values/strings.xml.
💡 Proposed fix
- <application
- android:label="sloth_widgetbook"
+ <application
+ android:label="@string/app_name"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <application | |
| android:label="sloth_widgetbook" | |
| android:name="${applicationName}" | |
| android:icon="@mipmap/ic_launcher"> | |
| <application | |
| android:label="@string/app_name" | |
| android:name="${applicationName}" | |
| android:icon="@mipmap/ic_launcher"> |
🤖 Prompt for AI Agents
In `@widgetbook/android/app/src/main/AndroidManifest.xml` around lines 2 - 5,
Replace the hardcoded android:label in the <application> tag with a string
resource reference (use android:label="@string/app_name") and add the
corresponding app_name entry in res/values/strings.xml; update the manifest's
android:label attribute (android:label="@string/app_name") and create or modify
strings.xml to include <string name="app_name">YourAppName</string> so the label
is localizable and reusable.
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | ||
| android.useAndroidX=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid repo-wide 8G/4G Gradle defaults.
These JVM settings can prevent Gradle from starting on CI or dev machines with <8 GB RAM. Prefer conservative defaults and allow local overrides (e.g., ~/.gradle/gradle.properties).
🔧 Proposed adjustment
-org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
+org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true🤖 Prompt for AI Agents
In `@widgetbook/android/gradle.properties` around lines 1 - 2, The repo-wide
gradle JVM settings in org.gradle.jvmargs currently force high memory (e.g.,
-Xmx8G and -XX:MaxMetaspaceSize=4G) which can break CI or low-RAM dev machines;
change widgetbook/android/gradle.properties to use conservative defaults (for
example -Xmx2G and remove or lower MaxMetaspaceSize/ReservedCodeCacheSize) and
add a comment advising developers to set higher values in their local
~/.gradle/gradle.properties if needed, ensuring org.gradle.jvmargs remains
overrideable by local gradle configuration.
| target 'Runner' do | ||
| use_frameworks! | ||
|
|
||
| flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🌐 Web query:
RuboCop Style/Dir Ruby __dir__ guidance
💡 Result:
RuboCop’s Style/Dir cop enforces using Ruby’s __dir__ instead of more complex ways of getting “the directory of the current file” (typically File.dirname(__FILE__) wrapped in File.expand_path, File.realpath, etc.). It’s enabled by default and applies when targeting Ruby 2.0+. [1]
What to do
- Replace patterns like:
with:
File.expand_path(File.dirname(__FILE__)) # or File.dirname(File.realpath(__FILE__))
because__dir____dir__already provides an absolute (canonicalized) path to the current file’s directory. [1][2]
Common “good” usage
File.join(__dir__, "data", "config.yml")If you can’t use __dir__
If your project targets Ruby < 2.0, you’ll need to disable the cop (or raise your TargetRubyVersion). [1]
Sources: RuboCop cop docs for Style/Dir. [1][2]
🌐 Web query:
Ruby __dir__ vs File.dirname File.realpath __FILE__ equivalent
💡 Result:
In Ruby (>= 2.0), __dir__ is the direct equivalent of:
File.dirname(File.realpath(__FILE__))It returns the canonicalized absolute directory of the file where it’s called (i.e., symlinks are resolved), and Ruby’s docs explicitly state the equivalence to File.dirname(File.realpath(__FILE__)). [1]
How the common options differ
-
File.dirname(__FILE__)
Returns the directory name of whatever string__FILE__contains—often relative (e.g."."), depending on how the file was loaded/invoked. [2] -
File.expand_path(File.dirname(__FILE__))
Gives an absolute path, but does not inherently resolve symlinks the wayrealpathdoes (it expands, but doesn’t “dereference” symlinks). [3] -
File.dirname(File.realpath(__FILE__))/__dir__
Gives an absolute, symlink-resolved directory, but noteFile.realpathrequires the path’s components to exist. [1][4]
Practical recommendation
Use __dir__ when you want a stable “directory of this source file” (especially when symlinks may be involved). [1][3]
Sources: [1] [2] [3] [4]
🌐 Web query:
Podfile Ruby version support __dir__
💡 Result:
__dir__ is available starting in Ruby 2.0.0 (it was added as Kernel#__dir__).[1]
So a Podfile can use __dir__ as long as CocoaPods is running on Ruby >= 2.0—and in practice it’s almost always safe because CocoaPods has required newer Rubies for years (e.g., CocoaPods 1.11 raised the minimum Ruby to 2.6).[2] On many modern installs, you may effectively need Ruby >= 2.7.4 due to current CocoaPods dependencies like cocoapods-downloader.[3]
If you must support older Ruby (< 2.0), use:
File.expand_path(File.dirname(__FILE__))Sources: [1] [2] [3]
Prefer __dir__ for current directory resolution.
This aligns with RuboCop's Style/Dir cop and provides the same functionality as File.dirname(File.realpath(__FILE__)) with cleaner, more idiomatic syntax.
♻️ Proposed change
- flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+ flutter_install_all_ios_pods __dir__📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | |
| flutter_install_all_ios_pods __dir__ |
🧰 Tools
🪛 RuboCop (1.82.1)
[convention] 33-33: Use __dir__ to get an absolute path to the current file's directory.
(Style/Dir)
🤖 Prompt for AI Agents
In `@widgetbook/ios/Podfile` at line 33, Replace the call to
File.dirname(File.realpath(__FILE__)) used as the argument to
flutter_install_all_ios_pods with the Ruby built-in __dir__ to get the current
file directory; update the invocation of flutter_install_all_ios_pods (the line
containing flutter_install_all_ios_pods and
File.dirname(File.realpath(__FILE__))) so it passes __dir__ instead, keeping the
same behavior but following RuboCop's Style/Dir and more idiomatic Ruby.
| import 'package:sloth_widgetbook/stories/colors.dart' | ||
| as _sloth_widgetbook_stories_colors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the package name in widgetbook/pubspec.yaml
echo "=== Package name in pubspec.yaml ==="
if [ -f "widgetbook/pubspec.yaml" ]; then
grep -E "^name:" widgetbook/pubspec.yaml
else
echo "widgetbook/pubspec.yaml not found"
fi
echo ""
echo "=== Directory structure of widgetbook/lib ==="
if [ -d "widgetbook/lib" ]; then
find widgetbook/lib -type f -name "*.dart" | head -20
else
echo "widgetbook/lib directory not found"
fi
echo ""
echo "=== Searching for colors.dart ==="
fd -t f "colors.dart" widgetbook/ 2>/dev/null || find widgetbook -name "colors.dart" 2>/dev/null
echo ""
echo "=== Checking for stories directory ==="
fd -t d "stories" widgetbook/ 2>/dev/null || find widgetbook -type d -name "stories" 2>/dev/null
echo ""
echo "=== Main project root files ==="
ls -la | grep -E "pubspec|\.yaml"Repository: marmot-protocol/sloth
Length of output: 852
🏁 Script executed:
#!/bin/bash
echo "=== Root pubspec.yaml dependencies section ==="
grep -A 50 "^dependencies:" pubspec.yaml | head -60
echo ""
echo "=== Check for widgetbook in dependencies ==="
grep -E "widgetbook|sloth_widgetbook" pubspec.yaml
echo ""
echo "=== Checking main.directories.g.dart imports ==="
head -20 widgetbook/lib/main.directories.g.dartRepository: marmot-protocol/sloth
Length of output: 2501
Add sloth_widgetbook as a path dependency to the root pubspec.yaml.
The generated import package:sloth_widgetbook/stories/colors.dart fails because the local widgetbook/ package is not configured as a dependency. While widgetbook/pubspec.yaml correctly defines name: sloth_widgetbook and stories/colors.dart exists, the root pubspec.yaml must list it as a path dependency:
dependencies:
sloth_widgetbook:
path: widgetbookThis generated file cannot be modified directly, but adding this dependency will allow the generator to correctly resolve the import path.
🧰 Tools
🪛 GitHub Actions: CI
[error] 13-13: Target of URI doesn't exist: 'package:sloth_widgetbook/stories/colors.dart'
🤖 Prompt for AI Agents
In `@widgetbook/lib/main.directories.g.dart` around lines 13 - 14, The generated
import package:sloth_widgetbook/stories/colors.dart fails because the root
pubspec.yaml is missing a path dependency for the local package named
sloth_widgetbook; fix this by adding sloth_widgetbook as a dependency that
points to the widgetbook directory (i.e., under dependencies add
sloth_widgetbook with path: widgetbook) so the import in main.directories.g.dart
can be resolved by the generator.
| // Info | ||
| _ColorPairItem( | ||
| semanticName: 'Border Info', | ||
| lightColor: light.borderInfo, | ||
| darkColor: dark.borderInfo, | ||
| ), | ||
| // Success | ||
| _ColorPairItem( | ||
| semanticName: 'Border Success', | ||
| lightColor: light.borderSuccess, | ||
| darkColor: dark.borderSuccess, | ||
| ), | ||
| // Warning | ||
| _ColorPairItem( | ||
| semanticName: 'Border Warning', | ||
| lightColor: light.borderWarning, | ||
| darkColor: dark.borderWarning, | ||
| ), | ||
| // Shadow | ||
| _ColorPairItem( | ||
| semanticName: 'Shadow', | ||
| lightColor: light.shadow, | ||
| darkColor: dark.shadow, | ||
| ), | ||
| ]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build failure: Missing getters on SemanticColors.
The pipeline reports that borderInfo, borderSuccess, and borderWarning getters are not defined on SemanticColors. This causes compilation errors.
Either add these properties to the SemanticColors class in lib/theme.dart, or remove/comment out these color pair items until the theme is updated.
🐛 Proposed fix to remove non-existent properties
// Intention
_buildPairSection('Intention', [
// Error
_ColorPairItem(
semanticName: 'Fill Destructive',
lightColor: light.fillDestructive,
darkColor: dark.fillDestructive,
),
_ColorPairItem(
semanticName: 'Fill Destructive Hover',
lightColor: light.fillDestructiveHover,
darkColor: dark.fillDestructiveHover,
),
_ColorPairItem(
semanticName: 'Fill Destructive Active',
lightColor: light.fillDestructiveActive,
darkColor: dark.fillDestructiveActive,
),
- // Info
- _ColorPairItem(
- semanticName: 'Border Info',
- lightColor: light.borderInfo,
- darkColor: dark.borderInfo,
- ),
- // Success
- _ColorPairItem(
- semanticName: 'Border Success',
- lightColor: light.borderSuccess,
- darkColor: dark.borderSuccess,
- ),
- // Warning
- _ColorPairItem(
- semanticName: 'Border Warning',
- lightColor: light.borderWarning,
- darkColor: dark.borderWarning,
- ),
// Shadow
_ColorPairItem(
semanticName: 'Shadow',
lightColor: light.shadow,
darkColor: dark.shadow,
),
]),🧰 Tools
🪛 GitHub Actions: CI
[error] 203-203: The getter 'borderInfo' isn't defined for the type 'SemanticColors'
[error] 204-204: The getter 'borderInfo' isn't defined for the type 'SemanticColors'
[error] 209-209: The getter 'borderSuccess' isn't defined for the type 'SemanticColors'
[error] 210-210: The getter 'borderSuccess' isn't defined for the type 'SemanticColors'
[error] 215-215: The getter 'borderWarning' isn't defined for the type 'SemanticColors'
[error] 216-216: The getter 'borderWarning' isn't defined for the type 'SemanticColors'
🤖 Prompt for AI Agents
In `@widgetbook/lib/stories/colors.dart` around lines 200 - 224, The build fails
because SemanticColors is missing the getters borderInfo, borderSuccess, and
borderWarning which are referenced by light.borderInfo, light.borderSuccess, and
light.borderWarning in the _ColorPairItem instances inside colors.dart; fix it
by either adding these getters to the SemanticColors class (in lib/theme.dart)
with the correct return type (e.g., Color) and sensible default/derived values,
or remove/comment out the three _ColorPairItem blocks (semanticName 'Border
Info', 'Border Success', 'Border Warning') in widgetbook/lib/stories/colors.dart
so the code no longer references the non-existent properties.
| target 'Runner' do | ||
| use_frameworks! | ||
|
|
||
| flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) | ||
| target 'RunnerTests' do | ||
| inherit! :search_paths | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider using __dir__ for cleaner path resolution.
The static analysis suggests replacing File.dirname(File.realpath(__FILE__)) with __dir__ for a more idiomatic Ruby approach.
♻️ Proposed fix
target 'Runner' do
use_frameworks!
- flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
+ flutter_install_all_macos_pods __dir__
target 'RunnerTests' do
inherit! :search_paths
end
endNote: This matches Flutter's default template, so keeping as-is is also acceptable for consistency with generated code.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| target 'Runner' do | |
| use_frameworks! | |
| flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) | |
| target 'RunnerTests' do | |
| inherit! :search_paths | |
| end | |
| end | |
| target 'Runner' do | |
| use_frameworks! | |
| flutter_install_all_macos_pods __dir__ | |
| target 'RunnerTests' do | |
| inherit! :search_paths | |
| end | |
| end |
🧰 Tools
🪛 RuboCop (1.82.1)
[convention] 32-32: Use __dir__ to get an absolute path to the current file's directory.
(Style/Dir)
🤖 Prompt for AI Agents
In `@widgetbook/macos/Podfile` around lines 29 - 36, Replace the long path
expression used when invoking flutter_install_all_macos_pods in the Runner
target: locate the call flutter_install_all_macos_pods
File.dirname(File.realpath(__FILE__)) and replace the
File.dirname(File.realpath(__FILE__)) argument with the Ruby idiom __dir__ to
simplify path resolution while preserving behavior.
| PRODUCT_NAME = sloth_widgetbook | ||
|
|
||
| // The application's bundle identifier | ||
| PRODUCT_BUNDLE_IDENTIFIER = com.example.slothWidgetbook | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the placeholder bundle identifier before distribution.
com.example.slothWidgetbook is the template default and can cause signing/provisioning mismatches or collisions if this app is installed alongside other builds. Please set a real reverse‑DNS identifier aligned with your team/app ID.
🤖 Prompt for AI Agents
In `@widgetbook/macos/Runner/Configs/AppInfo.xcconfig` around lines 8 - 12,
Replace the placeholder bundle identifier in the macOS app config: update the
PRODUCT_BUNDLE_IDENTIFIER value (currently "com.example.slothWidgetbook") to
your app's real reverse‑DNS identifier that matches your team/app ID and
provisioning profile; ensure PRODUCT_NAME (sloth_widgetbook) and signing
settings remain consistent with the new bundle identifier to avoid
provisioning/signing collisions.
| environment: | ||
| sdk: ^3.9.2 | ||
| flutter: ">=3.38.4 <4.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Check if Flutter 3.38.4 and Dart 3.9.2 are real versions by searching for release information
python3 << 'EOF'
import json
import urllib.request
import urllib.error
# Try to get Flutter releases
try:
with urllib.request.urlopen('https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json', timeout=5) as response:
data = json.loads(response.read().decode())
releases = data.get('releases', [])
# Find specific versions
version_3_38 = [r for r in releases if r.get('version', '').startswith('3.38')]
version_3_27 = [r for r in releases if r.get('version', '').startswith('3.27')]
version_3_9 = [r for r in releases if r.get('dart_sdk_version', '').startswith('3.9')]
print("=== Flutter 3.38.x releases ===")
for r in version_3_38[:3]:
print(f" Version: {r.get('version')}, Dart: {r.get('dart_sdk_version')}, Date: {r.get('release_date')}")
print("\n=== Flutter 3.27.x releases ===")
for r in version_3_27[:3]:
print(f" Version: {r.get('version')}, Dart: {r.get('dart_sdk_version')}, Date: {r.get('release_date')}")
print("\n=== Latest releases (Dart 3.9.x) ===")
for r in version_3_9[:3]:
print(f" Version: {r.get('version')}, Dart: {r.get('dart_sdk_version')}, Date: {r.get('release_date')}")
# Get overall latest
if releases:
latest = releases[0]
print(f"\n=== Latest release ===")
print(f" Flutter: {latest.get('version')}, Dart: {latest.get('dart_sdk_version')}, Date: {latest.get('release_date')}")
except Exception as e:
print(f"Error fetching Flutter releases: {e}")
EOFRepository: marmot-protocol/sloth
Length of output: 225
🌐 Web query:
Flutter SDK version 3.38.4 release date Dart 3.9.2
💡 Result:
- Flutter SDK 3.38.4 (stable hotfix) was released on December 5, 2025. [1]
- Flutter 3.38.4 includes Dart 3.10.3 (not Dart 3.9.2). [2]
- If you meant the Flutter stable line that ships with Dart 3.9.2, that corresponds to Flutter 3.35.x (for example, Flutter 3.35.4, released September 17, 2025). [3]
- The Dart 3.9 line was released on August 13, 2025 (Dart 3.9.2 is a patch within that line). [4]
Sources: [1] [2] [3] [4]
Fix incompatible SDK version constraints.
The Flutter and Dart SDK constraints are incompatible. Flutter 3.38.4 ships with Dart 3.10.3, not Dart 3.9.2. Either use Flutter 3.35.x with Dart 3.9.2 (if 3.35 compatibility is needed), or update the Dart constraint to ^3.10.0 to match Flutter 3.38.4+.
🤖 Prompt for AI Agents
In `@widgetbook/pubspec.yaml` around lines 5 - 7, The environment SDK constraints
in the pubspec's environment block are incompatible with the specified Flutter
version; update the Dart SDK constraint under the environment keys (sdk: ...) to
match Flutter 3.38.4+ by changing the Dart constraint to ^3.10.0 (or
alternatively downgrade the flutter constraint to a 3.35.x series if you must
stay on Dart 3.9.2) so the sdk and flutter entries are consistent.
Description
Setup widget book with colors story
Screen.Recording.2026-01-23.at.5.29.01.PM.mov
Type of Change
Checklist
just precommitto ensure that formatting and linting are correctCHANGELOG.mdfile with your changes (if they affect the user experience)Summary by CodeRabbit
Release Notes
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.