Line data Source code
1 : part of apptive_grid_network; 2 : 3 : /// Model for authentication options 4 : class ApptiveGridAuthenticationOptions { 5 : /// Creates Authentication Object 6 : /// [autoAuthenticate] determines if the auth process is started automatically. Defaults to false 7 21 : const ApptiveGridAuthenticationOptions({ 8 : this.autoAuthenticate = false, 9 : this.redirectScheme, 10 : this.apiKey, 11 : this.persistCredentials = false, 12 : }); 13 : 14 : /// Determines whether or not the authentication process should be started automatically or not 15 : final bool autoAuthenticate; 16 : 17 : /// If the Authentication is happening in an external Browser add your custom Redirect URI Scheme so the User gets redirected to the App 18 : /// 19 : /// Remember that you might need to add some native configurations so your app knows how to handle the redirect. 20 : /// For more Info check out https://pub.dev/packages/uni_links 21 : final String? redirectScheme; 22 : 23 : /// [ApptiveGridApiKey] for authentication with an Api Key 24 : /// 25 : /// If this is not null it will be used instead of trying to authenticate using openid auth 26 : final ApptiveGridApiKey? apiKey; 27 : 28 : /// Determines whether or not credentials are saved across sessions. 29 : /// Internally this uses [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) 30 : final bool persistCredentials; 31 : 32 2 : @override 33 : String toString() { 34 10 : return 'ApptiveGridAuthenticationOptions(autoAuthenticate: $autoAuthenticate, redirectScheme: $redirectScheme, apiKey: $apiKey, authenticationStorage: $persistCredentials)'; 35 : } 36 : 37 3 : @override 38 : bool operator ==(Object other) { 39 3 : return other is ApptiveGridAuthenticationOptions && 40 9 : autoAuthenticate == other.autoAuthenticate && 41 9 : redirectScheme == other.redirectScheme && 42 9 : apiKey == other.apiKey && 43 9 : persistCredentials == other.persistCredentials; 44 : } 45 : 46 1 : @override 47 2 : int get hashCode => toString().hashCode; 48 : } 49 : 50 : /// Model to Handle Api Key Authentication 51 : class ApptiveGridApiKey { 52 : /// Creates a ApptiveGridApiKey Model 53 : /// 54 : /// You will get these values if you create a new ApiKey in your Profile in the ApptiveGrid App 55 2 : const ApptiveGridApiKey({ 56 : required this.authKey, 57 : required this.password, 58 : }); 59 : 60 : /// Auth Key of the ApiKey 61 : final String authKey; 62 : 63 : /// Password of the ApiKey 64 : final String password; 65 : 66 1 : @override 67 : String toString() { 68 3 : return 'ApptiveGridApiKey(authKey: $authKey, password: $password)'; 69 : } 70 : 71 1 : @override 72 : bool operator ==(Object other) { 73 1 : return other is ApptiveGridApiKey && 74 3 : authKey == other.authKey && 75 3 : password == other.password; 76 : } 77 : 78 1 : @override 79 2 : int get hashCode => toString().hashCode; 80 : }