Flutter-ის თემატიკის სისტემა საშუალებას გაძლევთ განსაზღვროთ თანმიმდევრული ვიზუალური სტილიზაცია (ფერი, შრიფტი, კომპონენტის სტილი) მთელი აპლიკაციის მასშტابით, ღია/მუქი თემების მხარდაჭერით. სტილიზაციის ცენტრალიზაცია თემების მეშვეობით უზრუნველყოფს თანმიმდევრობას და აპლიკაციის ხელახალი სტილიზაციას გამარტივებს.
თემის განსაზღვრა
// 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)
)
