This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SignIn { | |
final String email; | |
final String password; | |
SignIn({ | |
required this.email, | |
required this.password, | |
}); | |
} | |
class RenewAccessToken { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:tutorial_flutter_minimalist_authentication/exceptions/access_token_exception.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/models/account/renew_access_token.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/models/account/sign_in.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/models/api/business_error.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/models/session/authentication_data.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/repositories/api/account_repository.dart'; | |
class FakeAccountAPIRepository implements AccountRepository { | |
final _fakeAuthData = AuthenticationData( | |
accessToken: "fakeAccessToken", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/routes/routes.dart'; | |
class LandingPage extends StatelessWidget { | |
const LandingPage({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text("Landing page")), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Routes { | |
static const String landingPageRoute = "/"; | |
static const String signInPageRoute = "/sign-in"; | |
static const String profilePageRoute = "/profile"; | |
static Route<dynamic> generateRoute(RouteSettings settings) { | |
switch (settings.name) { | |
case signInPageRoute: | |
{ | |
return CupertinoPageRoute( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class UnprotectedProfilePage extends StatelessWidget { | |
const UnprotectedProfilePage({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Profile Page"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/models/account/sign_in.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/widgets/sign_in_form.dart'; | |
class SignInPage extends StatelessWidget { | |
const SignInPage({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart';; | |
import 'package:tutorial_flutter_minimalist_authentication/routes/routes.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthenticationData { | |
final String id; | |
final String accessToken; | |
final String refreshToken; | |
AuthenticationData({ | |
required this.accessToken, | |
required this.refreshToken, | |
required this.id, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RenewAccessToken { | |
String refreshToken; | |
RenewAccessToken({ | |
required this.refreshToken, | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SignIn { | |
final String email; | |
final String password; | |
SignIn({ | |
required this.email, | |
required this.password, | |
}); | |
} |