This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Screen title'), | |
leading: _buildProfileIconButton(), | |
), | |
body: /* Main contents */ | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
final ThemeData simpleLightTheme = | |
ThemeData.from(colorScheme: const ColorScheme.light()); | |
final ThemeData simpleDarkTheme = | |
ThemeData.from(colorScheme: const ColorScheme.dark()); | |
ThemeData get makoGreenTheme { | |
const primaryColor = Color(0xFF68D4C7); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; | |
import 'theme_data.dart'; | |
// If you change the order, the order in which it is displayed also changes | |
enum ExThemeMode { | |
system, | |
light, | |
dark, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'ex_theme_mode.dart'; | |
class ThemeModeNotifier extends ChangeNotifier { | |
ThemeModeNotifier({@required int id}) | |
: current = ExThemeMode.values | |
.firstWhere((e) => e.id == id, orElse: () => ExThemeMode.system); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'app.dart'; | |
import 'util/theme/theme_mode_notifier.dart'; | |
Future main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
final prefs = await SharedPreferences.getInstance(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'home_page.dart'; | |
import 'util/theme/theme_mode_notifier.dart'; | |
class App extends StatelessWidget { | |
const App(); | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'ex_theme_mode.dart'; | |
import 'theme_mode_notifier.dart'; | |
class ThemeListView extends StatelessWidget { | |
const ThemeListView(); | |
@override |