-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
57 lines (51 loc) · 1.35 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import 'dart:developer';
import 'package:asan_login_flutter/asan_login_flutter.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'ASAN Login Example',
home: AsanLoginDemoScreen(),
);
}
}
class AsanLoginDemoScreen extends StatelessWidget {
const AsanLoginDemoScreen({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('ASAN Login Flutter'),
backgroundColor: Colors.blueGrey.shade900,
),
body: 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');
},
),
);
}
}