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
theme: ThemeData( | |
primaryColor: Color(0xFF56D4F9), | |
) |
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
https://gist.github.com/AliAnilKocak/65b5caf3d9b5e5da193cda5664d8eee5.js |
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
MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Programming Quotes', | |
theme: ThemeData( | |
primaryColor: Color(0xFF56D4F9), | |
), | |
home: HomePage(), | |
); |
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
void _openFullMaterialColorPicker() async { | |
_openDialog( | |
"Renk seç", | |
MaterialColorPicker( | |
colors: materialColors, | |
), | |
); | |
} | |
void _openDialog(String title, Widget content) { |
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
GestureDetector( | |
onTap: () { | |
_openFullMaterialColorPicker(); | |
}, | |
child: Text( | |
"Tema Değiştir", | |
style: TextStyle(fontSize: 12, color: Colors.white), | |
), | |
), |
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
class ThemeNotifier with ChangeNotifier { | |
Color _themeData; | |
ThemeNotifier(this._themeData); | |
getColor() => _themeData; | |
setColor(Color themeData) async { | |
_themeData = themeData; | |
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
runApp( | |
ChangeNotifierProvider<ThemeNotifier>( | |
create: (_) => ThemeNotifier(Color(0xFF56D4F9)), //Default renk | |
child: MyApp(), | |
), | |
); |
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
final themeColor = Provider.of<ThemeNotifier>(context); |
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
onColorChange: (color) { | |
setState(() { | |
themeColor.setColor(color); | |
}); | |
}, |
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
onColorChange: (color){ | |
themeColor.setColor(color); | |
}, |
OlderNewer