Repository navigation
Proposal: a simple MaterialInkController widget #147392
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Imagine if _Padding and _Container were private classes, and there was only one way to add padding:
AnimatedContainer(
duration: Duration.zero,
padding: const EdgeInsets.only(top: 5),
child: widget.child,
)☹️
I made a fun little theme-picker widget that looks really cool, but the implementation gives me the same gross feeling as the animated container from above.
class _ThemePickerState extends State<ThemePicker> with SingleTickerProviderStateMixin {
late final controller = AnimationController(vsync: this);
Widget _builder(context, child) {
return Material(
color: _color,
animationDuration: Duration.zero,
borderRadius: BorderRadius.all(_radiusFrom(controller.value)),
child: _inkWell,
);
}
}I had a look through material.dart. Unfortunately, many components in the Material build method are private, so for now it's a package deal.
Proposal
There should be a public class that builds a stripped-down (yet fully functional) Material.
Widget _builder(context, child) {
return ClipRRect(
borderRadius: BorderRadius.all(_radiusFrom(controller.value)),
child: ColoredBox(
color: _color,
child: BlankMaterial(child: _inkWell),
),
);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team

Activity
[-]Proposal: super-efficient `Material`[/-][+]Proposal to make `Material` class more public[/+][-]Proposal to make `Material` class more public[/-][+]Proposal: a simple `MaterialInkController` widget[/+]