Skip to content

Instantly share code, notes, and snippets.

View dhruvilp's full-sized avatar
💭
👨‍💻 working on something really cool

Dhruvil Patel dhruvilp

💭
👨‍💻 working on something really cool
View GitHub Profile
@mkiisoft
mkiisoft / login_example.dart
Last active February 7, 2020 01:07
Correct way to keep a login state of users and do the expected routing. Flutter - Dart (Flutter NYC Meetup)
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart'; // pubspec.yaml shared_preferences: any
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final backend = await Backend.init();
runApp(DemoApp(backend: backend));
}
class Backend extends ChangeNotifier {