-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Open
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Use case
As mentioned in #177415 (comment):
Divider | Can it just be removed? Or possibly we should create a RawDivider in Widgets if there is a real need.
- There are 12 places using
Dividermaterial widget in widget tests:
- Divider concept exists in both Material and iOS design specs/docs:
- Material: https://m3.material.io/components/divider/overview
- iOS design docs: https://developer.apple.com/documentation/SwiftUI/Divider
Proposal
We can go with one of these options:
- A. building a new RawDivider widget in widgets:
- Pros:
- the import will be neat and tidy. Maintainers will only need to import RawDivider widget in widgets and corresponding design libraries on either widget usage or test.
- allow other design systems to build their own divider based on RawDivider widget
- follow existing patterns as other widgets: RawAutocomplete/Autocomplete, RawRadio/Radio...
- Cons:
- Increase API maintenance cost (design docs needed?, documentation for itself and update Material one too, bug fixes and reviews, etc...)
- Does this seem to be over-engineering? As the current Divider widget is simply a sized Container with border and theming
- Pros:
- B. adding a helper widget or something like that in a utils file in
test/widgets- Pros:
- No risk and lower API maintenance cost: no need design docs, minimum documentation (only class and method docs are needed in new utils file in test directory only). If there are new issues introduced, the fix for them will be simpler than RawDivider widget
- Quickly solve the main goal of cleaning up cross-imports issue without getting sidetracked into other time-consuming tasks.
- The test helper can be modified or removed at any time without considering breaking changes like RawDivider widget
- Cons:
- The helper widget may duplicate the "drawing a line" logic in the test utils, which is already implemented in the Divider material widget.
- Pros:
Based on the above analysis, I lean towards option B, as it helps achieve the goal of cleaning up cross-imports effectively at a lower/minimal cost. cc @justinmc for thoughts. Regardless of which option is chosen, I assign myself to this work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Type
Projects
Status
In Progress
Status
In Progress