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
//Add this | |
import 'package:json_annotation/json_annotation.dart'; | |
//Add this | |
part 'authentication_data.g.dart'; | |
//Add this | |
@JsonSerializable() | |
class AuthenticationData { | |
final String id; | |
final String accessToken; |
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
//Add this | |
import 'package:json_annotation/json_annotation.dart'; | |
//Add this | |
part 'renew_access_token.g.dart'; | |
//Add this | |
@JsonSerializable() | |
class RenewAccessToken { | |
String refreshToken; | |
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
//Add this | |
import 'package:json_annotation/json_annotation.dart'; | |
//Add this | |
part 'sign_in.g.dart'; | |
//Add this | |
@JsonSerializable() | |
class SignIn { | |
final String email; | |
final String password; |
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
name: tutorial_flutter_minimalist_authentication | |
description: A new Flutter project. | |
# The following line prevents the package from being accidentally published to | |
# pub.dev using `flutter pub publish`. This is preferred for private packages. | |
publish_to: 'none' # Remove this line if you wish to publish to pub.dev | |
# The following defines the version and build number for your application. | |
# A version number is three numbers separated by dots, like 1.2.43 | |
# followed by an optional build number separated by a +. |
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
//Todo use your own URL/DNS here | |
const accountAPIURL_v1 = "http://192.168.68.111:5000/api/v1/account/"; |
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:flutter_bloc/flutter_bloc.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/cubit/user_authentication_cubit.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/repositories/api/account_api_repository.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/routes/routes.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} |
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 'dart:io'; | |
import 'package:dio/dio.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/constants/constants.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/exceptions/access_token_exception.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/exceptions/business_exception.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/exceptions/refresh_token_exception.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/models/account/sign_in.dart'; |
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/cubit/user_authentication_cubit.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/pages/sign_in_page.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/widgets/protected_widget.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
class UserProfilePage extends StatelessWidget { | |
const UserProfilePage({Key? key}) : super(key: key); | |
@override |
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/cubit/user_authentication_cubit.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/pages/sign_in_page.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/widgets/protected_widget.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
class UserProfilePage extends StatelessWidget { | |
const UserProfilePage({Key? key}) : super(key: key); | |
@override |
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/cubit/user_authentication_cubit.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/models/account/sign_in.dart'; | |
import 'package:tutorial_flutter_minimalist_authentication/widgets/sign_in_form.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
class SignInPage extends StatelessWidget { | |
const SignInPage({Key? key}) : super(key: key); | |
@override |