getForegroundColor method Null safety

MaterialStateProperty<Color?>? getForegroundColor(
  1. BuildContext context
)

Implementation

MaterialStateProperty<Color?>? getForegroundColor(BuildContext context) {
  return MaterialStateProperty.resolveWith(
    (states) =>
        textStyle?.color ??
        _getMaterialStyle(context)?.foregroundColor?.resolve(states),
  );
}