Skip to content

Commit e753448

Browse files
committed
UI updates
1 parent e4ff21b commit e753448

4 files changed

Lines changed: 119 additions & 145 deletions

File tree

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ android {
3131
applicationId "com.groovinchip.flutter.callmanager"
3232
minSdkVersion 16
3333
targetSdkVersion 27
34-
versionCode 15
35-
versionName "1.7"
34+
versionCode 16
35+
versionName "1.8"
3636
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3737
//setProperty("archivesBaseName", applicationId + "_" + versionName)
3838
}

lib/add_new_call_screen.dart

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
4343
TimeOfDay reminderTime;
4444

4545
final formKey = GlobalKey<FormState>();
46-
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
4746

4847
void saveCall() async {
4948
if(formKey.currentState.validate()){
@@ -289,74 +288,6 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
289288
backgroundColor: Colors.blue[700],
290289
onPressed: () async {
291290
saveCall();
292-
/*if (_nameFieldController.text.toString() == "" ||
293-
_phoneFieldController.text.toString() == "") {
294-
final snackBar = SnackBar(
295-
content: Text("Please enter required fields"),
296-
action: SnackBarAction(label: 'Dismiss', onPressed: () {}),
297-
duration: Duration(seconds: 3),
298-
);
299-
Scaffold.of(fabContext).showSnackBar(snackBar);
300-
} else {
301-
try {
302-
CollectionReference userCalls = Firestore.instance
303-
.collection("Users")
304-
.document(globals.loggedInUser.uid)
305-
.collection("Calls");
306-
String date;
307-
String time;
308-
if (reminderDate != null && reminderTime != null) {
309-
var scheduledNotificationDateTime = DateTime(
310-
reminderDate.year,
311-
reminderDate.month,
312-
reminderDate.day,
313-
reminderTime.hour,
314-
reminderTime.minute,
315-
);
316-
var androidPlatformChannelSpecifics =
317-
new AndroidNotificationDetails(
318-
'1',
319-
'Call Reminders',
320-
'Allow Call Manager to create and send notifications about Call Reminders',
321-
);
322-
323-
var iOSPlatformChannelSpecifics =
324-
new IOSNotificationDetails();
325-
326-
NotificationDetails platformChannelSpecifics =
327-
new NotificationDetails(androidPlatformChannelSpecifics,
328-
iOSPlatformChannelSpecifics);
329-
330-
await PassNotification.of(context).schedule(
331-
0,
332-
'Call Reminder',
333-
"Don't forget to call " + _nameFieldController.text + "!",
334-
scheduledNotificationDateTime,
335-
platformChannelSpecifics,
336-
payload: _phoneFieldController.text);
337-
338-
date = reminderDate.toString();
339-
time = reminderTime.toString();
340-
} else {
341-
date = "";
342-
time = "";
343-
}
344-
345-
userCalls.add({
346-
"Name": _nameFieldController.text,
347-
"PhoneNumber": _phoneFieldController.text,
348-
"Description": _descriptionFieldController.text,
349-
"ReminderDate": date,
350-
"ReminderTime": time
351-
});
352-
} catch (e) {
353-
print(e);
354-
} finally {
355-
//Navigator.pushNamed(context, "/");
356-
Navigator.of(context).pushNamedAndRemoveUntil(
357-
'/HomeScreen', (Route<dynamic> route) => false);
358-
}
359-
}*/
360291
},
361292
tooltip: "Save",
362293
elevation: 2.0,

lib/call_card.dart

Lines changed: 63 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -174,62 +174,76 @@ class CallCardState extends State<CallCard> {
174174
showRoundedModalBottomSheet(
175175
color: Theme.of(context).canvasColor,
176176
context: context,
177+
dismissOnTap: false,
177178
builder: (builder){
178179
return Container(
179180
height: 250.0,
180181
color: Colors.transparent,
181-
child: Container(
182-
child: Column(
183-
children: <Widget>[
184-
Padding(
185-
padding: const EdgeInsets.only(top: 8.0),
186-
child: ModalDrawerHandle(),
187-
),
188-
ListTile(
189-
leading: Icon(Icons.today),
190-
title: DateTimePickerFormField(
191-
format: dateFormat,
192-
dateOnly: true,
193-
firstDate: DateTime.now(),
194-
onChanged: (date) {
195-
reminderDate = date;
196-
},
197-
decoration: InputDecoration(
198-
labelText: "Reminder Date",
182+
child: Padding(
183+
padding: const EdgeInsets.all(4.0),
184+
child: Scaffold(
185+
body: Container(
186+
child: Column(
187+
children: <Widget>[
188+
Padding(
189+
padding: const EdgeInsets.only(top: 8.0),
190+
child: ModalDrawerHandle(),
199191
),
200-
),
201-
),
202-
ListTile(
203-
leading: Icon(Icons.access_time),
204-
title: TimePickerFormField(
205-
format: timeFormat,
206-
enabled: true,
207-
initialTime: TimeOfDay.now(),
208-
onChanged: (timeOfDay) {
209-
reminderTime = timeOfDay;
210-
},
211-
decoration: InputDecoration(
212-
labelText: "Reminder Time",
192+
Padding(
193+
padding: const EdgeInsets.all(16.0),
194+
child: DateTimePickerFormField(
195+
format: dateFormat,
196+
dateOnly: true,
197+
firstDate: DateTime.now(),
198+
onChanged: (date) {
199+
reminderDate = date;
200+
},
201+
decoration: InputDecoration(
202+
prefixIcon: Icon(
203+
Icons.today,
204+
color: Theme.of(context).brightness == Brightness.dark
205+
? Colors.white
206+
: Colors.grey,
207+
),
208+
labelText: "Reminder Date",
209+
border: OutlineInputBorder(),
210+
),
211+
),
212+
),
213+
Padding(
214+
padding: const EdgeInsets.only(left: 16.0, right: 16.0),
215+
child: TimePickerFormField(
216+
format: timeFormat,
217+
enabled: true,
218+
initialTime: TimeOfDay.now(),
219+
onChanged: (timeOfDay) {
220+
reminderTime = timeOfDay;
221+
},
222+
decoration: InputDecoration(
223+
labelText: "Reminder Time",
224+
border: OutlineInputBorder(),
225+
prefixIcon: Icon(
226+
Icons.access_time,
227+
color: Theme.of(context).brightness == Brightness.dark
228+
? Colors.white
229+
: Colors.grey,
230+
),
231+
),
232+
),
213233
),
214-
),
215-
),
216-
SizedBox(
217-
height: 50.0,
218-
),
219-
Row(
220-
mainAxisAlignment: MainAxisAlignment.center,
221-
children: <Widget>[
222-
FloatingActionButton.extended(
223-
backgroundColor: Colors.blue[700],
224-
icon: Icon(Icons.add_alert),
225-
label: Text("Create Reminder"),
226-
onPressed: () async {
227-
scheduleNotificationReminder("${widget.callSnapshot['Name']}", "${widget.callSnapshot['PhoneNumber']}");
228-
},
229-
)
230234
],
231-
)
232-
],
235+
),
236+
),
237+
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
238+
floatingActionButton: FloatingActionButton.extended(
239+
backgroundColor: Colors.blue[700],
240+
elevation: 0.0,
241+
icon: Icon(Icons.add_alert),
242+
label: Text("Set Reminder"),
243+
onPressed: () async {
244+
scheduleNotificationReminder("${widget.callSnapshot['Name']}", "${widget.callSnapshot['PhoneNumber']}");
245+
},
246+
),
233247
),
234248
),
235249
);

lib/edit_call_screen.dart

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,58 +68,87 @@ class _EditCallScreenState extends State<EditCallScreen> {
6868
),
6969
],
7070
),
71-
ListTile(
72-
leading: Icon(OMIcons.person),
73-
title: TextField(
71+
Padding(
72+
padding: const EdgeInsets.all(16.0),
73+
child: TextField(
7474
enabled: true,
7575
controller: _nameFieldController,
7676
keyboardType: TextInputType.text,
7777
maxLines: 1,
78-
autofocus: false,
7978
decoration: InputDecoration(
79+
border: OutlineInputBorder(),
80+
prefixIcon: Icon(
81+
OMIcons.person,
82+
color: Theme.of(context).brightness == Brightness.dark
83+
? Colors.white
84+
: Colors.grey,
85+
),
86+
suffixIcon: Padding(
87+
padding: const EdgeInsets.only(right: 8.0),
88+
child: IconButton(
89+
icon: Icon(
90+
Icons.contacts,
91+
color:
92+
Theme.of(context).brightness == Brightness.dark
93+
? Colors.white
94+
: Colors.grey,
95+
),
96+
onPressed: () async {
97+
Contact contact =
98+
await _contactPicker.selectContact();
99+
setState(() {
100+
_contact = contact;
101+
_nameFieldController.text = _contact.fullName;
102+
_phoneFieldController.text =
103+
_contact.phoneNumber.number;
104+
});
105+
},
106+
tooltip: "Choose from Contacts",
107+
),
108+
),
80109
labelText: name,
81110
),
82111
),
83-
trailing: IconButton(
84-
icon: Icon(Icons.contacts),
85-
onPressed: () async {
86-
Contact contact = await _contactPicker.selectContact();
87-
setState(() {
88-
_contact = contact;
89-
_nameFieldController.text = _contact.fullName;
90-
_phoneFieldController.text = _contact.phoneNumber.number;
91-
});
92-
},
93-
tooltip: "Choose from Contacts",
94-
),
95112
),
96-
ListTile(
97-
leading: Icon(OMIcons.phone),
98-
title: TextField(
113+
Padding(
114+
padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0, bottom: 16.0),
115+
child: TextField(
99116
enabled: true,
100117
keyboardType: TextInputType.phone,
101118
maxLines: 1,
102119
autofocus: false,
103120
controller: _phoneFieldController,
104121
decoration: InputDecoration(
122+
prefixIcon: Icon(
123+
OMIcons.phone,
124+
color: Theme.of(context).brightness == Brightness.dark
125+
? Colors.white
126+
: Colors.grey,
127+
),
105128
labelText: phoneNumber,
129+
border: OutlineInputBorder(),
106130
),
107131
),
108-
trailing: Material(child: SizedBox(width: 48.0,),),
109132
),
110-
ListTile(
111-
leading: Icon(OMIcons.comment),
112-
title: TextField(
133+
Padding(
134+
padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
135+
child: TextFormField(
113136
enabled: true,
114137
keyboardType: TextInputType.multiline,
115138
maxLines: 2,
116139
autofocus: false,
117140
controller: _descriptionFieldController,
118141
decoration: InputDecoration(
119-
hintText: description,
142+
labelText: description,
143+
prefixIcon: Icon(
144+
OMIcons.comment,
145+
color: Theme.of(context).brightness == Brightness.dark
146+
? Colors.white
147+
: Colors.grey,
148+
),
149+
border: OutlineInputBorder(),
120150
),
121151
),
122-
trailing: Material(child: SizedBox(width: 48.0,),),
123152
),
124153
],
125154
),

0 commit comments

Comments
 (0)