I m trying to use text style using abstract function like this
import 'dart:ui';
abstract class AppStyles {
TextStyle getNameStyle() {
return TextStyle(
fontSize: 40.0,
);
}
}
this style I m trying to access like this
const Text(
'Welcome to Flutter app',
style: AppStyles.getNameStyle(),
),
Refer to this example also
Declaring a Styles file in Flutter
But its says this error
