|  | 
| 1 | 1 | import 'dart:async'; | 
| 2 | 2 | 
 | 
| 3 | 3 | import 'package:flutter/material.dart'; | 
|  | 4 | +import 'package:flutter/rendering.dart'; | 
| 4 | 5 | 
 | 
| 5 | 6 | import '../generated/l10n/zulip_localizations.dart'; | 
| 6 | 7 | import '../model/narrow.dart'; | 
| @@ -74,14 +75,20 @@ class _HomePageState extends State<HomePage> { | 
| 74 | 75 | 
 | 
| 75 | 76 |   String get _currentTabTitle { | 
| 76 | 77 |     final zulipLocalizations = ZulipLocalizations.of(context); | 
|  | 78 | +    String pageTitle; | 
| 77 | 79 |     switch(_tab.value) { | 
| 78 | 80 |       case _HomePageTab.inbox: | 
| 79 |  | -        return zulipLocalizations.inboxPageTitle; | 
|  | 81 | +        pageTitle = zulipLocalizations.inboxPageTitle; | 
|  | 82 | +        break; | 
| 80 | 83 |       case _HomePageTab.channels: | 
| 81 |  | -        return zulipLocalizations.channelsPageTitle; | 
|  | 84 | +        pageTitle = zulipLocalizations.channelsPageTitle; | 
|  | 85 | +        break; | 
| 82 | 86 |       case _HomePageTab.directMessages: | 
| 83 |  | -        return zulipLocalizations.recentDmConversationsPageTitle; | 
|  | 87 | +        pageTitle = zulipLocalizations.recentDmConversationsPageTitle; | 
| 84 | 88 |     } | 
|  | 89 | + | 
|  | 90 | +    SemanticsService.announce(pageTitle, Directionality.of(context)); | 
|  | 91 | +    return pageTitle; | 
| 85 | 92 |   } | 
| 86 | 93 | 
 | 
| 87 | 94 |   @override | 
| @@ -132,9 +139,6 @@ class _HomePageState extends State<HomePage> { | 
| 132 | 139 |       body: Stack( | 
| 133 | 140 |         children: [ | 
| 134 | 141 |           for (final (tab, body) in pageBodies) | 
| 135 |  | -            // TODO(#535): Decide if we find it helpful to use something like | 
| 136 |  | -            //   [SemanticsProperties.namesRoute] to structure this UI better | 
| 137 |  | -            //   for screen-reader software. | 
| 138 | 142 |             Offstage(offstage: tab != _tab.value, child: body), | 
| 139 | 143 |         ]), | 
| 140 | 144 |       bottomNavigationBar: DecoratedBox( | 
| @@ -304,6 +308,8 @@ void _showMainMenu(BuildContext context, { | 
| 304 | 308 |     // TODO(#1095): VersionInfo | 
| 305 | 309 |   ]; | 
| 306 | 310 | 
 | 
|  | 311 | +  SemanticsService.announce(ZulipLocalizations.of(context).navBarMenuLabel, | 
|  | 312 | +    Directionality.of(context)); | 
| 307 | 313 |   final designVariables = DesignVariables.of(context); | 
| 308 | 314 |   final accountId = PerAccountStoreWidget.accountIdOf(context); | 
| 309 | 315 |   showModalBottomSheet<void>( | 
|  | 
0 commit comments