forked from CCExtractor/firebase_editor_gsoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCExtractor#7 Add Dark Mode Support to Firebase Editor App
- Loading branch information
1 parent
4b51912
commit 8a56754
Showing
9 changed files
with
303 additions
and
162 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"flutter":{"platforms":{"android":{"default":{"projectId":"gsoc-24-3f4d1","appId":"1:211384953661:android:14233d29467afa30317354","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"gsoc-24-3f4d1","configurations":{"android":"1:211384953661:android:14233d29467afa30317354","ios":"1:211384953661:ios:007f4e6da5f618ea317354"}}}}}} | ||
{"flutter":{"platforms":{"android":{"default":{"projectId":"arya-30631","appId":"1:124506192389:android:3b5d15df5a5c4ce2c33a6c","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"arya-30631","configurations":{"android":"1:124506192389:android:3b5d15df5a5c4ce2c33a6c","ios":"1:124506192389:ios:41bf9826de2537b9c33a6c","macos":"1:124506192389:ios:41bf9826de2537b9c33a6c","web":"1:124506192389:web:7fcd937cc1553229c33a6c","windows":"1:124506192389:web:17314a34483c0f39c33a6c"}}}}}} |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ThemeProvider with ChangeNotifier { | ||
bool _isDarkMode = false; | ||
bool get isDarkMode => _isDarkMode; | ||
|
||
/// Controls whether the app shows the light or dark theme | ||
ThemeMode get currentTheme => _isDarkMode ? ThemeMode.dark : ThemeMode.light; | ||
|
||
/// Define your light theme | ||
ThemeData get lightTheme => ThemeData( | ||
brightness: Brightness.light, | ||
// Using a color scheme, app bar theme, and text theme suitable for light mode | ||
colorScheme: const ColorScheme.light( | ||
primary: Colors.blue, | ||
background: Colors.white, | ||
onBackground: Colors.black, | ||
), | ||
appBarTheme: const AppBarTheme( | ||
backgroundColor: Colors.blue, | ||
foregroundColor: Colors.white, | ||
), | ||
textTheme: const TextTheme( | ||
bodyMedium: TextStyle(color: Colors.black), | ||
headlineMedium: TextStyle( | ||
color: Colors.black87, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
); | ||
|
||
/// Define your dark theme | ||
ThemeData get darkTheme => ThemeData( | ||
brightness: Brightness.dark, | ||
// Using a color scheme, app bar theme, and text theme suitable for dark mode | ||
colorScheme: ColorScheme.dark( | ||
primary: Colors.blueGrey, | ||
background: Colors.grey.shade900, | ||
onBackground: Colors.white, | ||
), | ||
appBarTheme: AppBarTheme( | ||
backgroundColor: Colors.grey.shade900, | ||
foregroundColor: Colors.white, | ||
), | ||
textTheme: const TextTheme( | ||
bodyMedium: TextStyle(color: Colors.white), | ||
headlineMedium: TextStyle( | ||
color: Colors.white, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
); | ||
|
||
/// Toggles between light and dark | ||
void toggleTheme() { | ||
_isDarkMode = !_isDarkMode; | ||
notifyListeners(); // Notifies that the theme changed | ||
} | ||
} |
Oops, something went wrong.