Skip to content

Commit d1b7a6f

Browse files
committed
chore: Formatted files and updated dependencies.
1 parent 2b99ee2 commit d1b7a6f

119 files changed

Lines changed: 3020 additions & 2926 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/main.dart

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@ Future<void> main() async {
4444
if (currentPlatform.isDesktop) {
4545
await windowManager.ensureInitialized();
4646
windowManager.waitUntilReadyToShow(
47-
const WindowOptions(
48-
title: App.appName,
49-
size: Size(800, 600),
50-
minimumSize: Size(400, 400),
51-
center: true,
52-
), () async {
53-
await windowManager.show();
54-
await windowManager.focus();
55-
});
47+
const WindowOptions(
48+
title: App.appName,
49+
size: Size(800, 600),
50+
minimumSize: Size(400, 400),
51+
center: true,
52+
),
53+
() async {
54+
await windowManager.show();
55+
await windowManager.focus();
56+
},
57+
);
5658
}
5759
if (isFirebaseSupported) {
5860
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
@@ -79,10 +81,10 @@ Future<void> main() async {
7981
class _OpenAuthenticatorSSSInitializationOptions extends InitializationOptions {
8082
/// Creates a new Open Authenticator SimpleSecureStorage initialization options.
8183
_OpenAuthenticatorSSSInitializationOptions()
82-
: super(
83-
appName: App.appName + (kDebugMode ? ' Debug' : ''),
84-
namespace: App.appPackageName + (kDebugMode ? '.debug' : ''),
85-
);
84+
: super(
85+
appName: App.appName + (kDebugMode ? ' Debug' : ''),
86+
namespace: App.appPackageName + (kDebugMode ? '.debug' : ''),
87+
);
8688
}
8789

8890
/// The main widget class.
@@ -105,25 +107,25 @@ class OpenAuthenticatorApp extends ConsumerWidget {
105107
Locale locale = TranslationProvider.of(context).flutterLocale;
106108
return switch (showIntro) {
107109
AsyncData(:bool value) => _createMaterialApp(
108-
showIntroState: 'data',
109-
theme: theme,
110-
locale: locale,
111-
initialRoute: value ? IntroPage.name : HomePage.name,
112-
),
110+
showIntroState: 'data',
111+
theme: theme,
112+
locale: locale,
113+
initialRoute: value ? IntroPage.name : HomePage.name,
114+
),
113115
AsyncError(:final error) => _createMaterialApp(
114-
showIntroState: 'error',
115-
theme: theme,
116-
locale: locale,
117-
home: Center(
118-
child: Text('Error : $error.'),
119-
),
116+
showIntroState: 'error',
117+
theme: theme,
118+
locale: locale,
119+
home: Center(
120+
child: Text('Error : $error.'),
120121
),
122+
),
121123
_ => _createMaterialApp(
122-
showIntroState: 'loading',
123-
theme: theme,
124-
locale: locale,
125-
home: const CenteredCircularProgressIndicator(),
126-
),
124+
showIntroState: 'loading',
125+
theme: theme,
126+
locale: locale,
127+
home: const CenteredCircularProgressIndicator(),
128+
),
127129
};
128130
}
129131

@@ -207,19 +209,19 @@ class OpenAuthenticatorApp extends ConsumerWidget {
207209
routes: home == null
208210
? {
209211
IntroPage.name: (_) => const _RouteWidget(
210-
child: IntroPage(),
211-
),
212+
child: IntroPage(),
213+
),
212214
HomePage.name: (_) => const _RouteWidget(
213-
listen: true,
214-
rateMyApp: true,
215-
child: HomePage(),
216-
),
215+
listen: true,
216+
rateMyApp: true,
217+
child: HomePage(),
218+
),
217219
ScanPage.name: (_) => const _RouteWidget(
218-
child: ScanPage(),
219-
),
220+
child: ScanPage(),
221+
),
220222
SettingsPage.name: (_) => const _RouteWidget(
221-
child: SettingsPage(),
222-
),
223+
child: SettingsPage(),
224+
),
223225
TotpPage.name: (context) {
224226
Map<String, dynamic>? arguments = ModalRoute.of(context)!.settings.arguments as Map<String, dynamic>?;
225227
return _RouteWidget(
@@ -230,8 +232,8 @@ class OpenAuthenticatorApp extends ConsumerWidget {
230232
);
231233
},
232234
ContributorPlanPaywallPage.name: (_) => const _RouteWidget(
233-
child: ContributorPlanPaywallPage(),
234-
),
235+
child: ContributorPlanPaywallPage(),
236+
),
235237
}
236238
: {},
237239
initialRoute: home == null ? initialRoute : null,
@@ -317,8 +319,8 @@ class _RouteWidgetState extends ConsumerState<_RouteWidget> {
317319

318320
@override
319321
Widget build(BuildContext context) => UnlockChallengeWidget(
320-
child: widget.child,
321-
);
322+
child: widget.child,
323+
);
322324

323325
/// Handles a login link.
324326
Future<void> handleLoginLink(Uri loginLink) async {

lib/model/app_unlock/method.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ enum AppLockState {
6060
unlocked,
6161

6262
/// If an unlock challenge has started.
63-
unlockChallengedStarted;
63+
unlockChallengedStarted,
6464
}
6565

6666
/// Will be used if the app cannot be unlocked.

lib/model/app_unlock/reason.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ enum UnlockReason {
1010
enable,
1111

1212
/// The user tries the unlock challenge for disabling the current method.
13-
disable;
14-
}
13+
disable,
14+
}

lib/model/app_unlock/state.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppLockStateNotifier extends AsyncNotifier<AppLockState> {
1515
@override
1616
FutureOr<AppLockState> build() async {
1717
AppUnlockMethod unlockMethod = await ref.watch(appUnlockMethodSettingsEntryProvider.future);
18-
return state.valueOrNull ?? unlockMethod.defaultAppLockState;
18+
return state.value ?? unlockMethod.defaultAppLockState;
1919
}
2020

2121
/// Tries to unlock the app.

lib/model/authentication/providers/apple.dart

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,34 @@ final appleAuthenticationStateProvider = NotifierProvider<FirebaseAuthentication
1616
class AppleAuthenticationProvider extends FallbackAuthenticationProvider<AppleSignIn> {
1717
/// Creates a new Apple authentication provider instance.
1818
const AppleAuthenticationProvider()
19-
: super(
20-
availablePlatforms: const [
21-
Platform.android,
22-
Platform.iOS,
23-
Platform.macOS,
24-
Platform.windows,
25-
],
26-
);
19+
: super(
20+
availablePlatforms: const [
21+
Platform.android,
22+
Platform.iOS,
23+
Platform.macOS,
24+
Platform.windows,
25+
],
26+
);
2727

2828
@override
2929
String get providerId => AppleAuthMethod.providerId;
3030

3131
@override
3232
AppleAuthMethod createDefaultAuthMethod({List<String> scopes = const []}) => AppleAuthMethod.defaultMethod(
33-
scopes: scopes,
34-
customParameters: {
35-
'locale': translations.$meta.locale.languageCode,
36-
},
37-
);
33+
scopes: scopes,
34+
customParameters: {
35+
'locale': translations.$meta.locale.languageCode,
36+
},
37+
);
3838

3939
@override
4040
AppleAuthMethod createRestAuthMethod(OAuth2Response response) => AppleAuthMethod.rest(
41-
idToken: response.idToken,
42-
nonce: response.nonce,
43-
);
41+
idToken: response.idToken,
42+
nonce: response.nonce,
43+
);
4444

4545
@override
4646
AppleSignIn createFallbackAuthProvider() => AppleSignIn(
47-
clientId: 'app.openauthenticator.service',
48-
);
47+
clientId: 'app.openauthenticator.service',
48+
);
4949
}

lib/model/authentication/providers/email_link.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ class EmailLinkAuthenticationProvider extends FirebaseAuthenticationProvider wit
116116

117117
/// Creates a new email link authentication provider instance.
118118
const EmailLinkAuthenticationProvider()
119-
: super(
120-
availablePlatforms: const [
121-
Platform.android,
122-
Platform.iOS,
123-
Platform.macOS,
124-
Platform.windows,
125-
],
126-
);
119+
: super(
120+
availablePlatforms: const [
121+
Platform.android,
122+
Platform.iOS,
123+
Platform.macOS,
124+
Platform.windows,
125+
],
126+
);
127127

128128
@override
129129
bool get showLoadingDialog => false;

lib/model/authentication/providers/github.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@ final githubAuthenticationStateProvider = NotifierProvider<FirebaseAuthenticatio
1616
class GithubAuthenticationProvider extends FallbackAuthenticationProvider<GithubSignIn> {
1717
/// Creates a new Github authentication provider instance.
1818
const GithubAuthenticationProvider()
19-
: super(
20-
availablePlatforms: const [
21-
Platform.android,
22-
Platform.iOS,
23-
Platform.windows,
24-
],
25-
);
19+
: super(
20+
availablePlatforms: const [
21+
Platform.android,
22+
Platform.iOS,
23+
Platform.windows,
24+
],
25+
);
2626

2727
@override
2828
String get providerId => GithubAuthMethod.providerId;
2929

3030
@override
3131
GithubAuthMethod createDefaultAuthMethod({List<String> scopes = const []}) => GithubAuthMethod.defaultMethod(
32-
scopes: scopes,
33-
);
32+
scopes: scopes,
33+
);
3434

3535
@override
3636
GithubAuthMethod createRestAuthMethod(OAuth2Response response) => GithubAuthMethod.rest(
37-
accessToken: response.accessToken,
38-
);
37+
accessToken: response.accessToken,
38+
);
3939

4040
@override
4141
GithubSignIn createFallbackAuthProvider() => GithubSignIn(
42-
clientId: AppCredentials.githubSignInClientId,
43-
);
42+
clientId: AppCredentials.githubSignInClientId,
43+
);
4444

4545
@override
4646
bool get showLoadingDialog => false;

lib/model/authentication/providers/google.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ final googleAuthenticationStateProvider = NotifierProvider<FirebaseAuthenticatio
1616
class GoogleAuthenticationProvider extends FallbackAuthenticationProvider<GoogleSignIn> {
1717
/// Creates a new Google authentication provider instance.
1818
const GoogleAuthenticationProvider()
19-
: super(
20-
availablePlatforms: const [
21-
Platform.android,
22-
Platform.iOS,
23-
Platform.windows,
24-
],
25-
);
19+
: super(
20+
availablePlatforms: const [
21+
Platform.android,
22+
Platform.iOS,
23+
Platform.windows,
24+
],
25+
);
2626

2727
@override
2828
String get providerId => GoogleAuthMethod.providerId;
@@ -40,13 +40,13 @@ class GoogleAuthenticationProvider extends FallbackAuthenticationProvider<Google
4040

4141
@override
4242
GoogleAuthMethod createRestAuthMethod(OAuth2Response response) => GoogleAuthMethod.rest(
43-
idToken: response.idToken,
44-
accessToken: response.accessToken,
45-
);
43+
idToken: response.idToken,
44+
accessToken: response.accessToken,
45+
);
4646

4747
@override
4848
GoogleSignIn createFallbackAuthProvider() => GoogleSignIn(
49-
clientId: AppCredentials.googleSignInClientId,
50-
timeout: fallbackTimeout,
51-
);
49+
clientId: AppCredentials.googleSignInClientId,
50+
timeout: fallbackTimeout,
51+
);
5252
}

lib/model/authentication/providers/microsoft.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ final microsoftAuthenticationStateProvider = NotifierProvider<FirebaseAuthentica
1616
class MicrosoftAuthenticationProvider extends FallbackAuthenticationProvider<MicrosoftSignIn> {
1717
/// Creates a new Microsoft authentication provider instance.
1818
const MicrosoftAuthenticationProvider()
19-
: super(
20-
availablePlatforms: const [
21-
Platform.android,
22-
Platform.iOS,
23-
// Platform.windows, See: https://firebase.google.com/docs/auth/cpp/microsoft-oauth#expandable-2.
24-
],
25-
);
19+
: super(
20+
availablePlatforms: const [
21+
Platform.android,
22+
Platform.iOS,
23+
// Platform.windows, See: https://firebase.google.com/docs/auth/cpp/microsoft-oauth#expandable-2.
24+
],
25+
);
2626

2727
@override
2828
String get providerId => MicrosoftAuthMethod.providerId;
@@ -40,14 +40,14 @@ class MicrosoftAuthenticationProvider extends FallbackAuthenticationProvider<Mic
4040

4141
@override
4242
MicrosoftAuthMethod createRestAuthMethod(OAuth2Response response) => MicrosoftAuthMethod.rest(
43-
accessToken: response.accessToken,
44-
idToken: response.idToken,
45-
nonce: response.nonce,
46-
);
43+
accessToken: response.accessToken,
44+
idToken: response.idToken,
45+
nonce: response.nonce,
46+
);
4747

4848
@override
4949
MicrosoftSignIn createFallbackAuthProvider() => MicrosoftSignIn(
50-
clientId: AppCredentials.azureSignInClientId,
51-
timeout: fallbackTimeout,
52-
);
50+
clientId: AppCredentials.azureSignInClientId,
51+
timeout: fallbackTimeout,
52+
);
5353
}

0 commit comments

Comments
 (0)