Skip to content

Commit f33a4c2

Browse files
author
darkhan.nausharipov
committed
addressing comments (#23692)
1 parent dc4e142 commit f33a4c2

10 files changed

Lines changed: 18 additions & 234 deletions

File tree

learning/tour-of-beam/frontend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ However, after changes you may need to re-run code generation:
3636
cd beam
3737
./gradlew :playground:frontend:playground_components:generateCode
3838
cd learning/tour-of-beam/frontend
39-
flutter pub run build_runner build
39+
flutter pub run build_runner build --delete-conflicting-outputs
4040
```
4141

4242
### Run

learning/tour-of-beam/frontend/lib/auth/method.dart

Lines changed: 0 additions & 27 deletions
This file was deleted.

learning/tour-of-beam/frontend/lib/auth/method.g.dart

Lines changed: 0 additions & 162 deletions
This file was deleted.

learning/tour-of-beam/frontend/lib/auth/notifier.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@
1919
import 'dart:async';
2020

2121
import 'package:firebase_auth/firebase_auth.dart';
22+
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
2223
import 'package:flutter/material.dart';
23-
import 'method.dart';
2424

2525
class AuthNotifier extends ChangeNotifier {
26-
final _authProviders = UnmodifiableAuthMethodMap(
27-
google: GoogleAuthProvider(),
28-
github: GithubAuthProvider(),
29-
);
30-
3126
AuthNotifier() {
3227
FirebaseAuth.instance.authStateChanges().listen((user) {
3328
notifyListeners();
@@ -40,8 +35,8 @@ class AuthNotifier extends ChangeNotifier {
4035
return await FirebaseAuth.instance.currentUser?.getIdToken();
4136
}
4237

43-
Future<void> logIn(AuthMethod authMethod) async {
44-
await FirebaseAuth.instance.signInWithPopup(_authProviders.get(authMethod));
38+
Future<void> logIn(AuthProvider authProvider) async {
39+
await FirebaseAuth.instance.signInWithPopup(authProvider);
4540
}
4641

4742
Future<void> logOut() async {

learning/tour-of-beam/frontend/lib/cache/cache.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import 'package:flutter/material.dart';
2020

2121
import '../repositories/client/client.dart';
2222

23+
/// A base class for caching entities from network requests.
2324
abstract class Cache extends ChangeNotifier {
2425
final TobClient client;
2526

learning/tour-of-beam/frontend/lib/cache/content_tree.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class ContentTreeCache extends Cache {
3030
final _futuresBySdkId = <String, Future<ContentTreeModel>>{};
3131

3232
ContentTreeModel? getContentTree(String sdkId) {
33-
final future = _futuresBySdkId[sdkId];
34-
if (future == null) {
33+
if (_futuresBySdkId.containsKey(sdkId)) {
3534
unawaited(_loadContentTree(sdkId));
3635
}
3736

learning/tour-of-beam/frontend/lib/components/login/content.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
*/
1818

1919
import 'package:easy_localization/easy_localization.dart';
20+
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
2021
import 'package:flutter/material.dart';
2122
import 'package:flutter_svg/svg.dart';
2223
import 'package:get_it/get_it.dart';
2324
import 'package:playground_components/playground_components.dart';
2425

2526
import '../../assets/assets.gen.dart';
26-
import '../../auth/method.dart';
2727
import '../../auth/notifier.dart';
2828
import '../../constants/sizes.dart';
2929

@@ -132,7 +132,7 @@ class _BrandedLoginButtons extends StatelessWidget {
132132
const SizedBox(height: BeamSizes.size16),
133133
ElevatedButton.icon(
134134
onPressed: () async {
135-
await authNotifier.logIn(AuthMethod.google);
135+
await authNotifier.logIn(GoogleAuthProvider());
136136
onLoggedIn();
137137
},
138138
style: isLightTheme ? googleLightButtonStyle : darkButtonStyle,

learning/tour-of-beam/frontend/pubspec.lock

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ packages:
1414
name: _flutterfire_internals
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "1.0.9"
17+
version: "1.0.12"
1818
aligned_dialog:
1919
dependency: transitive
2020
description:
@@ -35,7 +35,7 @@ packages:
3535
name: app_state
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "0.8.1"
38+
version: "0.8.4"
3939
archive:
4040
dependency: transitive
4141
description:
@@ -155,20 +155,6 @@ packages:
155155
url: "https://pub.dartlang.org"
156156
source: hosted
157157
version: "1.1.1"
158-
cloud_firestore_platform_interface:
159-
dependency: transitive
160-
description:
161-
name: cloud_firestore_platform_interface
162-
url: "https://pub.dartlang.org"
163-
source: hosted
164-
version: "5.9.0"
165-
cloud_firestore_web:
166-
dependency: transitive
167-
description:
168-
name: cloud_firestore_web
169-
url: "https://pub.dartlang.org"
170-
source: hosted
171-
version: "3.1.0"
172158
code_builder:
173159
dependency: transitive
174160
description:
@@ -254,19 +240,12 @@ packages:
254240
source: hosted
255241
version: "0.0.2"
256242
enum_map:
257-
dependency: "direct main"
243+
dependency: transitive
258244
description:
259245
name: enum_map
260246
url: "https://pub.dartlang.org"
261247
source: hosted
262248
version: "0.2.1"
263-
enum_map_gen:
264-
dependency: "direct dev"
265-
description:
266-
name: enum_map_gen
267-
url: "https://pub.dartlang.org"
268-
source: hosted
269-
version: "0.2.0"
270249
equatable:
271250
dependency: "direct dev"
272251
description:
@@ -303,12 +282,12 @@ packages:
303282
source: hosted
304283
version: "4.1.4"
305284
firebase_auth_platform_interface:
306-
dependency: transitive
285+
dependency: "direct main"
307286
description:
308287
name: firebase_auth_platform_interface
309288
url: "https://pub.dartlang.org"
310289
source: hosted
311-
version: "6.11.3"
290+
version: "6.11.7"
312291
firebase_auth_web:
313292
dependency: transitive
314293
description:
@@ -322,7 +301,7 @@ packages:
322301
name: firebase_core
323302
url: "https://pub.dartlang.org"
324303
source: hosted
325-
version: "2.3.0"
304+
version: "2.4.1"
326305
firebase_core_platform_interface:
327306
dependency: transitive
328307
description:
@@ -336,7 +315,7 @@ packages:
336315
name: firebase_core_web
337316
url: "https://pub.dartlang.org"
338317
source: hosted
339-
version: "2.0.1"
318+
version: "2.1.0"
340319
fixnum:
341320
dependency: transitive
342321
description:
@@ -355,7 +334,7 @@ packages:
355334
name: flutter_code_editor
356335
url: "https://pub.dartlang.org"
357336
source: hosted
358-
version: "0.2.1"
337+
version: "0.2.5"
359338
flutter_driver:
360339
dependency: transitive
361340
description: flutter

learning/tour-of-beam/frontend/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ dependencies:
3232
easy_localization: ^3.0.1
3333
easy_localization_ext: ^0.1.0
3434
easy_localization_loader: ^1.0.0
35-
enum_map: ^0.2.1
3635
firebase_auth: ^4.1.1
36+
firebase_auth_platform_interface: ^6.11.7
3737
firebase_core: ^2.1.1
3838
flutter: { sdk: flutter }
3939
flutter_markdown: ^0.6.12
@@ -52,7 +52,6 @@ dependencies:
5252

5353
dev_dependencies:
5454
build_runner: ^2.2.0
55-
enum_map_gen: ^0.2.0
5655
equatable: ^2.0.5
5756
flutter_gen_runner: ^4.3.0
5857
flutter_test: { sdk: flutter }

learning/tour-of-beam/frontend/test/main_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
*/
1818

1919
void main() {
20-
// TODO(nausharipov): add unit and integration tests
20+
// TODO(nausharipov): add unit and integration tests: // https://github.com/apache/beam/issues/24982
2121
}

0 commit comments

Comments
 (0)