Conversation
… app version registration
…sion satisfaction check
Feature/version
…orts in stac_registry.dart and stac.dart
Feature/flutter35
|
lstonussi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe PR extends the STAC framework with build number tracking and version/platform-based widget gating. It introduces a new version management system with conditional operators, adds custom color parser injection, updates theme parsers to use newer Flutter widget data types, and includes comprehensive tests for the version system. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant Stac as Stac Framework
participant Registry as StacRegistry
participant Parser as Widget Parser
participant VersionCheck as Version Validator
rect rgb(200, 240, 220)
Note over App,Registry: Initialization Phase
App->>Stac: initialize(buildNumber: 42)
Stac->>Registry: registerBuildNumber(42)
Registry->>Registry: store _buildNumber
Stac->>Stac: setParseCustomColor(customFn)
Stac->>Registry: parseCustomColor = customFn
end
rect rgb(220, 240, 260)
Note over Parser,VersionCheck: Runtime Widget Parsing Phase
App->>Stac: fromJson(widgetConfig)
Stac->>Stac: extract version constraints
alt version && buildNumber constraints present
Stac->>VersionCheck: isSatisfied(buildNumber: 42)
VersionCheck->>VersionCheck: evaluate condition
alt condition NOT satisfied
VersionCheck-->>Stac: constraint failed
Stac->>Stac: log warning, return null
else condition satisfied
VersionCheck-->>Stac: constraint passed
end
end
alt platform constraint present
Stac->>Stac: check current platform
alt platform mismatch
Stac->>Stac: log warning, return null
end
end
Stac->>Parser: continue parsing
Parser->>Parser: parse widget properties
alt custom color needed
Parser->>Registry: parseCustomColor?.call(colorStr)
Registry-->>Parser: custom Color or null
end
Parser-->>App: return parsed Widget
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (13)
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 |
Description
Implemented new platform-specific widgets functionality in the Stac framework. It's now possible to specify on which platforms a widget should be rendered through the
platformproperty in JSON.Features:
platformproperty: Can be a single string or a list of stringsnulland logs an informative messageandroid,fuchsia,ios,linux,macos,windowsUsage examples:
Multiple platforms:
{ "platform": ["android", "ios"], "type": "text", "data": "Widget only for mobile" }Single platform:
{ "platform": "android", "type": "text", "data": "Widget only for Android" }Behavior:
nulland logs:Related Issues
Closes #
Type of Change
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.