Skip to content

Commit 8e336f7

Browse files
Merge branch 'beta'
2 parents aeff3d4 + 4f0cf66 commit 8e336f7

17 files changed

+790
-863
lines changed

android/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ android {
3131
applicationId "com.groovinchip.flutter.callmanager"
3232
minSdkVersion 16
3333
targetSdkVersion 27
34-
versionCode 9
35-
versionName "1.4"
34+
versionCode 13
35+
versionName "1.6"
3636
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
37+
//setProperty("archivesBaseName", applicationId + "_" + versionName)
3738
}
3839

3940
signingConfigs {

assets/glogo.png

4.55 KB
Loading

lib/HomeScreen.dart

Lines changed: 0 additions & 532 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class _AboutScreenState extends State<AboutScreen> {
3737
@override
3838
Widget build(BuildContext context) {
3939
return Scaffold(
40-
backgroundColor: Colors.white,
40+
backgroundColor: Theme.of(context).canvasColor,
4141
body: SafeArea(
4242
child: SingleChildScrollView(
4343
child: Center(
Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'dart:async';
2-
import 'package:call_manager/lnp.dart';
2+
import 'package:call_manager/pass_notification.dart';
33
import 'package:flutter/material.dart';
44
import 'package:contact_picker/contact_picker.dart';
55
import 'package:flutter/services.dart';
@@ -45,7 +45,7 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
4545
@override
4646
Widget build(BuildContext context) {
4747
return Scaffold(
48-
backgroundColor: Colors.white,
48+
backgroundColor: Theme.of(context).canvasColor,
4949
body: SafeArea(
5050
child: ListView(
5151
children: <Widget>[
@@ -76,21 +76,17 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
7676
labelText: 'Name (Required)',
7777
),
7878
),
79-
trailing: Material(
80-
child: IconButton(
81-
icon: Icon(Icons.contacts),
82-
onPressed: () async {
83-
Contact contact = await _contactPicker.selectContact();
84-
setState(() {
85-
_contact = contact;
86-
_nameFieldController.text = _contact.fullName;
87-
_phoneFieldController.text = _contact.phoneNumber.number;
88-
});
89-
},
90-
),
91-
color: Color(0xFFE0E0E0),
92-
elevation: 2.0,
93-
borderRadius: BorderRadius.all(Radius.circular(5.0)),
79+
trailing: IconButton(
80+
icon: Icon(Icons.contacts),
81+
onPressed: () async {
82+
Contact contact = await _contactPicker.selectContact();
83+
setState(() {
84+
_contact = contact;
85+
_nameFieldController.text = _contact.fullName;
86+
_phoneFieldController.text = _contact.phoneNumber.number;
87+
});
88+
},
89+
tooltip: "Choose from Contacts",
9490
),
9591
),
9692
ListTile(
@@ -124,9 +120,7 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
124120
Padding(
125121
padding:
126122
const EdgeInsets.only(right: 16.0, left: 16.0, top: 12.0),
127-
child: Divider(
128-
color: Colors.black,
129-
),
123+
child: Divider(),
130124
),
131125
Row(
132126
children: <Widget>[
@@ -220,7 +214,7 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
220214
NotificationDetails platformChannelSpecifics = new NotificationDetails(
221215
androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
222216

223-
await LNP.of(context).schedule(
217+
await PassNotification.of(context).schedule(
224218
0,
225219
'Call Reminder',
226220
"Don't forget to call " + _nameFieldController.text + "!",
@@ -259,16 +253,8 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
259253
);
260254
}
261255
),
262-
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
256+
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
263257
bottomNavigationBar: Container(
264-
decoration: BoxDecoration(
265-
boxShadow: [
266-
BoxShadow(
267-
color: Colors.grey[200],
268-
spreadRadius: 3.0,
269-
)
270-
],
271-
),
272258
child: BottomAppBar(
273259
//hasNotch: false,
274260
child: Row(
@@ -281,7 +267,6 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
281267
onPressed: () {
282268
Navigator.pop(context);
283269
},
284-
color: Colors.black,
285270
),
286271
),
287272
],
@@ -290,4 +275,4 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
290275
),
291276
);
292277
}
293-
}
278+
}

lib/bottom_sheets.dart

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
import 'package:call_manager/about_screen.dart';
2+
import 'package:call_manager/utils/page_transitions.dart';
3+
import 'package:cloud_firestore/cloud_firestore.dart';
4+
import 'package:dynamic_theme/dynamic_theme.dart';
5+
import 'package:firebase_auth/firebase_auth.dart';
6+
import 'package:flutter/material.dart';
7+
import 'package:groovin_material_icons/groovin_material_icons.dart';
8+
import 'package:modal_drawer_handle/modal_drawer_handle.dart';
9+
import 'package:rounded_modal/rounded_modal.dart';
10+
import 'package:call_manager/globals.dart' as globals;
11+
12+
class BottomSheets {
13+
BuildContext context;
14+
15+
BottomSheets(this.context);
16+
17+
void changeBrightness() {
18+
DynamicTheme.of(context).setBrightness(Theme.of(context).brightness == Brightness.dark? Brightness.light: Brightness.dark);
19+
}
20+
21+
void showBottomAppBarSheet() {
22+
showRoundedModalBottomSheet(
23+
color: Theme.of(context).canvasColor,
24+
context: context,
25+
builder: (builder){
26+
return Container(
27+
child: SingleChildScrollView(
28+
child: Column(
29+
mainAxisSize: MainAxisSize.min,
30+
children: <Widget>[
31+
Padding(
32+
padding: const EdgeInsets.only(top: 8.0),
33+
child: ModalDrawerHandle(),
34+
),
35+
ListTile(
36+
leading: CircleAvatar(
37+
child: Text(globals.loggedInUser.displayName[0], style: TextStyle(color: Colors.white),),
38+
backgroundColor: Colors.blue[700],
39+
),
40+
title: Text(globals.loggedInUser.displayName),
41+
subtitle: Text(globals.loggedInUser.email),
42+
/*leading: Icon(Icons.account_circle, size: 45.0,),
43+
title: Text(globals.loggedInUser.displayName),
44+
subtitle: Text(globals.loggedInUser.email),*/
45+
),
46+
Divider(
47+
color: Colors.grey,
48+
height: 0.0,
49+
),
50+
Material(
51+
child: ListTile(
52+
title: Text("Delete All Calls"),
53+
leading: Icon(Icons.clear_all),
54+
onTap: () {
55+
Navigator.pop(context);
56+
showDialog(
57+
context: context,
58+
builder: (_) => AlertDialog(
59+
title: Text("Delete All Calls"),
60+
content: Text("Are you sure you want to delete all calls? This cannot be undone."),
61+
actions: <Widget>[
62+
FlatButton(
63+
onPressed: (){
64+
Navigator.pop(context);
65+
},
66+
child: Text("No"),
67+
),
68+
FlatButton(
69+
onPressed: () async {
70+
Navigator.pop(context);
71+
CollectionReference ref = Firestore.instance.collection("Users").document(globals.loggedInUser.uid).collection("Calls");
72+
QuerySnapshot s = await ref.getDocuments();
73+
if(s.documents.length == 0){
74+
final snackBar = SnackBar(
75+
content: Text("There are no calls to delete"),
76+
action: SnackBarAction(
77+
label: 'Dismiss',
78+
onPressed: () {
79+
80+
}
81+
),
82+
duration: Duration(seconds: 3),
83+
);
84+
Scaffold.of(context).showSnackBar(snackBar);
85+
} else {
86+
for(int i = 0; i < s.documents.length; i++) {
87+
DocumentReference d = s.documents[i].reference;
88+
d.delete();
89+
}
90+
}
91+
},
92+
child: Text("Yes"),
93+
),
94+
],
95+
),
96+
);
97+
},
98+
),
99+
),
100+
Material(
101+
child: ListTile(
102+
leading: Icon(Icons.brightness_6),
103+
title: Text("Toggle Dark Theme"),
104+
onTap: () {
105+
changeBrightness();
106+
Navigator.pop(context);
107+
},
108+
),
109+
),
110+
Material(
111+
child: ListTile(
112+
title: Text("Log Out"),
113+
leading: Icon(GroovinMaterialIcons.logout),
114+
onTap: (){
115+
Navigator.pop(context);
116+
showDialog(
117+
context: context,
118+
builder: (_) => AlertDialog(
119+
title: Text("Log Out"),
120+
content: Text("Are you sure you want to log out?"),
121+
actions: <Widget>[
122+
FlatButton(
123+
onPressed: (){
124+
Navigator.pop(context);
125+
},
126+
child: Text("No"),
127+
),
128+
FlatButton(
129+
onPressed: (){
130+
FirebaseAuth.instance.signOut();
131+
Navigator.of(context).pushNamedAndRemoveUntil('/',(Route<dynamic> route) => false);
132+
},
133+
child: Text("Yes"),
134+
),
135+
],
136+
),
137+
);
138+
},
139+
),
140+
),
141+
Divider(
142+
color: Colors.grey,
143+
height: 0.0,
144+
),
145+
Material(
146+
child: ListTile(
147+
title: Text("About"),
148+
leading: Icon(Icons.info_outline),
149+
onTap: (){
150+
Navigator.pop(context);
151+
//Navigator.of(context).pushNamed("/AboutScreen");
152+
Navigator.push(
153+
context,
154+
SlideLeftRoute(widget: AboutScreen())
155+
);
156+
},
157+
),
158+
),
159+
],
160+
),
161+
),
162+
);
163+
}
164+
);
165+
}
166+
}

0 commit comments

Comments
 (0)