This file contains hidden or 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
import 'package:json_annotation/json_annotation.dart'; | |
part 'oauth_id_token.g.dart'; | |
@JsonSerializable() | |
class OAuthIdToken { | |
OAuthIdToken({ | |
required this.iss, | |
required this.sub, | |
required this.aud, | |
required this.iat, |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'package:mobile/auth/services/auth_service.dart'; | |
class LoginScreen extends StatefulWidget { | |
const LoginScreen({ | |
super.key, | |
required this.onSuccess, | |
required this.onLoading, | |
required this.onFail, | |
}); |
This file contains hidden or 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
import 'dart:convert'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter_appauth/flutter_appauth.dart'; | |
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; | |
import 'package:mobile/utils/constants.dart'; | |
import 'package:mobile/auth/models/oauth_id_token.dart'; | |
import 'package:bugsnag_flutter/bugsnag_flutter.dart'; | |
class AuthService { | |
static final AuthService instance = AuthService._internal(); |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'package:mobile/auth/screens/login_screen.dart'; | |
import 'package:mobile/auth/services/auth_service.dart'; | |
import 'package:mobile/common_widgets/list_query_result.dart'; | |
class AuthProvider extends StatefulWidget { | |
const AuthProvider({super.key, required this.child}); | |
final Widget child; | |
@override | |
State<AuthProvider> createState() => _AuthProviderState(); |
This file contains hidden or 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
// ignore_for_file: constant_identifier_names | |
const OAUTH_DOMAIN = String.fromEnvironment('OAUTH_DOMAIN'); | |
const OAUTH_CLIENT_ID = String.fromEnvironment('OAUTH_CLIENT_ID'); | |
const OAUTH_ISSUER = | |
'http${const String.fromEnvironment('BUGSNAG_RELEASE_STAGE') == "development" ? '' : 's'}://$OAUTH_DOMAIN'; | |
const BUNDLE_IDENTIFIER = 'cloud.nexl.mobile'; | |
const OAUTH_REDIRECT_URI = '$BUNDLE_IDENTIFIER://login-callback'; | |
const REFRESH_TOKEN_KEY = 'refresh_token'; |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:mobile/task/widgets/task_list_item.dart'; | |
import 'task_list_item_factory.dart'; | |
import '../../test_widget_wrapper.dart'; | |
void main() { | |
final taskListItemFactory = TaskListItemFactory(); | |
group("TaskListItem", () { |
This file contains hidden or 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
import 'package:mobile/__generated__/graphql_types.graphql.dart'; | |
import 'package:faker/faker.dart'; | |
class TaskListItemFactory { | |
TaskListItemMixin build({ | |
String? id, | |
String? title, | |
String? descriptionPlainText, | |
String? dueOn, | |
String? completedAt, |
This file contains hidden or 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
import 'package:intl/intl.dart'; | |
final dateTimeFormatter = DateFormat('yyyy-MM-ddTHH:mm:ssZ'); | |
// ISO8601DateTime | |
DateTime fromGraphQLISO8601DateTimeToDartDateTime(String dateTime) => | |
DateTime.parse(dateTime); | |
DateTime? fromGraphQLISO8601DateTimeNullableToDartDateTimeNullable( | |
String? dateTime) => | |
dateTime == null ? null : DateTime.parse(dateTime); |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'package:mobile/__generated__/graphql_types.graphql.dart'; | |
import 'package:mobile/contact/utils/contact_display_name.dart'; | |
import 'package:mobile/employee/utils/employee_display_name.dart'; | |
import 'package:mobile/task/widgets/task_due_on.dart'; | |
class TaskListItem extends StatelessWidget { | |
const TaskListItem( | |
{super.key, required this.task, required this.currentUserEmail}); | |
final TaskListItemMixin task; |
This file contains hidden or 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
fragment ContactName on Contact { | |
id | |
primaryEmail | |
info { | |
firstName | |
lastName | |
} | |
} |
NewerOlder