Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes and improvements. #115

Merged
merged 4 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/screens/chatscreen/chat_widgets/new_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class _NewMessageState extends State<NewMessage> {
final user = await FirebaseAuth.instance.currentUser();
final userData = await Firestore.instance.collection('userdetails').document(user.uid).get();
await Firestore.instance.collection('chatroom').document(widget.docId).updateData({
'lastMessage' : Timestamp.now(),
'lastMessage': Timestamp.now(),
});
await Firestore.instance.collection('chatroom').document(widget.docId).collection('chats').add({
'text': _enteredMessage,
Expand All @@ -37,7 +37,7 @@ class _NewMessageState extends State<NewMessage> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 8),
margin: EdgeInsets.only(top: 8, bottom: 12),
padding: EdgeInsets.all(8),
child: Row(
children: <Widget>[
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/createtrip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class _CreateTripState extends State<CreateTrip> {
top: 20,
left: 40,
),
width: MediaQuery.of(context).size.width * 0.7,
width: MediaQuery.of(context).size.width * 0.8,
child: DropdownButtonFormField<String>(
icon: Icon(
Icons.keyboard_arrow_down,
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Dashboard extends StatefulWidget {
_DashboardState createState() => _DashboardState();
}

class _DashboardState extends State<Dashboard> {
class _DashboardState extends State<Dashboard> with AutomaticKeepAliveClientMixin<Dashboard> {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
final AuthService _auth = AuthService();
// List<RequestDetails> _listOfTrips = allTrips;
Expand Down Expand Up @@ -81,6 +81,7 @@ class _DashboardState extends State<Dashboard> {
var inGroupFetch = false;
@override
Widget build(BuildContext context) {
super.build(context);
final currentuser = Provider.of<FirebaseUser>(context);
Firestore.instance.collection('userdetails').document(currentuser.uid).get().then((value) {
if (value.data['currentGroup'] != null) {
Expand Down Expand Up @@ -169,4 +170,6 @@ class _DashboardState extends State<Dashboard> {
: null,
);
}
@override
bool get wantKeepAlive => true;
}
6 changes: 5 additions & 1 deletion lib/screens/groupdetailscreen/groupdetails.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class GroupDetails extends StatefulWidget {
_GroupDetailsState createState() => _GroupDetailsState();
}

class _GroupDetailsState extends State<GroupDetails> {
class _GroupDetailsState extends State<GroupDetails> with AutomaticKeepAliveClientMixin<GroupDetails>{
final RequestService _request = RequestService();

Future getUserDetails() async {
Expand All @@ -57,6 +57,7 @@ class _GroupDetailsState extends State<GroupDetails> {

@override
Widget build(BuildContext context) {
super.build(context);
final currentuser = Provider.of<FirebaseUser>(context);
Firestore.instance.collection('userdetails').document(currentuser.uid).get().then((value) {
if (value.data['currentGroup'] != null && mounted) {
Expand Down Expand Up @@ -318,4 +319,7 @@ class _GroupDetailsState extends State<GroupDetails> {
),
));
}
@override
bool get wantKeepAlive => true;

}
5 changes: 2 additions & 3 deletions lib/screens/groupscreen/group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class _GroupPageState extends State<GroupPage> with AutomaticKeepAliveClientMixi
Timestamp endTimeStamp = Timestamp.now();
bool timestampFlag = false;

@override
bool get wantKeepAlive => true;

@override
Widget build(BuildContext context) {
super.build(context);
Expand Down Expand Up @@ -387,6 +384,8 @@ class _GroupPageState extends State<GroupPage> with AutomaticKeepAliveClientMixi
),
);
}
@override
bool get wantKeepAlive => true;
}

class Members {
Expand Down
6 changes: 5 additions & 1 deletion lib/screens/notifications/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Notifications extends StatefulWidget {
_NotificationsState createState() => _NotificationsState();
}

class _NotificationsState extends State<Notifications> {
class _NotificationsState extends State<Notifications> with AutomaticKeepAliveClientMixin<Notifications> {
List<Notification> notifications = [
Notification(heading: 'Demo -1', message: 'This is one of the demo notifications and the message can be a very long text extending upto many lines and the card would adjust the size accordingly', type: 'Normal', dateTime: '20/05/2020'),
Notification(heading: 'Warning', message: 'It has come to our notice that you are spamming different groups and disturbing the normal working of the app. We are thus giving you a warning. Any such behavior in future from your side may force us to ban you from using this app', type: 'Warning', dateTime: '20/05/2020'),
Expand All @@ -18,6 +18,7 @@ class _NotificationsState extends State<Notifications> {
];
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
appBar: AppBar(
title: Text('My Notifications'),
Expand Down Expand Up @@ -66,6 +67,9 @@ class _NotificationsState extends State<Notifications> {
},
itemCount: notifications.length));
}

@override
bool get wantKeepAlive => true;
}

class Notification {
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/profile/userprofile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MyProfile extends StatefulWidget {
_MyProfileState createState() => _MyProfileState();
}

class _MyProfileState extends State<MyProfile> {
class _MyProfileState extends State<MyProfile> with AutomaticKeepAliveClientMixin<MyProfile> {
FirebaseUser currentUser;
var namefirst = 'P';
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
Expand Down Expand Up @@ -63,6 +63,7 @@ class _MyProfileState extends State<MyProfile> {

@override
Widget build(BuildContext context) {
super.build(context);
final currentuser = Provider.of<FirebaseUser>(context);

//print(currentuser.uid);
Expand Down Expand Up @@ -359,6 +360,8 @@ class _MyProfileState extends State<MyProfile> {
),
);
}
@override
bool get wantKeepAlive => true;
}

//class User {
Expand Down
6 changes: 5 additions & 1 deletion lib/screens/requests/myrequests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ class MyRequests extends StatefulWidget {
_MyRequestsState createState() => _MyRequestsState();
}

class _MyRequestsState extends State<MyRequests> {
class _MyRequestsState extends State<MyRequests> with AutomaticKeepAliveClientMixin<MyRequests> {
List<Requests> requests = [
Requests(name: 'Demo Request Trip-1', destination: 'New Delhi Railway Station', id: '1', status: 'Pending'),
Requests(name: 'Demo Request Trip-2', destination: 'IGI Airport', id: '1', status: 'Accepted'),
Requests(name: 'Demo Request Trip-3', destination: 'New Delhi Railway Station', id: '1', status: 'Rejected'),
];
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
appBar: AppBar(
title: Text('My Requests'),
Expand Down Expand Up @@ -183,7 +184,10 @@ class _MyRequestsState extends State<MyRequests> {
);
},
itemCount: requests.length));

}
@override
bool get wantKeepAlive => true;
}

class Requests {
Expand Down
18 changes: 9 additions & 9 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ packages:
name: cloud_firestore
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.5"
version: "0.13.7"
cloud_firestore_platform_interface:
dependency: transitive
description:
name: cloud_firestore_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.2"
cloud_firestore_web:
dependency: transitive
description:
Expand Down Expand Up @@ -91,7 +91,7 @@ packages:
name: curved_navigation_bar
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
version: "0.3.3"
firebase:
dependency: transitive
description:
Expand All @@ -112,7 +112,7 @@ packages:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.4+3"
version: "0.4.5"
firebase_core_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -197,7 +197,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+1"
version: "0.6.2"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -260,7 +260,7 @@ packages:
name: progress_dialog
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.3"
version: "1.2.4"
provider:
dependency: "direct main"
description:
Expand Down Expand Up @@ -288,14 +288,14 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.7+2"
version: "0.5.7+3"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+9"
version: "0.0.1+10"
shared_preferences_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -370,7 +370,7 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "5.4.10"
version: "5.4.11"
url_launcher_macos:
dependency: transitive
description:
Expand Down