Skip to content

Commit 5992103

Browse files
committed
chore
1 parent 5d40374 commit 5992103

File tree

5 files changed

+16
-23
lines changed

5 files changed

+16
-23
lines changed

lib/app/view/app.dart

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//
22
// ignore_for_file: deprecated_member_use
33

4-
import 'dart:async'; // For StreamSubscription
5-
4+
import 'dart:async';
65
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; // For dynamic links
76
import 'package:flex_color_scheme/flex_color_scheme.dart';
87
import 'package:flutter/material.dart';
@@ -21,25 +20,23 @@ class App extends StatelessWidget {
2120
const App({
2221
required HtHeadlinesRepository htHeadlinesRepository,
2322
required HtAuthenticationRepository htAuthenticationRepository,
24-
required HtKVStorageService kvStorageService, // Add storage service
23+
required HtKVStorageService kvStorageService,
2524
super.key,
2625
}) : _htHeadlinesRepository = htHeadlinesRepository,
2726
_htAuthenticationRepository = htAuthenticationRepository,
28-
_kvStorageService = kvStorageService; // Assign storage service
27+
_kvStorageService = kvStorageService;
2928

3029
final HtHeadlinesRepository _htHeadlinesRepository;
3130
final HtAuthenticationRepository _htAuthenticationRepository;
32-
final HtKVStorageService _kvStorageService; // Add storage service field
31+
final HtKVStorageService _kvStorageService;
3332

3433
@override
3534
Widget build(BuildContext context) {
3635
return MultiRepositoryProvider(
3736
providers: [
3837
RepositoryProvider.value(value: _htHeadlinesRepository),
3938
RepositoryProvider.value(value: _htAuthenticationRepository),
40-
RepositoryProvider.value(
41-
value: _kvStorageService,
42-
), // Provide storage service
39+
RepositoryProvider.value(value: _kvStorageService),
4340
],
4441
// Use MultiBlocProvider to provide both AppBloc and AuthenticationBloc
4542
child: MultiBlocProvider(
@@ -56,7 +53,6 @@ class App extends StatelessWidget {
5653
(context) => AuthenticationBloc(
5754
authenticationRepository:
5855
context.read<HtAuthenticationRepository>(),
59-
// No storage service needed here anymore
6056
),
6157
),
6258
],
@@ -98,7 +94,7 @@ class _AppViewState extends State<_AppView> {
9894

9995
@override
10096
void dispose() {
101-
_linkSubscription?.cancel(); // Cancel listener
97+
_linkSubscription?.cancel();
10298
_statusNotifier.dispose();
10399
super.dispose();
104100
}
@@ -111,7 +107,7 @@ class _AppViewState extends State<_AppView> {
111107
// Handle link data
112108
_handleDynamicLink(pendingDynamicLinkData.link);
113109
},
114-
onError: (error) {
110+
onError: (Object error) {
115111
// Handle errors (e.g., log them)
116112
debugPrint('Dynamic Link Listener Error: $error');
117113
},
@@ -121,7 +117,6 @@ class _AppViewState extends State<_AppView> {
121117
try {
122118
final initialLink = await FirebaseDynamicLinks.instance.getInitialLink();
123119
if (initialLink != null) {
124-
// Add await here
125120
await _handleDynamicLink(initialLink.link);
126121
}
127122
} catch (e) {

lib/authentication/bloc/authentication_bloc.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
//
2+
// ignore_for_file: lines_longer_than_80_chars
3+
14
import 'dart:async';
25

36
import 'package:bloc/bloc.dart';
47
import 'package:equatable/equatable.dart';
5-
import 'package:ht_authentication_client/ht_authentication_client.dart'; // Import client for Exceptions/User
8+
import 'package:ht_authentication_client/ht_authentication_client.dart';
69
import 'package:ht_authentication_repository/ht_authentication_repository.dart';
7-
// No longer need storage service import
8-
// import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
910

1011
part 'authentication_event.dart';
1112
part 'authentication_state.dart';
@@ -21,14 +22,12 @@ class AuthenticationBloc
2122
// Remove kvStorageService from constructor
2223
}) : _authenticationRepository = authenticationRepository,
2324
super(AuthenticationInitial()) {
24-
// Register new event handlers
2525
on<AuthenticationSendSignInLinkRequested>(
2626
_onAuthenticationSendSignInLinkRequested,
2727
);
2828
on<AuthenticationSignInWithLinkAttempted>(
2929
_onAuthenticationSignInWithLinkAttempted,
3030
);
31-
// Keep existing handlers
3231
on<AuthenticationGoogleSignInRequested>(
3332
_onAuthenticationGoogleSignInRequested,
3433
);
@@ -42,7 +41,6 @@ class AuthenticationBloc
4241
}
4342

4443
final HtAuthenticationRepository _authenticationRepository;
45-
// Remove _kvStorageService field
4644

4745
/// Handles [AuthenticationSendSignInLinkRequested] events.
4846
Future<void> _onAuthenticationSendSignInLinkRequested(
@@ -56,7 +54,8 @@ class AuthenticationBloc
5654
}
5755
emit(AuthenticationLinkSending()); // Indicate link sending
5856
try {
59-
// Simply call the repository method, storage is handled internally
57+
// Simply call the repository method, email temprary storage storage
58+
// is handled internally
6059
await _authenticationRepository.sendSignInLinkToEmail(email: event.email);
6160
emit(AuthenticationLinkSentSuccess()); // Confirm link sent
6261
} on SendSignInLinkException catch (e) {

lib/authentication/bloc/authentication_event.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,4 @@ final class AuthenticationSignOutRequested extends AuthenticationEvent {
7676
final class AuthenticationDeleteAccountRequested extends AuthenticationEvent {
7777
/// {@macro authentication_delete_account_requested}
7878
const AuthenticationDeleteAccountRequested();
79-
const AuthenticationDeleteAccountRequested();
8079
}

lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void main() async {
3737
);
3838
final authenticationRepository = HtAuthenticationRepository(
3939
authenticationClient: authenticationClient,
40-
storageService: kvStorage, // Pass the storage service
40+
storageService: kvStorage,
4141
);
4242

4343
// 2. Headlines Repository
@@ -50,7 +50,7 @@ void main() async {
5050
App(
5151
htAuthenticationRepository: authenticationRepository,
5252
htHeadlinesRepository: headlinesRepository,
53-
kvStorageService: kvStorage, // Pass storage service to App
53+
kvStorageService: kvStorage,
5454
),
5555
);
5656
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ht_main
22
description: main headlines toolkit mobile app.
3-
version: 0.37.5
3+
version: 0.37.6
44
publish_to: none
55
repository: https://github.com/headlines-toolkit/ht-main
66
environment:

0 commit comments

Comments
 (0)