Skip to content

Instantly share code, notes, and snippets.

@chaudharydeepanshu
Created March 29, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaudharydeepanshu/2b72868b9ed93401e3d899745683fb21 to your computer and use it in GitHub Desktop.
Save chaudharydeepanshu/2b72868b9ed93401e3d899745683fb21 to your computer and use it in GitHub Desktop.
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