request_api_helper 2.0.4 copy "request_api_helper: ^2.0.4" to clipboard
request_api_helper: ^2.0.4 copied to clipboard

outdated

http, shared_preferences helper for Lavarel and other.

request_api_helper #

1.Setting inside main #

Env(
confurl: 'https://url/api/',
confnoapiurl: 'https://url/',
confclientId: 'client id laravel',
confclientsecret: 'client secret laravel',
confgrantType: 'password',
).save();

set login first

Auth(username: 'your username',password:'your password', exception:false).login()

2.how to use Get / Post http? #

dynamic response = await Post(
name: (route after /api/),
body: {
'example' : 'this example',
},
logResponse: true/false (to see response processed),
exception : true/false (show exception Error),
).request();

optional customUrl, example = 'https://example.com/api/custom/request/v1' [full url needed].
optional customHeader.

3.how to save / load shared_preference? #

Session().save('name','FDhunter');
Session().save('number',12390123);
Session().save('login',true);

note : name session must be different.

String name = await Session().load('name');
int number = await Session().load('number');
bool loginState = await Session().load('login');

6
likes
0
pub points
29%
popularity

Publisher

unverified uploader

http, shared_preferences helper for Lavarel and other.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, fluttertoast, http, shared_preferences

More

Packages that depend on request_api_helper