-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
codelab_rebuild.yaml
862 lines (805 loc) · 34.6 KB
/
codelab_rebuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
name: Firebase Emulator Suite
steps:
- name: complete
steps:
- name: Remove complete
rmdir: complete
- name: Create project
flutter: create complete --platforms android,ios,macos,web
- name: Strip DEVELOPMENT_TEAM
strip-lines-containing: DEVELOPMENT_TEAM =
path: complete/ios/Runner.xcodeproj/project.pbxproj
- name: Update deps
path: complete
flutter: pub upgrade --major-versions
- name: Configure analysis_options.yaml
path: complete/analysis_options.yaml
replace-contents: |
include: ../../analysis_options.yaml
linter:
rules:
avoid_print: false
prefer_const_constructors: false
prefer_const_declarations: false
- name: Add dependencies
path: complete
flutter: pub add go_router
- name: Remove tests
path: complete
rmdir: test
- name: Mkdir android/app/src/main/res/xml
path: complete
mkdir: android/app/src/main/res/xml
- name: Add android/app/src/main/res/xml/network_config.xml
path: complete/android/app/src/main/res/xml/network_config.xml
replace-contents: |
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.0.2.2</domain>
</domain-config>
</network-security-config>
- name: Add lib/app_state.dart
path: complete/lib/app_state.dart
replace-contents: |
import 'dart:async';
import 'entry.dart';
class AppState {
AppState() {
_entriesStreamController = StreamController.broadcast(onListen: () {
_entriesStreamController.add([
Entry(
date: '10/09/2022',
text: lorem,
title: '[Example] My Journal Entry',
)
]);
});
}
// This will change to the type User from the Firebase Authentication package
// Changing it’s type now would cause the app to throw an error
Object? user;
late StreamController<List<Entry>> _entriesStreamController;
Stream<List<Entry>> get entries =>
_entriesStreamController.stream.asBroadcastStream();
Future<void> logIn(String email, String password) async {
print('TODO: AppState.login');
user = Object();
await _listenForEntries();
}
void writeEntryToFirebase(Entry entry) {
print('TODO: AppState.writeEntryToFirebase');
}
Future<void> _listenForEntries() async {
print('TODO: AppState._listenForEntries');
}
}
const lorem =
'''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
''';
- name: Add lib/entry.dart
path: complete/lib/entry.dart
replace-contents: |
class Entry {
final String date;
final String text;
final String title;
Entry({
required this.date,
required this.text,
required this.title,
});
}
- name: Add lib/journal_entry_form.dart
path: complete/lib/journal_entry_form.dart
replace-contents: |
import 'package:flutter/material.dart';
import 'entry.dart';
typedef SubmitCallback = void Function(Entry);
class EntryForm extends StatefulWidget {
final SubmitCallback onSubmit;
const EntryForm({super.key, required this.onSubmit});
@override
State<EntryForm> createState() => _EntryFormState();
}
class _EntryFormState extends State<EntryForm> {
final _formKey = GlobalKey<FormState>();
late String title;
late String text;
late String date;
@override
Widget build(BuildContext context) {
return Card(
elevation: 6,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextFormField(
decoration: const InputDecoration(labelText: 'Title'),
// The validator receives the text that the user has entered.
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
title = value;
return null;
},
),
TextFormField(
decoration:
const InputDecoration(labelText: 'Date (DD/MM/YYYY):'),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
date = value;
return null;
},
),
TextFormField(
decoration: const InputDecoration(labelText: 'Text'),
maxLines: 10,
minLines: 5,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
text = value;
return null;
},
),
Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: FilledButton(
onPressed: () {
// Validate returns true if the form is valid, or false otherwise.
if (_formKey.currentState!.validate()) {
final entry = Entry(
title: title,
text: text,
date: date,
);
widget.onSubmit(entry);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Submitting Entry')),
);
}
},
child: const Text('Submit'),
),
),
),
],
),
),
),
);
}
}
- name: Add lib/journal_entry_widget.dart
path: complete/lib/journal_entry_widget.dart
replace-contents: |
import 'package:flutter/material.dart';
import 'entry.dart';
class EntryView extends StatelessWidget {
final Entry entry;
const EntryView({super.key, required this.entry});
@override
Widget build(BuildContext context) {
return Card(
elevation: 6,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: Text(
entry.title,
style: Theme.of(context).textTheme.titleLarge,
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
'Date: ${entry.date}',
style: Theme.of(context).textTheme.labelMedium,
),
),
const Divider(),
Expanded(
child: Text(
entry.text,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
height: 1.3,
wordSpacing: 1.2,
letterSpacing: 1.05,
),
),
),
],
),
),
);
}
}
- name: Add lib/logged_in_view.dart
path: complete/lib/logged_in_view.dart
replace-contents: |
import 'dart:math';
import 'package:flutter/material.dart';
import 'app_state.dart';
import 'entry.dart';
import 'journal_entry_form.dart';
import 'journal_entry_widget.dart';
class LoggedInView extends StatelessWidget {
final AppState state;
LoggedInView({super.key, required this.state});
final PageController _controller = PageController(initialPage: 1);
@override
Widget build(BuildContext context) {
// TODO: get name from Firebase User
final name = 'Person';
return Scaffold(
body: Column(
children: [
Center(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 16.0,
),
child: Text(
'Welcome back, $name!',
style: Theme.of(context).textTheme.headlineSmall!.copyWith(),
),
),
),
Flexible(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: StreamBuilder<List<Entry>>(
stream: state.entries,
initialData: const [],
builder: (context, snapshot) {
final allEntries = snapshot.data;
return PageView(
controller: _controller,
scrollDirection: Axis.horizontal,
children: [
EntryForm(
key: Key('${Random().nextDouble()}'),
onSubmit: (e) {
state.writeEntryToFirebase(e);
},
),
for (var entry in allEntries!)
EntryView(
entry: entry,
)
],
);
},
),
),
)
],
),
);
}
}
- name: Add lib/logged_out_view.dart
path: complete/lib/logged_out_view.dart
replace-contents: |
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'app_state.dart';
class LoggedOutView extends StatelessWidget {
final AppState state;
const LoggedOutView({super.key, required this.state});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Firebase Emulator Suite Codelab'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Please log in',
style: Theme.of(context).textTheme.displaySmall,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: FilledButton(
onPressed: () async {
// TODO: update email and password
await state.logIn('TODO', 'TODO').then((_) {
// TODO: update to check that state.user is not null
if (context.mounted) {
context.go('/');
}
});
},
child: const Text('Log In'),
),
),
],
),
),
);
}
}
- name: Add lib/main.dart
path: complete/lib/main.dart
replace-contents: |
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'app_state.dart';
import 'logged_in_view.dart';
import 'logged_out_view.dart';
void main() async {
// TODO: Initialize Firebase
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final state = AppState();
MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
scrollBehavior: AppScrollBehavior(),
routerConfig: _router(),
theme: ThemeData(useMaterial3: true),
);
}
GoRouter _router() {
return GoRouter(
redirect: (context, routerState) => state.user == null ? '/login' : null,
routes: [
GoRoute(
path: '/',
builder: (context, routerState) => LoggedInView(state: state),
),
GoRoute(
path: '/login',
builder: (context, routerState) => LoggedOutView(state: state),
),
],
);
}
}
class AppScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
}
- name: Build web
path: complete
flutter: build web
- name: Remove start
rmdir: start
- name: Copy to start
copydir:
from: complete
to: start
- name: Flutter clean
path: start
flutter: clean
- name: complete
steps:
- name: Add dependencies
path: complete
flutter: pub add firebase_core firebase_auth cloud_firestore
- name: Add .firebaserc
path: complete/.firebaserc
replace-contents: |
{
"projects": {
"default": "flutter-firebase-codelab-d6b79"
}
}
- name: Add firebase.json
path: complete/firebase.json
replace-contents: |
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"emulators": {
"auth": {
"port": 9099
},
"firestore": {
"port": 8080
},
"ui": {
"enabled": true
}
}
}
- name: firestore.indexes.json
path: complete/firestore.indexes.json
replace-contents: |
{
"indexes": [],
"fieldOverrides": []
}
- name: firestore.rules
path: complete/firestore.rules
replace-contents: |
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if
request.time < timestamp.date(2022, 8, 9);
}
}
}
- name: Patch lib/app_state.dart
path: complete/lib/app_state.dart
patch-u: |
--- b/firebase-emulator-suite/complete/lib/app_state.dart
+++ a/firebase-emulator-suite/complete/lib/app_state.dart
@@ -1,5 +1,8 @@
import 'dart:async';
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:firebase_auth/firebase_auth.dart';
+
import 'entry.dart';
class AppState {
@@ -15,28 +18,51 @@ class AppState {
});
}
- // This will change to the type User from the Firebase Authentication package
- // Changing it’s type now would cause the app to throw an error
- Object? user;
- late StreamController<List<Entry>> _entriesStreamController;
- Stream<List<Entry>> get entries =>
- _entriesStreamController.stream.asBroadcastStream();
+ User? user;
+ Stream<List<Entry>> get entries => _entriesStreamController.stream;
+ late final StreamController<List<Entry>> _entriesStreamController;
Future<void> logIn(String email, String password) async {
- print('TODO: AppState.login');
- user = Object();
- await _listenForEntries();
+ final credential = await FirebaseAuth.instance
+ .signInWithEmailAndPassword(email: email, password: password);
+ if (credential.user != null) {
+ user = credential.user!;
+ _listenForEntries();
+ } else {
+ print('no user!');
+ }
}
void writeEntryToFirebase(Entry entry) {
- print('TODO: AppState.writeEntryToFirebase');
+ FirebaseFirestore.instance.collection('Entries').add(<String, String>{
+ 'title': entry.title,
+ 'date': entry.date.toString(),
+ 'text': entry.text,
+ });
+ }
+
+ void _listenForEntries() {
+ FirebaseFirestore.instance
+ .collection('Entries')
+ .snapshots()
+ .listen((event) {
+ final entries = event.docs.map((doc) {
+ final data = doc.data();
+ return Entry(
+ date: data['date'] as String,
+ text: data['text'] as String,
+ title: data['title'] as String,
+ );
+ }).toList();
+
+ _entriesStreamController.add(entries);
+ });
}
- Future<void> _listenForEntries() async {
- print('TODO: AppState._listenForEntries');
+ void dispose() {
+ _entriesStreamController.close();
}
}
const lorem =
- '''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
- ''';
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
- name: Patch lib/journal_entry_form.dart
path: complete/lib/journal_entry_form.dart
patch-u: |
--- b/firebase-emulator-suite/complete/lib/journal_entry_form.dart
+++ a/firebase-emulator-suite/complete/lib/journal_entry_form.dart
@@ -80,7 +80,7 @@ class _EntryFormState extends State<EntryForm> {
widget.onSubmit(entry);
ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(content: Text('Submitting Entry')),
+ const SnackBar(content: Text('Processing Data')),
);
}
},
- name: Patch lib/logged_in_view.dart
path: complete/lib/logged_in_view.dart
patch-u: |
--- b/firebase-emulator-suite/complete/lib/logged_in_view.dart
+++ a/firebase-emulator-suite/complete/lib/logged_in_view.dart
@@ -15,20 +15,14 @@ class LoggedInView extends StatelessWidget {
@override
Widget build(BuildContext context) {
- // TODO: get name from Firebase User
- final name = 'Person';
+ final name = state.user!.displayName ?? 'No Name';
return Scaffold(
body: Column(
children: [
Center(
- child: Padding(
- padding: const EdgeInsets.symmetric(
- vertical: 16.0,
- ),
- child: Text(
- 'Welcome back, $name!',
- style: Theme.of(context).textTheme.headlineSmall!.copyWith(),
- ),
+ child: Text(
+ 'Welcome back, $name!',
+ style: Theme.of(context).textTheme.headlineSmall!.copyWith(),
),
),
Flexible(
@@ -36,25 +30,29 @@ class LoggedInView extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: StreamBuilder<List<Entry>>(
stream: state.entries,
- initialData: const [],
builder: (context, snapshot) {
- final allEntries = snapshot.data;
- return PageView(
- controller: _controller,
- scrollDirection: Axis.horizontal,
- children: [
- EntryForm(
- key: Key('${Random().nextDouble()}'),
- onSubmit: (e) {
- state.writeEntryToFirebase(e);
- },
- ),
- for (var entry in allEntries!)
- EntryView(
- entry: entry,
- )
- ],
- );
+ if (snapshot.hasData) {
+ final allEntries = snapshot.data;
+ return PageView(
+ controller: _controller,
+ scrollDirection: Axis.horizontal,
+ children: [
+ EntryForm(
+ key: Key('${Random().nextDouble()}'),
+ onSubmit: (e) {
+ state.writeEntryToFirebase(e);
+ },
+ ),
+ for (var entry in allEntries!)
+ EntryView(
+ key: Key('${Random().nextDouble()}'),
+ entry: entry,
+ )
+ ],
+ );
+ } else {
+ return const CircularProgressIndicator();
+ }
},
),
),
- name: Patch lib/logged_out_view.dart
path: complete/lib/logged_out_view.dart
patch-u: |
--- b/firebase-emulator-suite/complete/lib/logged_out_view.dart
+++ a/firebase-emulator-suite/complete/lib/logged_out_view.dart
@@ -24,10 +24,8 @@ class LoggedOutView extends StatelessWidget {
padding: const EdgeInsets.all(8.0),
child: FilledButton(
onPressed: () async {
- // TODO: update email and password
- await state.logIn('TODO', 'TODO').then((_) {
- // TODO: update to check that state.user is not null
- if (context.mounted) {
+ await state.logIn('[email protected]', 'dashword').then((_) {
+ if (state.user != null && context.mounted) {
context.go('/');
}
});
- name: Patch lib/main.dart
path: complete/lib/main.dart
patch-u: |
--- b/firebase-emulator-suite/complete/lib/main.dart
+++ a/firebase-emulator-suite/complete/lib/main.dart
@@ -1,13 +1,32 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:firebase_auth/firebase_auth.dart';
+import 'package:firebase_core/firebase_core.dart';
+import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'app_state.dart';
+import 'firebase_options.dart';
import 'logged_in_view.dart';
import 'logged_out_view.dart';
void main() async {
- // TODO: Initialize Firebase
+ WidgetsFlutterBinding.ensureInitialized();
+ await Firebase.initializeApp(
+ options: DefaultFirebaseOptions.currentPlatform,
+ );
+
+ if (kDebugMode) {
+ try {
+ FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
+ await FirebaseAuth.instance.useAuthEmulator('localhost', 9099);
+ } catch (e) {
+ // ignore: avoid_print
+ print(e);
+ }
+ }
+
runApp(MyApp());
}
- name: Create lib/firebase_options.dart
path: complete/lib/firebase_options.dart
replace-contents: |
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
return macos;
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.');
}
}
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyBqTAGMEPyYPrraQColhTWE3gpBCHwBHaY',
appId: '1:249605288217:web:f8441e30c5cc335b089588',
messagingSenderId: '249605288217',
projectId: 'flutter-firebase-codelab-d6b79',
authDomain: 'flutter-firebase-codelab-d6b79.firebaseapp.com',
storageBucket: 'flutter-firebase-codelab-d6b79.appspot.com',
);
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyDOhizxfIPR8Qs4_isZnE_AnteC0zOxod4',
appId: '1:249605288217:android:27c0f0a1ef464773089588',
messagingSenderId: '249605288217',
projectId: 'flutter-firebase-codelab-d6b79',
storageBucket: 'flutter-firebase-codelab-d6b79.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCvSrqVklmfWxE_SM8HNHvxqOLZTQCsUtk',
appId: '1:249605288217:ios:ef9f4946a0d08a35089588',
messagingSenderId: '249605288217',
projectId: 'flutter-firebase-codelab-d6b79',
storageBucket: 'flutter-firebase-codelab-d6b79.appspot.com',
iosClientId:
'249605288217-9sn136tgsd0vg7nae831gahubpoph3ih.apps.googleusercontent.com',
iosBundleId: 'com.example.complete',
);
static const FirebaseOptions macos = FirebaseOptions(
apiKey: 'AIzaSyCvSrqVklmfWxE_SM8HNHvxqOLZTQCsUtk',
appId: '1:249605288217:ios:ef9f4946a0d08a35089588',
messagingSenderId: '249605288217',
projectId: 'flutter-firebase-codelab-d6b79',
storageBucket: 'flutter-firebase-codelab-d6b79.appspot.com',
iosClientId:
'249605288217-9sn136tgsd0vg7nae831gahubpoph3ih.apps.googleusercontent.com',
iosBundleId: 'com.example.complete',
);
}
- name: Mkdir android/app/src/main/java/io/flutter/app
path: complete
mkdir: android/app/src/main/java/io/flutter/app
- name: Create android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java
path: complete/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java
replace-contents: |
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.
package io.flutter.app;
import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;
/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
- name: Mkdir emulators_data/auth_export
path: complete
mkdir: emulators_data/auth_export
- name: Create emulators_data/auth_export/accounts.json
path: complete/emulators_data/auth_export/accounts.json
replace-contents: |
{"kind":"identitytoolkit#DownloadAccountResponse","users":[]}
- name: Create emulators_data/auth_export/config.json
path: complete/emulators_data/auth_export/config.json
replace-contents: |
{"signIn":{"allowDuplicateEmails":false},"usageMode":"DEFAULT"}
- name: Create emulators_data/firebase-export-metadata.json
path: complete/emulators_data/firebase-export-metadata.json
replace-contents: |
{
"version": "10.6.0",
"firestore": {
"version": "1.14.1",
"path": "firestore_export",
"metadata_file": "firestore_export/firestore_export.overall_export_metadata"
},
"auth": {
"version": "10.6.0",
"path": "auth_export"
}
}
- name: Mkdir emulators_data/firestore_export
path: complete
mkdir: emulators_data/firestore_export
- name: Create emulators_data/firestore_export/firestore_export.overall_export_metadata
path: complete/emulators_data/firestore_export/firestore_export.overall_export_metadata
base64-contents: |
uG1ETgEAATMFKyhDAAAB
- name: Build web
path: complete
flutter: build web
- name: Flutter clean
path: complete
flutter: clean