Skip to content

Instantly share code, notes, and snippets.

@SupremeDeity
Last active July 11, 2020 13:39
Show Gist options
  • Save SupremeDeity/78677dc95bf35c9f8736c4795fd4857a to your computer and use it in GitHub Desktop.
Save SupremeDeity/78677dc95bf35c9f8736c4795fd4857a to your computer and use it in GitHub Desktop.
var info = {
"C++": {'Level 1': Level1Index(), 'Level 2': Level2Index()},
};
class IndexManager extends StatelessWidget {
final String language;
final String level;
IndexManager(this.language, this.level);
Future<bool> _onWillPop(context) {
Navigator.pop(context);
return Future.value(true);
}
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () => _onWillPop(context),
child: MaterialApp(
home: Scaffold(
body: info[language][level],
),
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment