Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @override
- void initState() {
- super.initState();
- new Timer(new Duration(milliseconds: 200), () {
- checkFirstSeen();
- });
- }
- Future checkFirstSeen() async {
- SharedPreferences prefs = await SharedPreferences.getInstance();
- bool _seen = (prefs.getBool('seen') ?? false);
- if (_seen) {
- Navigator.of(context).pushReplacement(
- new MaterialPageRoute(builder: (context) => new MyAppState()));
- } else {
- prefs.setBool('seen', true);
- Navigator.of(context).pushReplacement(
- new MaterialPageRoute(builder: (context) => new AskPermissions()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement