Penjelasan Kode Tema Gelap Aplikasi To-Do-List
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Jarvis Todo',
debugShowCheckedModeBanner: false,
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: const Color(0xFF121212),
colorScheme: const ColorScheme.dark(
primary: Colors.white,
secondary: Colors.grey,
background: Color(0xFF121212),
),
textTheme: const TextTheme(
bodyMedium: TextStyle(color: Colors.white70),
),
),
home: const TodoHome(),
);
}
}
๐ Penjelasan cepat:
MaterialApp → kerangka utama aplikasi Flutter-nya.
title → judul app (muncul di task manager).
debugShowCheckedModeBanner: false → ngilangin tulisan debug di pojok.
ThemeData.dark().copyWith(...) → ngatur tema gelap (dark mode) biar tampilannya elegan.
scaffoldBackgroundColor → warna latar belakang utama (hitam gelap).
colorScheme → ngatur warna utama, sekunder, dan background.
textTheme → warna teksnya (putih agak redup).
home: const TodoHome() → halaman pertama yang muncul (class TodoHome).
๐ค Intinya, kode ini ngebuat app To-Do List dengan tema dark minimalis modern.

terimakasih banyak atas postingan Review Aplikasi Flutter, sangat bermanfaat
BalasHapus