mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-18 20:53:45 +02:00
fix: improve the UI for small devices
This commit is contained in:
parent
9487cf2e57
commit
79d292cf4a
7 changed files with 67 additions and 51 deletions
|
@ -1,3 +1,7 @@
|
|||
## 1.2.0
|
||||
|
||||
* Improve the UI for smaller screens to prevent overflows
|
||||
|
||||
## 1.1.1
|
||||
|
||||
* Removed custom definition of CustomSemantics to use the one from flutter_accessibility instead
|
||||
|
|
|
@ -70,10 +70,12 @@ class AvailabilityClearSection extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
Expanded(
|
||||
child: Text(
|
||||
unavailableText,
|
||||
style: textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
@ -73,7 +73,14 @@ class CalendarView extends StatelessWidget {
|
|||
(element) => element.templateDeviation,
|
||||
);
|
||||
|
||||
var monthDateSelector = Row(
|
||||
var monthDateSelector = LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
var monthWidth =
|
||||
_calculateTextWidthOfLongestMonth(context, translations);
|
||||
var sideSpace =
|
||||
((constraints.maxWidth - monthWidth) / 2 - 44).clamp(0.0, 44.0);
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CustomSemantics(
|
||||
|
@ -82,15 +89,13 @@ class CalendarView extends StatelessWidget {
|
|||
padding: EdgeInsets.zero,
|
||||
icon: const Icon(Icons.chevron_left),
|
||||
onPressed: () {
|
||||
onMonthChanged(
|
||||
DateTime(month.year, month.month - 1),
|
||||
);
|
||||
onMonthChanged(DateTime(month.year, month.month - 1));
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 44),
|
||||
SizedBox(width: sideSpace),
|
||||
SizedBox(
|
||||
width: _calculateTextWidthOfLongestMonth(context, translations),
|
||||
width: monthWidth,
|
||||
child: CustomSemantics(
|
||||
identifier: identifiers.monthNameTextIdentifier,
|
||||
child: Text(
|
||||
|
@ -100,21 +105,21 @@ class CalendarView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 44),
|
||||
SizedBox(width: sideSpace),
|
||||
CustomSemantics(
|
||||
identifier: identifiers.nextMonthButtonIdentifier,
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
icon: const Icon(Icons.chevron_right),
|
||||
onPressed: () {
|
||||
onMonthChanged(
|
||||
DateTime(month.year, month.month + 1),
|
||||
);
|
||||
onMonthChanged(DateTime(month.year, month.month + 1));
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
var calendarGrid = CalendarGrid(
|
||||
month: month,
|
||||
|
|
|
@ -167,9 +167,12 @@ class _CalendarDay extends StatelessWidget {
|
|||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 2),
|
||||
decoration: decoration,
|
||||
child: Text(day.date.day.toString(), style: textStyle),
|
||||
child: Text(
|
||||
day.date.day.toString(),
|
||||
style: textStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (day.templateDeviation) ...[
|
||||
|
|
|
@ -76,10 +76,12 @@ class _TemplateLegendState extends State<TemplateLegend> {
|
|||
const SizedBox(width: 12),
|
||||
const Icon(Icons.add, size: 20),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
Expanded(
|
||||
child: Text(
|
||||
translations.createTemplateButton,
|
||||
style: textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_availability
|
||||
description: "Flutter availability userstory package"
|
||||
version: 1.1.1
|
||||
version: 1.2.0
|
||||
|
||||
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
|
||||
|
@ -14,7 +14,7 @@ dependencies:
|
|||
flutter_hooks: ^0.20.5
|
||||
flutter_availability_data_interface:
|
||||
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
version: ^1.1.1
|
||||
version: ^1.2.0
|
||||
flutter_accessibility:
|
||||
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
version: ^0.0.3
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_availability_data_interface
|
||||
description: "The data interface for the flutter_availability component"
|
||||
version: 1.1.1
|
||||
version: 1.2.0
|
||||
|
||||
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
|
||||
|
|
Loading…
Reference in a new issue