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

multiple bug fixes and new features added #112

Merged
merged 25 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2407696
add tooltip
kshitijalwadhi Jun 5, 2020
4c22185
fix colour schemes in auth
kshitijalwadhi Jun 5, 2020
093435e
update destinations and corresponding icons
kshitijalwadhi Jun 5, 2020
d50773c
fixed a major message screen bug
kshitijalwadhi Jun 6, 2020
68faca8
fix leave group button bug
kshitijalwadhi Jun 6, 2020
c8b3679
group leave button fixed
kshitijalwadhi Jun 6, 2020
789b70e
Merge branch 'master' into misc
kshitijalwadhi Jun 6, 2020
f79485c
small fix
kshitijalwadhi Jun 6, 2020
a84fa50
Merge branch 'master' into misc
kshitijalwadhi Jun 6, 2020
1fd207c
Merge branch 'master' into misc
kshitijalwadhi Jun 10, 2020
5254790
Merge branch 'master' into misc
kshitijalwadhi Jun 11, 2020
98ec724
Merge branch 'master' into misc
kshitijalwadhi Jun 13, 2020
55facb6
added option to change email after registration
kshitijalwadhi Jun 13, 2020
c5ee9c9
Merge branch 'master' into misc
kshitijalwadhi Jun 17, 2020
8d5a37d
fix ordering in dashboard
kshitijalwadhi Jun 17, 2020
56f1608
confirm password field added on registration page
kshitijalwadhi Jun 17, 2020
e4e4d86
fix user profile UI
kshitijalwadhi Jun 17, 2020
e509c45
Report bug button added in settings
kshitijalwadhi Jun 17, 2020
28a4a53
fixed FAB which showed before inGroup was fetched
kshitijalwadhi Jun 17, 2020
f3548d9
deleting the group if last member leaves
kshitijalwadhi Jun 17, 2020
5bc1f08
end trip added and saving previous groups too
kshitijalwadhi Jun 17, 2020
edf9690
fixed saving array of users in group document
kshitijalwadhi Jun 17, 2020
d8a5a94
Merge branch 'master' into misc
kshitijalwadhi Jun 19, 2020
46680e2
fix ProgressBar
kshitijalwadhi Jun 19, 2020
d057a96
fix renderflex overflow bug
kshitijalwadhi Jun 19, 2020
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
31 changes: 31 additions & 0 deletions lib/screens/authenticate/register.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class _RegisterState extends State<Register> {

String email = '';
String password = '';
String confirmpass = '';
String name = '';
String mobileNum = '';
String hostel;
Expand Down Expand Up @@ -144,6 +145,36 @@ class _RegisterState extends State<Register> {
},
),
SizedBox(height: 20.0),
TextFormField(
decoration: textInputDecoration.copyWith(
hintText: 'Confirm Password',
suffixIcon: IconButton(
icon: Icon(
passwordHide ? Icons.visibility_off : Icons.visibility,
color: Theme.of(context).accentColor,
),
onPressed: () {
setState(() {
passwordHide = !passwordHide;
});
},
),
),
validator: (val) {
if (val.length < 6) {
return 'Enter a password greater than 6 characters.';
}
if (val != password) {
return 'Password not matching';
}
return null;
},
obscureText: passwordHide,
onChanged: (val) {
setState(() => confirmpass = val);
},
),
SizedBox(height: 20.0),
TextFormField(
decoration: textInputDecoration.copyWith(hintText: 'Name'),
validator: (val) => val.isEmpty ? 'Enter a valid Name' : null,
Expand Down
59 changes: 32 additions & 27 deletions lib/screens/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,20 @@ class _DashboardState extends State<Dashboard> {
return null;
}

var inGroupFetch = false;
@override
Widget build(BuildContext context) {
final currentuser = Provider.of<FirebaseUser>(context);
Firestore.instance.collection('userdetails').document(currentuser.uid).get().then((value) {
if (value.data['currentGroup'] != null) {
setState(() {
inGroup = true;
inGroupFetch = true;
});
} else {
setState(() {
inGroup = false;
inGroupFetch = true;
});
}
});
Expand Down Expand Up @@ -135,33 +138,35 @@ class _DashboardState extends State<Dashboard> {
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
floatingActionButton: !inGroup
? Padding(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 60),
child: FloatingActionButton(
splashColor: Theme.of(context).primaryColor,
onPressed: () => _startCreatingTrip(context),
child: Tooltip(
message: 'Create Group',
verticalOffset: -60,
child: Icon(Icons.add),
),
),
)
: Padding(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 60),
child: FloatingActionButton(
splashColor: Theme.of(context).primaryColor,
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => GroupPage()));
},
child: Tooltip(
message: 'Group Details',
verticalOffset: -60,
child: Icon(Icons.group),
),
),
),
floatingActionButton: inGroupFetch
? !inGroup
? Padding(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 60),
child: FloatingActionButton(
splashColor: Theme.of(context).primaryColor,
onPressed: () => _startCreatingTrip(context),
child: Tooltip(
message: 'Create Group',
verticalOffset: -60,
child: Icon(Icons.add),
),
),
)
: Padding(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 60),
child: FloatingActionButton(
splashColor: Theme.of(context).primaryColor,
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => GroupPage()));
},
child: Tooltip(
message: 'Group Details',
verticalOffset: -60,
child: Icon(Icons.group),
),
),
)
: null,
);
}
}
112 changes: 82 additions & 30 deletions lib/screens/groupscreen/group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class _GroupPageState extends State<GroupPage> with AutomaticKeepAliveClientMixi
}

bool buttonEnabled = true;
Timestamp endTimeStamp = Timestamp.now();
bool timestampFlag = false;

@override
bool get wantKeepAlive => true;
Expand All @@ -65,46 +67,96 @@ class _GroupPageState extends State<GroupPage> with AutomaticKeepAliveClientMixi
end = DateFormat('dd.MM.yyyy - kk:mm a').format(value.data['end'].toDate());
grpOwner = value.data['owner'];
presentNum = value.data['numberOfMembers'].toString();
endTimeStamp = value.data['end'];
loading = false;
});
if (endTimeStamp.compareTo(Timestamp.now()) < 0) {
setState(() {
timestampFlag = true;
});
}
}
});

return loading
? Loading()
: Scaffold(
appBar: AppBar(
title: Text('Group Details'),
actions: <Widget>[
FlatButton.icon(
textColor: getVisibleColorOnPrimaryColor(context),
icon: Icon(FontAwesomeIcons.signOutAlt),
onPressed: () async {
ProgressDialog pr;
pr = ProgressDialog(context, type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
pr.style(
message: 'Leaving Group...',
backgroundColor: Theme.of(context).backgroundColor,
messageTextStyle: TextStyle(color: Theme.of(context).accentColor),
);
await pr.show();
await Future.delayed(Duration(seconds: 1)); // sudden logout will show ProgressDialog for a very short time making it not very nice to see :p
try {
setState(() {
buttonEnabled = false;
});
await _request.exitGroup();
Navigator.pop(context);
await pr.hide();
} catch (err) {
// show e.message
await pr.hide();
String errStr = err.message ?? err.toString();
final snackBar = SnackBar(content: Text(errStr), duration: Duration(seconds: 3));
scaffoldKey.currentState.showSnackBar(snackBar);
}
},
label: Text('Leave Group'),
)
buttonEnabled
? timestampFlag
? FlatButton.icon(
textColor: getVisibleColorOnPrimaryColor(context),
icon: Icon(FontAwesomeIcons.signOutAlt),
onPressed: () async {
ProgressDialog pr;
pr = ProgressDialog(context, type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
pr.style(
message: 'Ending Trip...',
backgroundColor: Theme.of(context).backgroundColor,
messageTextStyle: TextStyle(color: Theme.of(context).accentColor),
);
await pr.show();
await Future.delayed(Duration(seconds: 1));
try {
setState(() {
buttonEnabled = false;
});
await _request.exitGroup();
Navigator.pop(context);
await pr.hide();
} catch (e) {
await pr.hide();
String errStr = e.message ?? e.toString();
final snackBar = SnackBar(content: Text(errStr), duration: Duration(seconds: 3));
scaffoldKey.currentState.showSnackBar(snackBar);
}
},
label: Text('End Trip'),
)
: FlatButton.icon(
textColor: getVisibleColorOnPrimaryColor(context),
icon: Icon(FontAwesomeIcons.signOutAlt),
onPressed: () async {
ProgressDialog pr;
pr = ProgressDialog(context, type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
pr.style(
message: 'Leaving Group...',
backgroundColor: Theme.of(context).backgroundColor,
messageTextStyle: TextStyle(color: Theme.of(context).accentColor),
);
await pr.show();
await Future.delayed(Duration(seconds: 1));
try {
setState(() {
buttonEnabled = false;
});
await _request.exitGroup();
Navigator.pop(context);
await pr.hide();
} catch (e) {
await pr.hide();
String errStr = e.message ?? e.toString();
final snackBar = SnackBar(content: Text(errStr), duration: Duration(seconds: 3));
scaffoldKey.currentState.showSnackBar(snackBar);
}
},
label: Text('Leave Group'),
)
: timestampFlag
? FlatButton.icon(
textColor: getVisibleColorOnPrimaryColor(context),
icon: Icon(FontAwesomeIcons.signOutAlt),
onPressed: null,
label: Text('End Trip'),
)
: FlatButton.icon(
textColor: getVisibleColorOnPrimaryColor(context),
icon: Icon(FontAwesomeIcons.signOutAlt),
onPressed: null,
label: Text('Leave Group'),
)
],
),
body: Container(
Expand Down
6 changes: 5 additions & 1 deletion lib/screens/profile/userprofile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class _MyProfileState extends State<MyProfile> {
onTap: () {},
title: Center(
child: Text(
'Gender',
'GENDER',
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 20),
),
),
Expand All @@ -220,6 +220,7 @@ class _MyProfileState extends State<MyProfile> {
title: Center(
child: Text(
'TOTAL RIDES',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18),
),
),
Expand All @@ -237,6 +238,7 @@ class _MyProfileState extends State<MyProfile> {
title: Center(
child: Text(
'CANCELLED TRIPS',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18),
),
),
Expand Down Expand Up @@ -292,6 +294,7 @@ class _MyProfileState extends State<MyProfile> {
title: Center(
child: Text(
'MOBILE NUMBER',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18),
),
),
Expand All @@ -308,6 +311,7 @@ class _MyProfileState extends State<MyProfile> {
title: Center(
child: Text(
'USER RATING',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18),
),
),
Expand Down
23 changes: 23 additions & 0 deletions lib/screens/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:shareacab/main.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:shareacab/services/auth.dart';
import 'package:progress_dialog/progress_dialog.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
Expand Down Expand Up @@ -81,6 +82,28 @@ class _SettingsState extends State<Settings> {
),
),
),
ListTile(
title: Text(
'Bug Report',
style: TextStyle(fontSize: 28.0),
),
contentPadding: EdgeInsets.all(26.0),
subtitle: Text('Found a bug, report here:'),
trailing: Tooltip(
message: 'Report Bug',
verticalOffset: -60,
child: IconButton(
icon: Icon(
Icons.bug_report,
size: 40.0,
color: Theme.of(context).accentColor,
),
onPressed: () {
launch('https://github.com/devclub-iitd/ShareACab/issues/new?assignees=&labels=bug&template=bug_report.md&title=Issue+Title+%40AssignedUser');
},
),
),
),
],
));
}
Expand Down