Reputation: 20444
I am trying to extend the color scheme used by my first app. I created a separate file that contains the following:
import 'package:flutter/cupertino.dart';
class Testy extends CupertinoThemeData {
final Color bgws = Color.fromRGBO(120, 120, 120, 1);
}
I then imported it into Main.Dart but cannot see how to use my new color. I thought Testy.bgws
would do it but clearly I am missing something.
Upvotes: 1
Views: 942
Reputation: 852
You can use default textTheme
without Cupertino
like
final ThemeData appThemeLight = ThemeData(
/// theme
brightness: Brightness.light,
/// screen
primaryColor: Colors.blue,
/// brightness color
accentColor: Colors.white,
/// opacity color
hintColor: Colors.grey,
/// here you can add cupertino
cupertinoOverrideTheme: CupertinoThemeData(
primaryColor: Colors.black,
),
....
and use it Theme.of(context)...
also don't forget add appThemeLight
to MaterialApp
like theme: appThemeLight
Upvotes: 1