Flutter کا theming سسٹم آپ کو app-wide مستقل visual styling (colors، fonts، component styles) کی تعریف کرنے دیتا ہے، light/dark themes کی support کے ساتھ۔ themes کے ذریعے styling کو مرکزی بنانا مستقل مزاجی کو یقینی بناتا ہے اور ایپس کو دوبارہ style کرنا آسان بناتا ہے۔
ایک theme کی تعریف
// 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)
)
