Fakultas Ilmu Komputer UI

Commit ffd2df98 authored by Michael Wiryadinata Halim's avatar Michael Wiryadinata Halim
Browse files

[REFACTOR] Fix layout

parent 523e5a92
Pipeline #52332 canceled with stages
in 3 minutes and 21 seconds
......@@ -54,14 +54,17 @@ class DetailProgram extends StatelessWidget {
_DeskripsiRow(
icon: Icons.calendar_today,
label:
'${DateFormatter(dateTime: program.startDateTime).format()} - '
'${DateFormatter(dateTime: program.endDateTime).format()}',
'${DateFormatter.format(program.startDateTime)}'
' - '
'${DateFormatter.format(program.endDateTime)}',
),
_DeskripsiRow(
icon: Icons.query_builder,
label:
'${TimeFormatter(dateTime: program.startDateTime).format()} - '
'${TimeFormatter(dateTime: program.endDateTime).format()}'),
icon: Icons.query_builder,
label:
'${TimeFormatter.format(program.startDateTime)}'
' - '
'${TimeFormatter.format(program.endDateTime)}',
),
_DeskripsiRow(
icon: Icons.room,
label: program.location,
......
......@@ -201,28 +201,33 @@ class _ProgramDescription extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'${DateFormatter(dateTime: program.startDateTime).format()} - '
'${DateFormatter(dateTime: program.endDateTime).format()}',
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'${DateFormatter.format(program.startDateTime)} - '
'${DateFormatter.format(program.endDateTime)}',
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
),
),
),
Text(
'${TimeFormatter(dateTime: program.startDateTime).format()} - '
'${TimeFormatter(dateTime: program.endDateTime).format()}',
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
Text(
'${TimeFormatter.format(program.startDateTime)} - '
'${TimeFormatter.format(program.endDateTime)}',
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
),
),
),
]),
_DonasiButton(
program: program,
]),
),
Expanded(
child: _DonasiButton(
program: program,
),
)
])
],
......
......@@ -146,63 +146,66 @@ class _BottomSheet extends StatelessWidget {
),
Expanded(
flex: 2,
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 350),
child: BlueButton(
key: ValueKey<bool>(state.method != null),
onPressed: state.method != null
? () {
final summaryBloc =
BlocProvider.of<SummaryBloc>(context);
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: const Text(
"Apakah anda yakin membeli barang ini?",
),
content: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text(
"Transaksi akan dibuat dengan "
"total harga: ",
),
PriceTextFormatter(
price: '${state.total}',
style: const TextStyle(
fontWeight: FontWeight.w700),
)
],
),
actions: <Widget>[
FlatButton(
child: ButtonTheme(
minWidth: double.infinity,
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 350),
child: BlueButton(
key: ValueKey<bool>(state.method != null),
onPressed: state.method != null
? () {
final summaryBloc =
BlocProvider.of<SummaryBloc>(context);
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: const Text(
"Apakah anda yakin membeli barang ini?",
),
content: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text(
"Transaksi akan dibuat dengan "
"total harga: ",
),
PriceTextFormatter(
price: '${state.total}',
style: const TextStyle(
fontWeight: FontWeight.w700),
)
],
),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text("Batalkan")),
RaisedButton(
onPressed: () {
EasyLoading.show(
status:
"Barang sedang dibeli...");
summaryBloc
.add(const ClickCheckout());
Navigator.of(context).pop();
},
child: const Text("Batalkan")),
RaisedButton(
onPressed: () {
EasyLoading.show(
status:
"Barang sedang dibeli...");
summaryBloc
.add(const ClickCheckout());
Navigator.of(context).pop();
},
child: const Text("BELI"),
color: const Color(0xff3C8DBC),
textColor: Colors.white,
)
],
);
});
}
: null,
label: "BELI"),
child: const Text("BELI"),
color: const Color(0xff3C8DBC),
textColor: Colors.white,
)
],
);
});
}
: null,
label: "BELI"),
),
))
],
),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment