Tugann córas téamáil Flutter deis duit stíliú amhairc comhsheasmhach (dathanna, clófhir, stíleanna comhpháirte) a shainiú ar fud an app, le tacaíocht do théamaí soilsithe/dorcha. Trí stíliú a ionadaitheoiriú trí théamaí, áirítear comhsheasmhacht agus déantar app a athrá-stíliú go héasca.
Téama a shainiú
// define the app's theme in MaterialApp
MaterialApp(
theme: ThemeData( // LIGHT theme
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
textTheme: TextTheme(/* font styles */),
elevatedButtonTheme: /* button styling */,
useMaterial3: true,
),
darkTheme: ThemeData.dark(), // DARK theme
themeMode: ThemeMode.system, // follow the system setting (or .light/.dark)
)
