Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to login with Rest API using flutter dart

Tags:

rest

http-post

I have created a login form with email, password a login button. I am new to flutter dart and web.

I don't know how create login app using Rest API in flutter. I already have Login Rest API and its working fine on Postman using post request.

how to create login system in flutter using http post request?

like image 620
Junaid Durrani Avatar asked Dec 24 '22 02:12

Junaid Durrani


1 Answers

This example might be helpful:Flutter: Login App using REST API and SQFLite

Basically, what it does is:

  • Use dart's http package to send post/get requests, encapsulated in NetworkUtil class.
  • RestDataSource do the login() and return a User instance.
  • LoginScreenPresenter defines an interface for LoginScreen view and a presenter that incorporates all business logic specific to login screen itself.

  • The view LoginScreen contains the login form.

like image 157
Doradus Avatar answered Jan 13 '23 15:01

Doradus