defaultRadius property
Border radius used on all widgets when FlexColorScheme use its FlexSubThemesData to configure sub-themes with FlexSubThemes.
These widgets will get their container shape border radius from defaultRadius if it is defined:
- BottomSheet
- Card
- Chip
- Dialog
- Drawer
- DropdownMenu
- ElevatedButton
- FloatingActionButton
- InputDecoration
- MenuAnchor
- OutlinedButton
- PopupMenuButton
- SegmentedButton
- TextButton
- ToggleButtons
- TimePickerDialog
- Older deprecated buttons using
ButtonThemeData
For clarity the following small, or element roundings are not affect by defaultRadius value, but may be set via own themes or properties.
- Indicator on NavigationBar, but can be set via navigationBarIndicatorRadius.
- Indicator on NavigationDrawer, but can be set via drawerIndicatorRadius.
- Indicator on NavigationRail, can be set via navigationRailIndicatorRadius.
- Border radius on MenuBar container, can be set via menuBarRadius.
- Tooltip container shape.
- Rounding on scrollbar edges.
Defaults to null, M3 defaults are used per widget.
When it is null, the sub-themes will use their null default behavior that follow the Material 3 standard for widgets it includes.
When you set defaultRadius to a value, it will override the defaults with this global default. You can still set and lock each individual border radius back for individual widget sub-themes to some specific value, or set it back to its Material 3 standard.
Flutter M2 SDK general border radius is 4, as defined by the Material 2 design guide. Material 3 uses much higher border radius, and it varies by UI component type. You can find the specifications here.
Implementation
final double? defaultRadius;