Flutter user authentication with back-end handler

Overview

user_auth

Dart - Backend user auth helpe, with common methods

Pub Example

Show some ❤️ and star the repo

Fork Star Watch

usage

  • import package:user_auth/user_auth.dart.
  • create instance from UserAuth.
  • init with apiBaseUrl and other parameters.

methods

  • login : waits for user in response to return.
  • check : waits for user in response to return.
  • logout : return true | false.
  • loadUser : return user if stored in prefs.
  • register : waits for user in response to return.

example

import 'package:user_auth/user_auth.dart';

// instance
UserAuth user = new UserAuth();

// init
SharedPreferences prefs = await SharedPreferences.getInstance();
  await user.init(
    apiBaseUrl: 'https://example.com/api',
    store: true,
    prefs: prefs, // need if store: true
    loginUrl: "/user/login",
    registerUrl: "/user/register",
    checkUrl: "/user/details",
    logoutUrl: "/user/logout",
  );

// Note : change 'Bearer ' and api_token with your own parameters

// login
var activeUser = loadedUser = await user.login(
                    usernameVar: 'email',
                    usernameVal: '[email protected]',
                    password: '12345678',
                  );

// check
var checkedUser = await user.check(
                    type: 'Bearer ',
                    token: activeUser['api_token'],
                  ); 

// logout
var logout = await user.logout(
                    type: 'Bearer ',
                    token: activeUser['api_token'],
                  );

// register
Map form = {
            "email" : "[email protected]",
            "phone" : "00000000",
            "name" : "mohamed sayed",
            "password" : "1234567",
            };
registeredUser = await user.register(form: form);

Project Created & Maintained By

Mohamed Sayed

Software Engineer | In ❤️ with Flutter

Donate

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of

Note : All Contibutions Are Welcomed

You might also like...

Build an End-to-End Typesafe APIs (Experimental)

mid ⚠️ warning: the project is still experimental! so things may change often until a stable version is released. mid is a tool to build an end-to-end

Oct 19, 2022

A chat💬 application📱 developed using Flutter and Firebase along with feature of user authentication👩🏼‍💻

Chitty-Chat A chat 💬 application 📱 developed using Flutter and Firebase along with feature of user authentication👩🏼‍💻. Along with it, it has the

Sep 26, 2022

A Note app built with flutter and integrate with Firebase for user authentication and backend database.

A Note app built with flutter and integrate with Firebase for user authentication and backend database.

Note App Note app (Both frontend and backend) created with Flutter and Firebase. Complete UI Contains Sign in & Sign up Home Screen Setting screen Acc

Dec 4, 2022

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI 1/2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Fl

Dec 6, 2022

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI #2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flu

Dec 15, 2022

Let's create a complete Flutter User Profile Page with SharedPreferences to persist the user's information in Flutter.

Let's create a complete Flutter User Profile Page with SharedPreferences to persist the user's information in Flutter.

Flutter Tutorial - User Profile & SharedPreferences Let's create a complete Flutter User Profile Page with SharedPreferences to persist the user's inf

Dec 3, 2022

A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Oct 21, 2022
Owner
Mohamed Sayed
Software Engineer | in love with flutter
Mohamed Sayed
Bwo-master - An infinity procedural online game using Flutter and flames with NodeJS and Firebase for the back-end

Borderless World Online (BWO) An infinity procedural online game using Flutter a

null 17 Nov 29, 2022
Bwo-master - An infinity procedural online game using Flutter and flames with NodeJS and Firebase for the back-end

Borderless World Online (BWO) An infinity procedural online game using Flutter a

null 0 Feb 2, 2022
Firebase Realtime Database as Back-end - Used in 'cart' and 'favourites' pages

food_delivery_app Firebase Realtime Database as Back-end - Used in 'cart' and 'f

Dogan 11 Oct 24, 2022
An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

network_requests An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio. Platform Supported

Coder_Manuel 3 Dec 15, 2022
End to end flutter series for zero to hero flutter devloper.( lang of videos is turkish)

flutter_full_learn A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Veli Bacik 191 Dec 24, 2022
Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment 🚀

A complete backend solution for your [Flutter / Vue / Angular / React / iOS / Android / *ANY OTHER*] app Appwrite 0.12 has been released! Learn what's

Appwrite 28.2k Jan 3, 2023
End-to-end mobile app templates that other developers can use during their Flutter development journey.

Flutter UI Templates Welcome Contributors ?? The Robotics Forum always encourages new ideas. Aim ?? Main aim of this repository is to make things fast

The Robotics Forum, VIT Pune 8 Dec 18, 2022
:end: A dart package to append either `&` or `and` at the end of a List.

And Game A dart package to append either & or and at the end of a List. Features Appends & or and at the end of the list. Available as method or exten

Tirth 2 Sep 24, 2021
Bhargav Reddy 10 Nov 12, 2022
The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS

The Mobile Applications Community 2 Apr 7, 2022