Skip to content

Commit ba6d76c

Browse files
committed
Update dependencies
1 parent c2f8b0a commit ba6d76c

File tree

5 files changed

+122
-120
lines changed

5 files changed

+122
-120
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.2
2+
3+
- Update dependencies
4+
15
## 1.1.1
26

37
- Update dependencies

example/ios/Podfile.lock

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ PODS:
218218
- BoringSSL-GRPC/Implementation (0.0.7):
219219
- BoringSSL-GRPC/Interface (= 0.0.7)
220220
- BoringSSL-GRPC/Interface (0.0.7)
221-
- cloud_firestore (2.3.0):
222-
- Firebase/Firestore (= 8.0.0)
221+
- cloud_firestore (2.4.0):
222+
- Firebase/Firestore (= 8.3.0)
223223
- firebase_core
224224
- Flutter
225225
- DKImagePickerController/Core (4.3.2):
@@ -256,34 +256,34 @@ PODS:
256256
- file_picker (0.0.1):
257257
- DKImagePickerController/PhotoGallery
258258
- Flutter
259-
- Firebase/Auth (8.0.0):
259+
- Firebase/Auth (8.3.0):
260260
- Firebase/CoreOnly
261-
- FirebaseAuth (~> 8.0.0)
262-
- Firebase/CoreOnly (8.0.0):
263-
- FirebaseCore (= 8.0.0)
264-
- Firebase/Firestore (8.0.0):
261+
- FirebaseAuth (~> 8.3.0)
262+
- Firebase/CoreOnly (8.3.0):
263+
- FirebaseCore (= 8.3.0)
264+
- Firebase/Firestore (8.3.0):
265265
- Firebase/CoreOnly
266-
- FirebaseFirestore (~> 8.0.0)
267-
- Firebase/Storage (8.0.0):
266+
- FirebaseFirestore (~> 8.3.0)
267+
- Firebase/Storage (8.3.0):
268268
- Firebase/CoreOnly
269-
- FirebaseStorage (~> 8.0.0)
270-
- firebase_auth (2.0.0):
271-
- Firebase/Auth (= 8.0.0)
269+
- FirebaseStorage (~> 8.3.0)
270+
- firebase_auth (3.0.1):
271+
- Firebase/Auth (= 8.3.0)
272272
- firebase_core
273273
- Flutter
274-
- firebase_core (1.3.0):
275-
- Firebase/CoreOnly (= 8.0.0)
274+
- firebase_core (1.4.0):
275+
- Firebase/CoreOnly (= 8.3.0)
276276
- Flutter
277-
- firebase_storage (9.0.0):
278-
- Firebase/Storage (= 8.0.0)
277+
- firebase_storage (10.0.1):
278+
- Firebase/Storage (= 8.3.0)
279279
- firebase_core
280280
- Flutter
281-
- FirebaseAuth (8.0.0):
281+
- FirebaseAuth (8.3.0):
282282
- FirebaseCore (~> 8.0)
283283
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
284284
- GoogleUtilities/Environment (~> 7.4)
285285
- GTMSessionFetcher/Core (~> 1.5)
286-
- FirebaseCore (8.0.0):
286+
- FirebaseCore (8.3.0):
287287
- FirebaseCoreDiagnostics (~> 8.0)
288288
- GoogleUtilities/Environment (~> 7.4)
289289
- GoogleUtilities/Logger (~> 7.4)
@@ -292,7 +292,7 @@ PODS:
292292
- GoogleUtilities/Environment (~> 7.4)
293293
- GoogleUtilities/Logger (~> 7.4)
294294
- nanopb (~> 2.30908.0)
295-
- FirebaseFirestore (8.0.0):
295+
- FirebaseFirestore (8.3.0):
296296
- abseil/algorithm (= 0.20200225.0)
297297
- abseil/base (= 0.20200225.0)
298298
- abseil/memory (= 0.20200225.0)
@@ -304,7 +304,7 @@ PODS:
304304
- "gRPC-C++ (~> 1.28.0)"
305305
- leveldb-library (~> 1.22)
306306
- nanopb (~> 2.30908.0)
307-
- FirebaseStorage (8.0.0):
307+
- FirebaseStorage (8.3.0):
308308
- FirebaseCore (~> 8.0)
309309
- GTMSessionFetcher/Core (~> 1.5)
310310
- Flutter (1.0.0)
@@ -432,19 +432,19 @@ EXTERNAL SOURCES:
432432
SPEC CHECKSUMS:
433433
abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f
434434
BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879
435-
cloud_firestore: 0e708a57ee3e13a56cf6a6fdaf085d5edb1e7e0f
435+
cloud_firestore: d6c77e2b33f00576fed2b070fec1be58d7e5f276
436436
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
437437
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
438438
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
439-
Firebase: 73c3e3b216ec1ecbc54d2ffdd4670c65c749edb1
440-
firebase_auth: 1e633b05c508081a0876749432ac742075b3f4f3
441-
firebase_core: cda81ae37eda6df2bc2d16027fda527987c4bd33
442-
firebase_storage: 915a6f20a4d114cdbac3b93eecce045e5b40eff3
443-
FirebaseAuth: b8cd992fca5b53dc6eec09e873a3f375f000c5a1
444-
FirebaseCore: 3f09591d51292843e2a46f18358d60bf4e996255
439+
Firebase: 817b9171d0d51dccc458b94a5e8edff6b1dd323d
440+
firebase_auth: 3b08d67bda60758347d15584fd0a7a4cf5f6496f
441+
firebase_core: 72374607c8c6f5a0adc0559e5c5bf57deda975e3
442+
firebase_storage: 0569941c22a1362f682ebef93755d8916601d22f
443+
FirebaseAuth: fd12c82de44e7ad3b821610c387b8251f03aa0f9
444+
FirebaseCore: a6dba751680d7033b9d3831e1cfc95ead0605118
445445
FirebaseCoreDiagnostics: 7e873baabcfaa9512f538554ae4fa0817aaafbdb
446-
FirebaseFirestore: 7f6576eaca9f821e864c3e917d68aa99f4e6b613
447-
FirebaseStorage: 61bcd27880fa17362f68be67d3683d04bfd7b1c7
446+
FirebaseFirestore: f4f42828c6d82f6945575611c23dd343e0e7d0aa
447+
FirebaseStorage: ff380720c204593d98c3e5482e62ccfbb522f0c5
448448
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
449449
GoogleDataTransport: 85fd18ff3019bb85d3f2c551d04c481dedf71fc9
450450
GoogleUtilities: eea970f4a389963963bffe8d8fabe43540678b9c

example/lib/chat.dart

Lines changed: 81 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -26,93 +26,52 @@ class ChatPage extends StatefulWidget {
2626
class _ChatPageState extends State<ChatPage> {
2727
bool _isAttachmentUploading = false;
2828

29-
void _handleAtachmentPress() {
29+
void _handleAtachmentPressed() {
3030
showModalBottomSheet<void>(
3131
context: context,
3232
builder: (BuildContext context) {
33-
return SizedBox(
34-
height: 180,
35-
child: Column(
36-
crossAxisAlignment: CrossAxisAlignment.stretch,
37-
children: <Widget>[
38-
TextButton(
39-
onPressed: () {
40-
Navigator.pop(context);
41-
_showFilePicker();
42-
},
43-
child: const Align(
44-
alignment: Alignment.centerLeft,
45-
child: Text('Open file picker'),
33+
return SafeArea(
34+
child: SizedBox(
35+
height: 144,
36+
child: Column(
37+
crossAxisAlignment: CrossAxisAlignment.stretch,
38+
children: <Widget>[
39+
TextButton(
40+
onPressed: () {
41+
Navigator.pop(context);
42+
_handleImageSelection();
43+
},
44+
child: const Align(
45+
alignment: Alignment.centerLeft,
46+
child: Text('Photo'),
47+
),
4648
),
47-
),
48-
TextButton(
49-
onPressed: () {
50-
Navigator.pop(context);
51-
_showImagePicker();
52-
},
53-
child: const Align(
54-
alignment: Alignment.centerLeft,
55-
child: Text('Open image picker'),
49+
TextButton(
50+
onPressed: () {
51+
Navigator.pop(context);
52+
_handleFileSelection();
53+
},
54+
child: const Align(
55+
alignment: Alignment.centerLeft,
56+
child: Text('File'),
57+
),
5658
),
57-
),
58-
TextButton(
59-
onPressed: () => Navigator.pop(context),
60-
child: const Align(
61-
alignment: Alignment.centerLeft,
62-
child: Text('Cancel'),
59+
TextButton(
60+
onPressed: () => Navigator.pop(context),
61+
child: const Align(
62+
alignment: Alignment.centerLeft,
63+
child: Text('Cancel'),
64+
),
6365
),
64-
),
65-
],
66+
],
67+
),
6668
),
6769
);
6870
},
6971
);
7072
}
7173

72-
void _handleMessageTap(types.Message message) async {
73-
if (message is types.FileMessage) {
74-
var localPath = message.uri;
75-
76-
if (message.uri.startsWith('http')) {
77-
final client = http.Client();
78-
final request = await client.get(Uri.parse(message.uri));
79-
final bytes = request.bodyBytes;
80-
final documentsDir = (await getApplicationDocumentsDirectory()).path;
81-
localPath = '$documentsDir/${message.name}';
82-
83-
if (!File(localPath).existsSync()) {
84-
final file = File(localPath);
85-
await file.writeAsBytes(bytes);
86-
}
87-
}
88-
89-
await OpenFile.open(localPath);
90-
}
91-
}
92-
93-
void _handlePreviewDataFetched(
94-
types.TextMessage message,
95-
types.PreviewData previewData,
96-
) {
97-
final updatedMessage = message.copyWith(previewData: previewData);
98-
99-
FirebaseChatCore.instance.updateMessage(updatedMessage, widget.room.id);
100-
}
101-
102-
void _handleSendPressed(types.PartialText message) {
103-
FirebaseChatCore.instance.sendMessage(
104-
message,
105-
widget.room.id,
106-
);
107-
}
108-
109-
void _setAttachmentUploading(bool uploading) {
110-
setState(() {
111-
_isAttachmentUploading = uploading;
112-
});
113-
}
114-
115-
void _showFilePicker() async {
74+
void _handleFileSelection() async {
11675
final result = await FilePicker.platform.pickFiles(
11776
type: FileType.any,
11877
);
@@ -141,13 +100,11 @@ class _ChatPageState extends State<ChatPage> {
141100
_setAttachmentUploading(false);
142101
print(e);
143102
}
144-
} else {
145-
// User canceled the picker
146103
}
147104
}
148105

149-
void _showImagePicker() async {
150-
final result = await ImagePicker().getImage(
106+
void _handleImageSelection() async {
107+
final result = await ImagePicker().pickImage(
151108
imageQuality: 70,
152109
maxWidth: 1440,
153110
source: ImageSource.gallery,
@@ -159,7 +116,7 @@ class _ChatPageState extends State<ChatPage> {
159116
final size = file.lengthSync();
160117
final bytes = await result.readAsBytes();
161118
final image = await decodeImageFromList(bytes);
162-
final name = result.path.split('/').last;
119+
final name = result.name;
163120

164121
try {
165122
final reference = FirebaseStorage.instance.ref(name);
@@ -183,11 +140,52 @@ class _ChatPageState extends State<ChatPage> {
183140
_setAttachmentUploading(false);
184141
print(e);
185142
}
186-
} else {
187-
// User canceled the picker
188143
}
189144
}
190145

146+
void _handleMessageTap(types.Message message) async {
147+
if (message is types.FileMessage) {
148+
var localPath = message.uri;
149+
150+
if (message.uri.startsWith('http')) {
151+
final client = http.Client();
152+
final request = await client.get(Uri.parse(message.uri));
153+
final bytes = request.bodyBytes;
154+
final documentsDir = (await getApplicationDocumentsDirectory()).path;
155+
localPath = '$documentsDir/${message.name}';
156+
157+
if (!File(localPath).existsSync()) {
158+
final file = File(localPath);
159+
await file.writeAsBytes(bytes);
160+
}
161+
}
162+
163+
await OpenFile.open(localPath);
164+
}
165+
}
166+
167+
void _handlePreviewDataFetched(
168+
types.TextMessage message,
169+
types.PreviewData previewData,
170+
) {
171+
final updatedMessage = message.copyWith(previewData: previewData);
172+
173+
FirebaseChatCore.instance.updateMessage(updatedMessage, widget.room.id);
174+
}
175+
176+
void _handleSendPressed(types.PartialText message) {
177+
FirebaseChatCore.instance.sendMessage(
178+
message,
179+
widget.room.id,
180+
);
181+
}
182+
183+
void _setAttachmentUploading(bool uploading) {
184+
setState(() {
185+
_isAttachmentUploading = uploading;
186+
});
187+
}
188+
191189
@override
192190
Widget build(BuildContext context) {
193191
return Scaffold(
@@ -206,7 +204,7 @@ class _ChatPageState extends State<ChatPage> {
206204
return Chat(
207205
isAttachmentUploading: _isAttachmentUploading,
208206
messages: snapshot.data ?? [],
209-
onAttachmentPressed: _handleAtachmentPress,
207+
onAttachmentPressed: _handleAtachmentPressed,
210208
onMessageTap: _handleMessageTap,
211209
onPreviewDataFetched: _handlePreviewDataFetched,
212210
onSendPressed: _handleSendPressed,

example/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ dependencies:
3030
cupertino_icons: ^1.0.3
3131
faker: ^2.0.0
3232
file_picker: ^3.0.3
33-
firebase_auth: ^2.0.0
34-
firebase_core: ^1.3.0
35-
firebase_storage: ^9.0.0
36-
flutter_chat_ui: ^1.1.7
33+
firebase_auth: ^3.0.1
34+
firebase_core: ^1.4.0
35+
firebase_storage: ^10.0.1
36+
flutter_chat_ui: ^1.1.8
3737
flutter_firebase_chat_core:
3838
path: ../
3939
http: ^0.13.3
40-
image_picker: ^0.8.1+3
40+
image_picker: ^0.8.2
4141
mime: ^1.0.0
4242
open_file: ^3.2.1
4343
path_provider: ^2.0.2

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flutter_firebase_chat_core
22
description: >
33
Actively maintained, community-driven Firebase BaaS for chat applications
44
with an optional chat UI.
5-
version: 1.1.1
5+
version: 1.1.2
66
homepage: https://flyer.chat
77
repository: https://github.com/flyerhq/flutter_firebase_chat_core
88

@@ -13,8 +13,8 @@ environment:
1313
dependencies:
1414
flutter:
1515
sdk: flutter
16-
cloud_firestore: ^2.3.0
17-
firebase_auth: ^2.0.0
16+
cloud_firestore: ^2.4.0
17+
firebase_auth: ^3.0.1
1818
flutter_chat_types: ^2.4.0
1919
meta: ^1.3.0
2020

0 commit comments

Comments
 (0)