-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from nimblehq/release/0.2.0
[Release] 0.2.0
- Loading branch information
Showing
42 changed files
with
869 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
SECRET= | ||
REST_API_ENDPOINT= | ||
CLIENT_ID= | ||
CLIENT_SECRET= |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: 632d6ac0b577d6e268ff7a13a105bbc4f7941989 | ||
|
||
COCOAPODS: 1.12.0 | ||
COCOAPODS: 1.12.1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:survey_flutter/model/request/login_request.dart'; | ||
import 'package:survey_flutter/model/response/login_response.dart'; | ||
import 'package:retrofit/retrofit.dart'; | ||
|
||
part 'authentication_api_service.g.dart'; | ||
|
||
@RestApi() | ||
abstract class AuthenticationApiService { | ||
factory AuthenticationApiService(Dio dio, {String baseUrl}) = | ||
_AuthenticationApiService; | ||
|
||
@POST('/oauth/token') | ||
Future<LoginResponse> login( | ||
@Body() LoginRequest body, | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:japx/japx.dart'; | ||
|
||
class ResponseDecoder { | ||
static Map<String, dynamic> decode(Map<String, dynamic> json) { | ||
return Japx.decode(json)['data']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"hello": "Hello!" | ||
"emailInputHint": "Email", | ||
"passwordInputHint": "Password", | ||
"loginButton": "Log in", | ||
"invalidEmailError": "Please enter the valid email format.", | ||
"invalidPasswordError": "Password must be at least 8 characters long." | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:equatable/equatable.dart'; | ||
|
||
class LoginModel extends Equatable { | ||
final String id; | ||
final String accessToken; | ||
final double expiresIn; | ||
final String refreshToken; | ||
|
||
const LoginModel({ | ||
required this.id, | ||
required this.accessToken, | ||
required this.expiresIn, | ||
required this.refreshToken, | ||
}); | ||
|
||
@override | ||
List<Object?> get props => [ | ||
id, | ||
accessToken, | ||
expiresIn, | ||
refreshToken, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'login_request.g.dart'; | ||
|
||
@JsonSerializable() | ||
class LoginRequest { | ||
final String grantType; | ||
final String email; | ||
final String password; | ||
final String clientId; | ||
final String clientSecret; | ||
|
||
LoginRequest({ | ||
required this.grantType, | ||
required this.email, | ||
required this.password, | ||
required this.clientId, | ||
required this.clientSecret, | ||
}); | ||
|
||
Map<String, dynamic> toJson() => _$LoginRequestToJson(this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:survey_flutter/api/response_decoder.dart'; | ||
import 'package:survey_flutter/model/login_model.dart'; | ||
|
||
part 'login_response.g.dart'; | ||
|
||
@JsonSerializable() | ||
class LoginResponse { | ||
final String id; | ||
final String accessToken; | ||
final String tokenType; | ||
final double expiresIn; | ||
final String refreshToken; | ||
final int createdAt; | ||
|
||
LoginResponse({ | ||
required this.id, | ||
required this.accessToken, | ||
required this.tokenType, | ||
required this.expiresIn, | ||
required this.refreshToken, | ||
required this.createdAt, | ||
}); | ||
|
||
factory LoginResponse.fromJson(Map<String, dynamic> json) => | ||
_$LoginResponseFromJson(ResponseDecoder.decode(json)); | ||
|
||
LoginModel toLoginModel() => LoginModel( | ||
id: id, | ||
accessToken: accessToken, | ||
expiresIn: expiresIn, | ||
refreshToken: refreshToken, | ||
); | ||
|
||
static LoginResponse dummy() { | ||
return LoginResponse( | ||
id: "", | ||
accessToken: "", | ||
tokenType: "", | ||
expiresIn: 0, | ||
refreshToken: "", | ||
createdAt: 0, | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.