A storefy application with flutter
storefy flutter application
File architecture ( important only ) :
-
lib\services\authServices.dart
This file contains all functionality associated with authentication like
login
–reset password
–verify token
–store tokens and information of the user
– etc. -
lib\services\dio.dart
This file contains configuration for dio package.
dio
is a powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading and more. -
lib\routes.dart
This file contains all routes of the application.
-
lib\constants.dart
This file contains all constants of the application like colors and error messages and more.
Libraries associated with application :
- dio : for handling http requests and responses.
- flutter_svg : which allows painting and displaying Scalable Vector Graphics(svg).
- Provider : is a state management of our application.
- flutter_secure_storage : for handling and storing tokens and user information.
- url_launcher : Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.
Code Details :
- when use your android phone in development mode,You face some issues when you want to connect to your laravel backend.
- you need to connect your phone and your mobile in same network.
- launch laravel server with host mode.
- you can read more for more : stackoverflow
- add provider (state management) in your application (red arrow) .
- read the documentation : read now
NOTE : read comments in screenshot
Application screenshot :
login :
if information is not valid ??:
if information is valid :
forget password :
if email is not valid ??:
if email is valid ??:
logout :
-
when click on
log Out
delete local storage token.
redirect to start screen.
login automatically :
happens when we close application and token is valid.