Skip to content

Commit

Permalink
Made schedule bottom sheets prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurice Hennig committed Oct 12, 2021
1 parent 944e7b7 commit 505a3a5
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 45 deletions.
147 changes: 105 additions & 42 deletions lib/areas/schedule/screens/add_custom_schedule_item_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,53 +78,108 @@ class AddCustomScheduleItemPage extends StatelessWidget {
autovalidateMode: AutovalidateMode.onUserInteraction,
style: const TextStyle(fontSize: 16.0),
),
CupertinoTextFormFieldRow(
prefix: const SizedBox(
width: 100,
child: Text(
"Tag",
style: TextStyle(fontSize: 16.0),
Row(
children: [
const Padding(
padding: EdgeInsets.only(left: 26.0),
child: SizedBox(
width: 100,
child: Text(
"Wochentag",
style: TextStyle(fontSize: 16.0),
),
),
),
),
placeholder: "Auswählen",
controller: viewModel.weekdayController,
readOnly: true,
onTap: () => _showWeekdayPicker(context).then((result) =>
viewModel.weekdayController.text = result ?? ""),
validator: (value) => value == "" ? "Pflichtfeld" : null,
style: const TextStyle(fontSize: 16.0),
Container(
height: 42,
width: 1,
color: CupertinoTheme.of(context).brightness ==
Brightness.light
? CupertinoColors.systemGrey5
: CupertinoColors.secondaryLabel,
),
Expanded(
child: CupertinoTextFormFieldRow(
placeholder: "Auswählen",
controller: viewModel.weekdayController,
readOnly: true,
onTap: () => _showWeekdayPicker(context).then(
(result) => viewModel.weekdayController.text =
result ?? ""),
validator: (value) =>
value == "" ? "Pflichtfeld" : null,
style: const TextStyle(fontSize: 16.0),
),
),
],
),
CupertinoTextFormFieldRow(
prefix: const SizedBox(
width: 100,
child: Text(
"Startzeit",
style: TextStyle(fontSize: 16.0),
Row(
children: [
const Padding(
padding: EdgeInsets.only(left: 26.0),
child: SizedBox(
width: 100,
child: Text(
"Startzeit",
style: TextStyle(fontSize: 16.0),
),
),
),
),
placeholder: "Auswählen",
readOnly: true,
controller: viewModel.timeBeginController,
style: const TextStyle(fontSize: 16.0),
validator: (value) => value == "" ? "Pflichtfeld" : null,
onTap: () => _showTimePicker(context)
.then((result) => viewModel.setTimeBegin(result!)),
Container(
height: 42,
width: 1,
color: CupertinoTheme.of(context).brightness ==
Brightness.light
? CupertinoColors.systemGrey5
: CupertinoColors.secondaryLabel,
),
Expanded(
child: CupertinoTextFormFieldRow(
placeholder: "Auswählen",
readOnly: true,
controller: viewModel.timeBeginController,
style: const TextStyle(fontSize: 16.0),
validator: (value) =>
value == "" ? "Pflichtfeld" : null,
onTap: () => _showTimePicker(context).then(
(result) => viewModel.setTimeBegin(result!)),
),
),
],
),
CupertinoTextFormFieldRow(
prefix: const SizedBox(
width: 100,
child: Text(
"Endzeit",
style: TextStyle(fontSize: 16.0),
Row(
children: [
const Padding(
padding: EdgeInsets.only(left: 26.0),
child: SizedBox(
width: 100,
child: Text(
"Endzeit",
style: TextStyle(fontSize: 16.0),
),
),
),
),
placeholder: "Auswählen",
readOnly: true,
controller: viewModel.timeEndController,
style: const TextStyle(fontSize: 16.0),
validator: (value) => value == "" ? "Pflichtfeld" : null,
onTap: () => _showTimePicker(context)
.then((result) => viewModel.setTimeEnd(result!)),
Container(
height: 42,
width: 1,
color: CupertinoTheme.of(context).brightness ==
Brightness.light
? CupertinoColors.systemGrey5
: CupertinoColors.secondaryLabel,
),
Expanded(
child: CupertinoTextFormFieldRow(
placeholder: "Auswählen",
readOnly: true,
controller: viewModel.timeEndController,
style: const TextStyle(fontSize: 16.0),
validator: (value) =>
value == "" ? "Pflichtfeld" : null,
onTap: () => _showTimePicker(context).then(
(result) => viewModel.setTimeEnd(result!)),
),
),
],
),
CupertinoTextFormFieldRow(
placeholder: "Raum",
Expand All @@ -147,6 +202,14 @@ class AddCustomScheduleItemPage extends StatelessWidget {
AutovalidateMode.onUserInteraction,
),
),
Container(
height: 42,
width: 1,
color: CupertinoTheme.of(context).brightness ==
Brightness.light
? CupertinoColors.systemGrey5
: CupertinoColors.secondaryLabel,
),
Expanded(
flex: 7,
child: CupertinoTextFormFieldRow(
Expand Down
9 changes: 6 additions & 3 deletions lib/areas/schedule/screens/add_official_schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class AddOfficialSchedulePage extends StatelessWidget {
CupertinoTextFormFieldRow(
prefix: const Padding(
padding: EdgeInsets.only(right: 50.0),
child: Text('Studiengang'),
child: Text('Studiengang',
style: TextStyle(fontSize: 16.0)),
),
placeholder: 'Wählen',
onTap: () {
Expand All @@ -162,7 +163,8 @@ class AddOfficialSchedulePage extends StatelessWidget {
controller: viewModel.courseController,
),
CupertinoTextFormFieldRow(
prefix: const Text('Semester'),
prefix: const Text('Semester',
style: TextStyle(fontSize: 16.0)),
placeholder: 'Wählen',
onTap: () {
if (viewModel.selectedCourse != null) {
Expand Down Expand Up @@ -215,7 +217,8 @@ class AddOfficialSchedulePage extends StatelessWidget {
header: const Text('Optional'),
children: [
CupertinoTextFormFieldRow(
prefix: const Text('Gruppenkennung'),
prefix: const Text('Gruppenkennung',
style: TextStyle(fontSize: 16.0)),
placeholder: 'Beispiel: C8',
textAlign: TextAlign.end,
controller: viewModel.groupController,
Expand Down

0 comments on commit 505a3a5

Please sign in to comment.