Created
March 29, 2022 15:06
-
-
Save chaudharydeepanshu/2b72868b9ed93401e3d899745683fb21 to your computer and use it in GitHub Desktop.
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 MyHomePage extends StatefulWidget { | |
const MyHomePage({Key? key, this.themeMode, this.onThemeMode}) | |
: super(key: key); | |
final ThemeMode? themeMode; // | |
final ValueChanged<ThemeMode>? onThemeMode; // | |
@override | |
State<MyHomePage> createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text("Title"), | |
), // This trailing comma makes auto-formatting nicer for build methods. | |
drawer: CustomDrawer( | |
themeMode: widget.themeMode, | |
onThemeMode: (ThemeMode value) { | |
widget.onThemeMode?.call(value); | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment