Skip to content

Commit e6a92e5

Browse files
author
PeterHdd
committed
chore: update firebase storage source code
1 parent ba1fd8d commit e6a92e5

File tree

3 files changed

+38
-29
lines changed

3 files changed

+38
-29
lines changed

firebase_storage_tutorial/lib/second_page.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ class _SecondPageState extends State<SecondPage> {
6868
ElevatedButton(child: Text("Pick Image"), onPressed: getImage),
6969
_image == null
7070
? Text('No image selected.')
71-
: Image.file(
72-
_image!,
73-
height: 300,
74-
),
71+
: Expanded(
72+
child: Image.file(
73+
_image!,
74+
fit: BoxFit.fill,
75+
// height: 300,
76+
),
77+
),
7578
!isLoading
7679
? ElevatedButton(
7780
child: Text("Save Image"),
@@ -99,7 +102,7 @@ class _SecondPageState extends State<SecondPage> {
99102

100103
Future getImage() async {
101104
final _picker = ImagePicker();
102-
var image = await _picker.getImage(source: ImageSource.gallery);
105+
var image = await _picker.pickImage(source: ImageSource.gallery);
103106

104107
setState(() {
105108
_image = File(image!.path);

firebase_storage_tutorial/pubspec.lock

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0"
10+
version: "2.8.1"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -28,7 +28,7 @@ packages:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0"
31+
version: "1.3.1"
3232
clock:
3333
dependency: transitive
3434
description:
@@ -42,28 +42,35 @@ packages:
4242
name: cloud_firestore
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "2.2.1"
45+
version: "2.5.4"
4646
cloud_firestore_platform_interface:
4747
dependency: transitive
4848
description:
4949
name: cloud_firestore_platform_interface
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "5.1.1"
52+
version: "5.4.3"
5353
cloud_firestore_web:
5454
dependency: transitive
5555
description:
5656
name: cloud_firestore_web
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "2.1.1"
59+
version: "2.4.4"
6060
collection:
6161
dependency: transitive
6262
description:
6363
name: collection
6464
url: "https://pub.dartlang.org"
6565
source: hosted
6666
version: "1.15.0"
67+
cross_file:
68+
dependency: transitive
69+
description:
70+
name: cross_file
71+
url: "https://pub.dartlang.org"
72+
source: hosted
73+
version: "0.3.1+5"
6774
cupertino_icons:
6875
dependency: "direct main"
6976
description:
@@ -84,7 +91,7 @@ packages:
8491
name: firebase_core
8592
url: "https://pub.dartlang.org"
8693
source: hosted
87-
version: "1.2.1"
94+
version: "1.8.0"
8895
firebase_core_platform_interface:
8996
dependency: transitive
9097
description:
@@ -105,21 +112,21 @@ packages:
105112
name: firebase_storage
106113
url: "https://pub.dartlang.org"
107114
source: hosted
108-
version: "8.1.1"
115+
version: "10.0.6"
109116
firebase_storage_platform_interface:
110117
dependency: transitive
111118
description:
112119
name: firebase_storage_platform_interface
113120
url: "https://pub.dartlang.org"
114121
source: hosted
115-
version: "2.1.1"
122+
version: "4.0.4"
116123
firebase_storage_web:
117124
dependency: transitive
118125
description:
119126
name: firebase_storage_web
120127
url: "https://pub.dartlang.org"
121128
source: hosted
122-
version: "1.1.1"
129+
version: "3.0.4"
123130
flutter:
124131
dependency: "direct main"
125132
description: flutter
@@ -162,21 +169,21 @@ packages:
162169
name: image_picker
163170
url: "https://pub.dartlang.org"
164171
source: hosted
165-
version: "0.8.0+1"
172+
version: "0.8.4+3"
166173
image_picker_for_web:
167174
dependency: transitive
168175
description:
169176
name: image_picker_for_web
170177
url: "https://pub.dartlang.org"
171178
source: hosted
172-
version: "2.0.0"
179+
version: "2.1.4"
173180
image_picker_platform_interface:
174181
dependency: transitive
175182
description:
176183
name: image_picker_platform_interface
177184
url: "https://pub.dartlang.org"
178185
source: hosted
179-
version: "2.0.1"
186+
version: "2.4.1"
180187
js:
181188
dependency: transitive
182189
description:
@@ -197,7 +204,7 @@ packages:
197204
name: meta
198205
url: "https://pub.dartlang.org"
199206
source: hosted
200-
version: "1.3.0"
207+
version: "1.7.0"
201208
path:
202209
dependency: transitive
203210
description:
@@ -230,7 +237,7 @@ packages:
230237
name: source_span
231238
url: "https://pub.dartlang.org"
232239
source: hosted
233-
version: "1.8.0"
240+
version: "1.8.1"
234241
stack_trace:
235242
dependency: transitive
236243
description:
@@ -265,7 +272,7 @@ packages:
265272
name: test_api
266273
url: "https://pub.dartlang.org"
267274
source: hosted
268-
version: "0.2.19"
275+
version: "0.4.2"
269276
typed_data:
270277
dependency: transitive
271278
description:
@@ -281,5 +288,5 @@ packages:
281288
source: hosted
282289
version: "2.1.0"
283290
sdks:
284-
dart: ">=2.12.0 <3.0.0"
285-
flutter: ">=2.0.0"
291+
dart: ">=2.14.0 <3.0.0"
292+
flutter: ">=2.5.0"

firebase_storage_tutorial/pubspec.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ description: A new Flutter project.
1414
version: 1.0.0+1
1515

1616
environment:
17-
sdk: '>=2.12.0 <3.0.0'
17+
sdk: ">=2.12.0 <3.0.0"
1818

1919
dependencies:
20+
cloud_firestore: ^2.5.4
21+
cupertino_icons: ^0.1.2
22+
firebase_core: ^1.8.0
23+
firebase_storage: ^10.0.6
2024
flutter:
2125
sdk: flutter
22-
cloud_firestore: ^2.2.1
23-
cupertino_icons: ^0.1.2
24-
firebase_core: ^1.2.1
25-
firebase_storage: ^8.1.1
26-
image_picker: ^0.8.0+1
26+
image_picker: ^0.8.4+3
2727

2828
dev_dependencies:
2929
flutter_test:
@@ -33,7 +33,6 @@ dev_dependencies:
3333
# following page: https://dart.dev/tools/pub/pubspec
3434
# The following section is specific to Flutter.
3535
flutter:
36-
3736
# The following line ensures that the Material Icons font is
3837
# included with your application, so that you can use the icons in
3938
# the material Icons class.

0 commit comments

Comments
 (0)