Flutter ਦਾ theming ਸਿਸਟਮ ਤੁਹਾਨੂੰ consistent visual styling (ਰੰਗ, fonts, component styles) ਨੂੰ ਪੂਰੀ app ਵਿੱਚ define ਕਰਨ ਦਿੰਦਾ ਹੈ, light/dark themes ਲਈ support ਦੇ ਨਾਲ। Styling ਨੂੰ themes ਦੁਆਰਾ centralize ਕਰਨ ਨਾਲ consistency ਯਕੀਨੀ ਬਣਦੀ ਹੈ ਅਤੇ apps ਨੂੰ restyle ਕਰਨਾ ਆਸਾਨ ਬਣਾਉਂਦਾ ਹੈ।
Theme ਨੂੰ Define ਕਰਨਾ
// 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)
)
