Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/src/date/days_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class DaysView extends StatelessWidget {
MaterialLocalizations localizations,
) {
final List<Widget> result = <Widget>[];
final weekdayNames = DateFormat('', locale.toString()).dateSymbols.SHORTWEEKDAYS;
final weekdayNames =
DateFormat('', locale.toString()).dateSymbols.SHORTWEEKDAYS;

for (int i = localizations.firstDayOfWeekIndex; true; i = (i + 1) % 7) {
// to save space in arabic as arabic don't has short week days.
Expand All @@ -175,7 +176,8 @@ class DaysView extends StatelessWidget {

@override
Widget build(BuildContext context) {
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
final MaterialLocalizations localizations =
MaterialLocalizations.of(context);
//
//
//
Expand Down Expand Up @@ -205,7 +207,8 @@ class DaysView extends StatelessWidget {
dayToBuild.isBefore(_minDate) ||
(disabledDayPredicate?.call(dayToBuild) ?? false);

final bool isSelectedDay = DateUtils.isSameDay(selectedDate, dayToBuild);
final bool isSelectedDay =
DateUtils.isSameDay(selectedDate, dayToBuild);

final bool isCurrent = DateUtils.isSameDay(currentDate, dayToBuild);
//
Expand Down Expand Up @@ -255,18 +258,22 @@ class DaysView extends StatelessWidget {
);
} else {
dayWidget = InkResponse(
containedInkWell: true,
onTap: () => onChanged(dayToBuild),
radius: splashRadius,
splashColor: splashColor,
highlightColor: highlightColor,
highlightShape: decoration.shape,
borderRadius: decoration.borderRadius as BorderRadius,
child: Semantics(
// We want the day of month to be spoken first irrespective of the
// locale-specific preferences or TextDirection. This is because
// an accessibility user is more likely to be interested in the
// day of month before the rest of the date, as they are looking
// for the day of month. To do that we prepend day of month to the
// formatted full date.
label: '${localizations.formatDecimal(day)}, ${localizations.formatFullDate(dayToBuild)}',
label:
'${localizations.formatDecimal(day)}, ${localizations.formatFullDate(dayToBuild)}',
selected: isSelectedDay,
excludeSemantics: true,
child: dayWidget,
Expand Down
10 changes: 6 additions & 4 deletions lib/src/shared/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ class Header extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (centerLeadingDate) backButton,
LeadingDate(
onTap: onDateTap,
displayedText: displayedDate,
displayedTextStyle: leadingDateTextStyle,
Expanded(
child: LeadingDate(
onTap: onDateTap,
displayedText: displayedDate,
displayedTextStyle: leadingDateTextStyle,
),
),
if (centerLeadingDate)
forwardButton
Expand Down
26 changes: 16 additions & 10 deletions lib/src/shared/year_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,22 @@ class YearView extends StatelessWidget {
);
} else {
final date = DateTime(yearsName[i]);
monthWidget = InkResponse(
onTap: () => onChanged(date),
radius: splashRadius,
splashColor: splashColor,
highlightColor: highlightColor,
child: Semantics(
label: yearsName[i].toString(),
selected: isSelected,
excludeSemantics: true,
child: monthWidget,
monthWidget = Padding(
padding: const EdgeInsets.all(4),
child: InkResponse(
containedInkWell: true,
onTap: () => onChanged(date),
radius: splashRadius,
splashColor: splashColor,
highlightColor: highlightColor,
highlightShape: decoration.shape,
borderRadius: decoration.borderRadius as BorderRadius,
child: Semantics(
label: yearsName[i].toString(),
selected: isSelected,
excludeSemantics: true,
child: monthWidget,
),
),
);
}
Expand Down