Skip to content

Commit

Permalink
Merge pull request #6 from ankesh-kumar/1.1.1
Browse files Browse the repository at this point in the history
dependency updated
  • Loading branch information
ankesh-kumar authored Mar 10, 2021
2 parents 188e967 + 74f9a21 commit d610bb0
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## version 1.1.1 dependencies updated
## version 1.1.0 Chat with added friends only (privacy)
## version 1.0.0 dependencies updated
## version 0.1.4 user online/offline status
Expand Down
2 changes: 1 addition & 1 deletion lib/chatDB.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ChatDBFireStore {
.collection(getDocName())
.where('userId', isEqualTo: logInUser.uid)
.get();
final List<DocumentSnapshot> documents = result.documents;
final List<DocumentSnapshot> documents = result.docs;
if (documents.length == 0) {
// Update data to server if new user
await saveNewUser(logInUser);
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Chat extends StatelessWidget {
final String peerName;
final String currentUserId;
static const String id = "chat";

Chat(
{Key key,
@required this.currentUserId,
Expand Down Expand Up @@ -132,13 +133,13 @@ class _ChatScreenState extends State<_ChatScreen> {

Future uploadFile() async {
String fileName = DateTime.now().millisecondsSinceEpoch.toString();
StorageReference reference = FirebaseStorage.instance.ref().child(fileName);
Reference reference = FirebaseStorage.instance.ref().child(fileName);

File compressedFile = await FlutterNativeImage.compressImage(imageFile.path,
quality: 80, percentage: 90);

StorageUploadTask uploadTask = reference.putFile(compressedFile);
StorageTaskSnapshot storageTaskSnapshot = await uploadTask.onComplete;
UploadTask uploadTask = reference.putFile(compressedFile);
TaskSnapshot storageTaskSnapshot = await uploadTask;
storageTaskSnapshot.ref.getDownloadURL().then((downloadUrl) {
imageUrl = downloadUrl;
setState(() {
Expand Down
69 changes: 36 additions & 33 deletions lib/screens/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ List<dynamic> friendList = [];
class DashboardScreen extends StatefulWidget {
static const String id = "dashboard_screen";
final String currentUserId;

DashboardScreen({Key key, @required this.currentUserId}) : super(key: key);

@override
Expand Down Expand Up @@ -85,39 +86,41 @@ class _DashboardScreenState extends State<DashboardScreen> {

_showAddFriendDialog() async {
await showDialog<String>(
context: context,
child: new _SystemPadding(
child: new AlertDialog(
contentPadding: const EdgeInsets.all(16.0),
content: new Row(
children: <Widget>[
new Expanded(
child: new TextField(
autofocus: true,
controller: friendController,
decoration: new InputDecoration(
labelText: 'user Email', hintText: '[email protected]'),
),
)
],
),
actions: <Widget>[
new FlatButton(
child: const Text('CANCEL'),
onPressed: () {
Navigator.pop(context);
}),
new FlatButton(
child: const Text('Add'),
onPressed: () {
print(friendController.text);
//if(friendController.text!='')
_addNewFriend();
})
],
),
),
);
context: context,
builder: (context) {
return _SystemPadding(
child: new AlertDialog(
contentPadding: const EdgeInsets.all(16.0),
content: new Row(
children: <Widget>[
new Expanded(
child: new TextField(
autofocus: true,
controller: friendController,
decoration: new InputDecoration(
labelText: 'user Email',
hintText: '[email protected]'),
),
)
],
),
actions: <Widget>[
new TextButton(
child: const Text('CANCEL'),
onPressed: () {
Navigator.pop(context);
}),
new TextButton(
child: const Text('Add'),
onPressed: () {
print(friendController.text);
//if(friendController.text!='')
_addNewFriend();
})
],
),
);
});
}

void _addNewFriend() {
Expand Down
1 change: 1 addition & 0 deletions lib/screens/zoomImage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '../constants.dart';
class ZoomImage extends StatelessWidget {
final String url;
static const String id = "ZoomImage";

ZoomImage({Key key, @required this.url}) : super(key: key);

@override
Expand Down
71 changes: 59 additions & 12 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,88 @@
name: flutter_chat
description: Social Chat for Flutter android and iOS using firebase as backend services.

version: 1.1.0
version: 1.1.1
homepage: https://github.com/ankesh-kumar/Flutter-chat-sdk

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.0
firebase_core: ^0.5.0
firebase_auth: ^0.18.0+1
firebase_analytics: ^6.0.0
firebase_storage: ^4.0.0
firebase_messaging: ^7.0.0
cloud_firestore: ^0.14.0+2
rxdart: ^0.26.0
shared_preferences: ^2.0.3
firebase_core: ^0.7.0
firebase_auth: ^0.20.1
firebase_analytics: ^7.0.1
firebase_storage: ^7.0.0
firebase_messaging: ^8.0.0-dev.15
cloud_firestore: ^0.16.0+1
fluttertoast: ^7.1.1
image_picker: ^0.6.2+3
photo_view: ^0.10.2
photo_view: ^0.11.1
google_sign_in: ^4.0.4
flutter_native_image: ^0.0.4
cached_network_image: ^2.0.0-rc
flutter_dialogflow: ^0.1.3
intl: ^0.16.0
firebase_database: ^4.0.0

firebase_database: ^6.0.0
bloc: ^6.0.3
flutter_bloc: ^6.0.6
equatable: ^2.0.0


dev_dependencies:
flutter_test:
sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true


assets:
- images/
- images/

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

0 comments on commit d610bb0

Please sign in to comment.