Skip to content

Commit

Permalink
refactor: further use directionality utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 committed Nov 24, 2022
1 parent 6ed17d6 commit d49a5ba
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/widgets/booking/booking_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class _BookingFormState extends State<BookingForm> {
isExpanded: widget.isRecurring,
canTapOnHeader: true,
body: Padding(
padding: const EdgeInsets.only(top: 4, bottom: 8),
padding: const EdgeInsetsDirectional.only(top: 4, bottom: 8),
child: Column(
children: [
PeriodicityListTile(
Expand Down Expand Up @@ -446,7 +446,7 @@ class _BookingFormState extends State<BookingForm> {
),
if (widget.booking.description != null)
Padding(
padding: const EdgeInsets.only(top: 16),
padding: const EdgeInsetsDirectional.only(top: 16),
child: ItemInfo(
creationDateTime: widget.booking.creationDateTime,
modificationDateTime: widget.booking.modificationDateTime,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/cabin/cabin_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class _CabinFormState extends State<CabinForm> {
),
if (widget.newCabinNumber == null)
Padding(
padding: const EdgeInsets.only(top: 16),
padding: const EdgeInsetsDirectional.only(top: 16),
child: ItemInfo(
creationDateTime: widget.cabin.creationDateTime,
modificationDateTime: widget.cabin.modificationDateTime,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/cabin/cabin_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _ProgressCabinIcon extends CabinIcon {
return Tooltip(
message: appLocalizations.nPercentOccupied((progress * 100).ceil()),
child: Stack(
alignment: Alignment.center,
alignment: AlignmentDirectional.center,
children: [
SizedBox(
width: radius * 2,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/item/items_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class _ItemsTableState<T extends Item> extends State<ItemsTable<T>> {
key: PageStorageKey('${T}ListView'),
children: [
Padding(
padding: const EdgeInsets.only(top: 54),
padding: const EdgeInsetsDirectional.only(top: 54),
child: DataTable(
dataRowHeight: 82,
sortAscending: _sortAscending,
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/layout/popular_times_bar_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class PopularTimesBarChart extends StatelessWidget {
gridData: FlGridData(show: false),
borderData: FlBorderData(
show: true,
// TODO(albertms10): use `BorderDirectional`, https://github.com/imaNNeoFighT/fl_chart/issues/1189.
border: Border(
bottom: BorderSide(color: theme.hintColor.withOpacity(0.25)),
),
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/layout/radio_button_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class _RadioButtonListState extends State<RadioButtonList> {
widget._loopCondition(i);
widget.reverse ? i-- : i++)
Padding(
padding:
EdgeInsets.only(bottom: i == widget._lastLoopIndex ? 0 : 4),
padding: EdgeInsetsDirectional.only(
bottom: i == widget._lastLoopIndex ? 0 : 4,
),
child: TextButton(
style: ElevatedButton.styleFrom(
foregroundColor:
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/layout/statistic_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class StatisticItem extends StatelessWidget {
children: [
if (label != null)
Padding(
padding: const EdgeInsets.only(bottom: 8),
padding: const EdgeInsetsDirectional.only(bottom: 8),
child: Text(
label!,
style: Theme.of(context).textTheme.subtitle2,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/layout/statistics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class _StatisticsHeading extends StatelessWidget {
final theme = Theme.of(context);

return Padding(
padding: const EdgeInsets.only(bottom: 16),
padding: const EdgeInsetsDirectional.only(bottom: 16),
child: Row(
mainAxisSize: MainAxisSize.min,
textBaseline: TextBaseline.ideographic,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/layout/time_column.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TimeColumn extends StatelessWidget {
width: kTimeColumnWidth,
height: kBookingHeightRatio * 60,
padding: const EdgeInsets.all(16),
alignment: Alignment.topCenter,
alignment: AlignmentDirectional.topCenter,
child: Text(
TimeOfDay(hour: hour, minute: 0).format(context),
style: theme.textTheme.headline5
Expand Down
7 changes: 4 additions & 3 deletions lib/widgets/standalone/heat_map_calendar/month_label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ class MonthLabel extends StatelessWidget {
return Container(
height: size,
width: size,
alignment: Alignment.bottomCenter,
padding: EdgeInsets.only(bottom: space),
alignment: AlignmentDirectional.bottomCenter,
padding: EdgeInsetsDirectional.only(bottom: space),
child: Stack(
fit: StackFit.expand,
clipBehavior: Clip.none,
children: [
Positioned(
Positioned.directional(
textDirection: Directionality.of(context),
bottom: 0,
child: Text(
text,
Expand Down

0 comments on commit d49a5ba

Please sign in to comment.