-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* theme changing * changes in about section * all the things working perfectly * issue 1 and 2 are solved * issue 4 of switch solved * theme part is all completed , everything working fine
- Loading branch information
1 parent
de8c57b
commit e6620c1
Showing
8 changed files
with
89 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:hashcode/custom/custom_colors.dart'; | ||
import 'package:hashcode/screens/home.dart'; | ||
import 'package:hashcode/theme.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
void main() { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
runApp(MyApp()); | ||
} | ||
|
||
class MyApp extends StatelessWidget { | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith( | ||
statusBarColor: Colors.black, //set status bar color | ||
)); | ||
return ChangeNotifierProvider<ThemeChanger>( | ||
builder: (context)=> ThemeChanger(ThemeData.dark()), | ||
child: HashCodeApp() | ||
); | ||
} | ||
} | ||
|
||
|
||
class HashCodeApp extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Provider.of<ThemeChanger>(context); | ||
return MaterialApp( | ||
theme: ThemeData(accentColor: customDarkBlack), | ||
debugShowCheckedModeBanner: true, | ||
title: 'HashCode App', | ||
home: Home(), | ||
theme: theme.getTheme(), | ||
); | ||
} | ||
} | ||
|
||
|
||
|
||
|
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
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
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,18 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class ThemeChanger with ChangeNotifier { | ||
ThemeData _themeData; | ||
bool isLightTheme = false; | ||
ThemeChanger(this._themeData); | ||
|
||
getTheme() => _themeData; | ||
setTheme(ThemeData theme) { | ||
if (theme == ThemeData.dark()) | ||
isLightTheme = false; | ||
else | ||
isLightTheme = true; | ||
_themeData = theme; | ||
notifyListeners(); | ||
} | ||
} |
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