SfDataPagerThemeData constructor Null safety
- {Brightness? brightness,
- Color? backgroundColor,
- Color? itemColor,
- TextStyle? itemTextStyle,
- Color? selectedItemColor,
- TextStyle? selectedItemTextStyle,
- Color? disabledItemColor,
- TextStyle? disabledItemTextStyle,
- Color? itemBorderColor,
- double? itemBorderWidth,
- BorderRadiusGeometry? itemBorderRadius}
Create a SfDataPagerThemeData that's used to configure a SfDataPagerTheme.
Implementation
factory SfDataPagerThemeData(
{Brightness? brightness,
Color? backgroundColor,
Color? itemColor,
TextStyle? itemTextStyle,
Color? selectedItemColor,
TextStyle? selectedItemTextStyle,
Color? disabledItemColor,
TextStyle? disabledItemTextStyle,
Color? itemBorderColor,
double? itemBorderWidth,
BorderRadiusGeometry? itemBorderRadius}) {
brightness = brightness ?? Brightness.light;
final bool isLight = brightness == Brightness.light;
backgroundColor ??= isLight
? const Color.fromRGBO(255, 255, 255, 1)
: const Color.fromRGBO(33, 33, 33, 1);
itemColor ??= isLight
? const Color.fromRGBO(255, 255, 255, 1)
: const Color.fromRGBO(33, 33, 33, 1);
itemTextStyle ??= TextStyle(
color: isLight
? const Color.fromRGBO(0, 0, 0, 0.87)
: const Color.fromRGBO(255, 255, 255, 1),
fontSize: 14,
fontFamily: 'Roboto',
fontWeight: FontWeight.w400);
itemBorderRadius ??= BorderRadius.circular(50);
itemBorderColor ??= Colors.transparent;
selectedItemColor ??= const Color.fromRGBO(33, 150, 243, 1);
selectedItemTextStyle ??= const TextStyle(
color: Color.fromRGBO(255, 255, 255, 1),
fontSize: 14,
fontFamily: 'Roboto',
fontWeight: FontWeight.w400);
disabledItemColor ??= Colors.transparent;
disabledItemTextStyle ??= TextStyle(
color: isLight
? const Color.fromRGBO(0, 0, 0, 0.36)
: const Color.fromRGBO(255, 255, 255, 0.36));
return SfDataPagerThemeData.raw(
brightness: brightness,
backgroundColor: backgroundColor,
itemColor: itemColor,
itemTextStyle: itemTextStyle,
selectedItemColor: selectedItemColor,
selectedItemTextStyle: selectedItemTextStyle,
disabledItemColor: disabledItemColor,
disabledItemTextStyle: disabledItemTextStyle,
itemBorderColor: itemBorderColor,
itemBorderWidth: itemBorderWidth,
itemBorderRadius: itemBorderRadius);
}