-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: 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),
),
);
}Nicoeevee and FMorschel
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 Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
