Skip to content

Instantly share code, notes, and snippets.

@anilcancakir
Created March 5, 2018 21:44
Show Gist options
  • Select an option

  • Save anilcancakir/68e97872dc3a119b176288232050085a to your computer and use it in GitHub Desktop.

Select an option

Save anilcancakir/68e97872dc3a119b176288232050085a to your computer and use it in GitHub Desktop.
How to use dynamic home page in Flutter? - AuthService
import 'dart:async';
import 'dart:math';
class AuthService {
// Login
Future<bool> login() async {
// Simulate a future for response after 2 second.
return await new Future<bool>.delayed(
new Duration(
seconds: 2
), () => new Random().nextBool()
);
}
// Logout
Future<void> logout() async {
// Simulate a future for response after 1 second.
return await new Future<void>.delayed(
new Duration(
seconds: 1
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment