Skip to content

Commit

Permalink
UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GroovinChip committed Dec 6, 2018
1 parent e4ff21b commit e753448
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 145 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
applicationId "com.groovinchip.flutter.callmanager"
minSdkVersion 16
targetSdkVersion 27
versionCode 15
versionName "1.7"
versionCode 16
versionName "1.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//setProperty("archivesBaseName", applicationId + "_" + versionName)
}
Expand Down
69 changes: 0 additions & 69 deletions lib/add_new_call_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
TimeOfDay reminderTime;

final formKey = GlobalKey<FormState>();
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();

void saveCall() async {
if(formKey.currentState.validate()){
Expand Down Expand Up @@ -289,74 +288,6 @@ class _AddNewCallScreenState extends State<AddNewCallScreen> {
backgroundColor: Colors.blue[700],
onPressed: () async {
saveCall();
/*if (_nameFieldController.text.toString() == "" ||
_phoneFieldController.text.toString() == "") {
final snackBar = SnackBar(
content: Text("Please enter required fields"),
action: SnackBarAction(label: 'Dismiss', onPressed: () {}),
duration: Duration(seconds: 3),
);
Scaffold.of(fabContext).showSnackBar(snackBar);
} else {
try {
CollectionReference userCalls = Firestore.instance
.collection("Users")
.document(globals.loggedInUser.uid)
.collection("Calls");
String date;
String time;
if (reminderDate != null && reminderTime != null) {
var scheduledNotificationDateTime = DateTime(
reminderDate.year,
reminderDate.month,
reminderDate.day,
reminderTime.hour,
reminderTime.minute,
);
var androidPlatformChannelSpecifics =
new AndroidNotificationDetails(
'1',
'Call Reminders',
'Allow Call Manager to create and send notifications about Call Reminders',
);
var iOSPlatformChannelSpecifics =
new IOSNotificationDetails();
NotificationDetails platformChannelSpecifics =
new NotificationDetails(androidPlatformChannelSpecifics,
iOSPlatformChannelSpecifics);
await PassNotification.of(context).schedule(
0,
'Call Reminder',
"Don't forget to call " + _nameFieldController.text + "!",
scheduledNotificationDateTime,
platformChannelSpecifics,
payload: _phoneFieldController.text);
date = reminderDate.toString();
time = reminderTime.toString();
} else {
date = "";
time = "";
}
userCalls.add({
"Name": _nameFieldController.text,
"PhoneNumber": _phoneFieldController.text,
"Description": _descriptionFieldController.text,
"ReminderDate": date,
"ReminderTime": time
});
} catch (e) {
print(e);
} finally {
//Navigator.pushNamed(context, "/");
Navigator.of(context).pushNamedAndRemoveUntil(
'/HomeScreen', (Route<dynamic> route) => false);
}
}*/
},
tooltip: "Save",
elevation: 2.0,
Expand Down
112 changes: 63 additions & 49 deletions lib/call_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,62 +174,76 @@ class CallCardState extends State<CallCard> {
showRoundedModalBottomSheet(
color: Theme.of(context).canvasColor,
context: context,
dismissOnTap: false,
builder: (builder){
return Container(
height: 250.0,
color: Colors.transparent,
child: Container(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: ModalDrawerHandle(),
),
ListTile(
leading: Icon(Icons.today),
title: DateTimePickerFormField(
format: dateFormat,
dateOnly: true,
firstDate: DateTime.now(),
onChanged: (date) {
reminderDate = date;
},
decoration: InputDecoration(
labelText: "Reminder Date",
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Scaffold(
body: Container(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: ModalDrawerHandle(),
),
),
),
ListTile(
leading: Icon(Icons.access_time),
title: TimePickerFormField(
format: timeFormat,
enabled: true,
initialTime: TimeOfDay.now(),
onChanged: (timeOfDay) {
reminderTime = timeOfDay;
},
decoration: InputDecoration(
labelText: "Reminder Time",
Padding(
padding: const EdgeInsets.all(16.0),
child: DateTimePickerFormField(
format: dateFormat,
dateOnly: true,
firstDate: DateTime.now(),
onChanged: (date) {
reminderDate = date;
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.today,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.grey,
),
labelText: "Reminder Date",
border: OutlineInputBorder(),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 16.0, right: 16.0),
child: TimePickerFormField(
format: timeFormat,
enabled: true,
initialTime: TimeOfDay.now(),
onChanged: (timeOfDay) {
reminderTime = timeOfDay;
},
decoration: InputDecoration(
labelText: "Reminder Time",
border: OutlineInputBorder(),
prefixIcon: Icon(
Icons.access_time,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.grey,
),
),
),
),
),
),
SizedBox(
height: 50.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FloatingActionButton.extended(
backgroundColor: Colors.blue[700],
icon: Icon(Icons.add_alert),
label: Text("Create Reminder"),
onPressed: () async {
scheduleNotificationReminder("${widget.callSnapshot['Name']}", "${widget.callSnapshot['PhoneNumber']}");
},
)
],
)
],
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: FloatingActionButton.extended(
backgroundColor: Colors.blue[700],
elevation: 0.0,
icon: Icon(Icons.add_alert),
label: Text("Set Reminder"),
onPressed: () async {
scheduleNotificationReminder("${widget.callSnapshot['Name']}", "${widget.callSnapshot['PhoneNumber']}");
},
),
),
),
);
Expand Down
79 changes: 54 additions & 25 deletions lib/edit_call_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,58 +68,87 @@ class _EditCallScreenState extends State<EditCallScreen> {
),
],
),
ListTile(
leading: Icon(OMIcons.person),
title: TextField(
Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
enabled: true,
controller: _nameFieldController,
keyboardType: TextInputType.text,
maxLines: 1,
autofocus: false,
decoration: InputDecoration(
border: OutlineInputBorder(),
prefixIcon: Icon(
OMIcons.person,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.grey,
),
suffixIcon: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: IconButton(
icon: Icon(
Icons.contacts,
color:
Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.grey,
),
onPressed: () async {
Contact contact =
await _contactPicker.selectContact();
setState(() {
_contact = contact;
_nameFieldController.text = _contact.fullName;
_phoneFieldController.text =
_contact.phoneNumber.number;
});
},
tooltip: "Choose from Contacts",
),
),
labelText: name,
),
),
trailing: IconButton(
icon: Icon(Icons.contacts),
onPressed: () async {
Contact contact = await _contactPicker.selectContact();
setState(() {
_contact = contact;
_nameFieldController.text = _contact.fullName;
_phoneFieldController.text = _contact.phoneNumber.number;
});
},
tooltip: "Choose from Contacts",
),
),
ListTile(
leading: Icon(OMIcons.phone),
title: TextField(
Padding(
padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0, bottom: 16.0),
child: TextField(
enabled: true,
keyboardType: TextInputType.phone,
maxLines: 1,
autofocus: false,
controller: _phoneFieldController,
decoration: InputDecoration(
prefixIcon: Icon(
OMIcons.phone,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.grey,
),
labelText: phoneNumber,
border: OutlineInputBorder(),
),
),
trailing: Material(child: SizedBox(width: 48.0,),),
),
ListTile(
leading: Icon(OMIcons.comment),
title: TextField(
Padding(
padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
child: TextFormField(
enabled: true,
keyboardType: TextInputType.multiline,
maxLines: 2,
autofocus: false,
controller: _descriptionFieldController,
decoration: InputDecoration(
hintText: description,
labelText: description,
prefixIcon: Icon(
OMIcons.comment,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.grey,
),
border: OutlineInputBorder(),
),
),
trailing: Material(child: SizedBox(width: 48.0,),),
),
],
),
Expand Down

0 comments on commit e753448

Please sign in to comment.