storefy flutter application

File architecture ( important only ) :

  • lib\services\authServices.dart

    This file contains all functionality associated with authentication like loginreset passwordverify tokenstore 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 :

  • lib\services\dio.dart
    Screenshot of  dio.dart file

  • 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.

  • lib\main.dart
    screenshot of main file code

  • add provider (state management) in your application (red arrow) .

  • lib\screens\sign_in\components\sign_form.dart
    Screenshot 2021-11-02 194254

    Screenshot 2021-11-02 194721

  • lib\screens\forget_password\components\sign_form.dart

    Screenshot 2021-11-02 195412

  • lib\screens\splash\components\body.dart

    Screenshot 2021-11-03 101004

NOTE : read comments in screenshot

Application screenshot :

login :

if information is not valid 👇🏼:

Screenshot_20211103-101714

if information is valid :

Screenshot_20211103-103209

forget password :

if email is not valid 👇🏼:

Screenshot_20211103-103918

if email is  valid 👇🏼:

Screenshot_20211103-101730

logout :

Screenshot_20211103-103220

  • when click on log Out

    delete local storage token.

    redirect to start screen.

login automatically :

happens when we close application and token is valid.

Screenshot_20211103-103235

GitHub

View Github