Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cib-az/asan-login-flutter
đ Flutter plugin for implementing ASAN Login authentication.
https://github.com/cib-az/asan-login-flutter
azerbaijan dart flutter
Last synced: about 2 months ago
JSON representation
đ Flutter plugin for implementing ASAN Login authentication.
- Host: GitHub
- URL: https://github.com/cib-az/asan-login-flutter
- Owner: kamranbekirovyz
- License: bsd-3-clause
- Created: 2021-09-29T10:03:28.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T10:37:33.000Z (over 1 year ago)
- Last Synced: 2024-07-28T10:10:49.949Z (about 2 months ago)
- Topics: azerbaijan, dart, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/asan_login_flutter
- Size: 414 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# asan_login_flutter
`ASAN Login` community-maintained plugin-package for Flutter. The main responsibility of the package, as it is sufficient for mobile-side of the projects, is to extract `token` once the user is successfully logged in. The extracted `token`'s payload contains logged user's basic information. For advanced validation of user, please refer to `ASAN Login`'s documentation provided to you.
## đšī¸ Usage
```dart
Widget build(BuildContext context) {
return AsanLoginView(
config: const AsanLoginConfig(
mobileKeyAndroid: 'com.example.example',
mobileKeyIos: 'com.example.example',
environment: AsanLoginEnvironment.preProd,
clearCookies: true,
),
loadingWidgetBuilder: (double progress) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 80.0),
child: LinearProgressIndicator(
value: progress / 100,
),
);
},
onLogin: (String token) {
log('logged in with token: $token');
},
);
}
```#### mobileKeyAndroid, mobileKeyIos
The mobile key for platform (iOS, Android) under which your project is registered on `ASAN Login`.
#### loadingWidgetBuilder
A builder parameter for customizing loading animation, which is mainly visible until full loading of `ASAN Login` web page.
#### clearCookies
When `clearCookies` is set to `true` user stays as logged in if previously logged. When set to `false` (which is recommended to use as a configuration for most of the use cases of `ASAN Login`) user gets redirected to the login page of `ASAN Login` everytime.
#### environment
Defines environment for `ASAN Login`. For more info about the enivironments and their behaviors check documentation provided to you by `ASAN Login`
#### onLogin
Called when user successfully logs in, with `token` (`String`);
### Clearing cache
When user's session is terminated on the app (~logout), make sure to call clearAsanLoginCache() global method to make sure user's previous `ASAN Login` cache is cleared from app's cache.
See the example directory for a complete sample app.
## đ¤ Contributors
## đ Bugs/Requests
If you encounter any problems please open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and we'll look into it. Pull requests are welcome.
## đ License