Skip to content

Commit 28759d2

Browse files
committed
ui: Migrate to Material Design 3
This completes the checklist at zulip#225. I tested the screen-reader interface change with VoiceOver on my iPhone. Fixes: zulip#225
1 parent b8a6414 commit 28759d2

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

lib/widgets/app.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class ZulipApp extends StatelessWidget {
9292
if (Theme.of(context).platform == TargetPlatform.iOS) '.AppleSystemUIFont' else 'sans-serif',
9393
'Noto Color Emoji',
9494
],
95-
useMaterial3: false, // TODO(#225) fix things and switch to true
9695
// This applies Material 3's color system to produce a palette of
9796
// appropriately matching and contrasting colors for use in a UI.
9897
// The Zulip brand color is a starting point, but doesn't end up as

lib/widgets/lightbox.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class _LightboxPageState extends State<_LightboxPage> {
133133

134134
final appBarBackgroundColor = Colors.grey.shade900.withOpacity(0.87);
135135
const appBarForegroundColor = Colors.white;
136+
const appBarElevation = 0.0;
136137

137138
PreferredSizeWidget? appBar;
138139
if (_headerFooterVisible) {
@@ -146,6 +147,7 @@ class _LightboxPageState extends State<_LightboxPage> {
146147
centerTitle: false,
147148
foregroundColor: appBarForegroundColor,
148149
backgroundColor: appBarBackgroundColor,
150+
elevation: appBarElevation,
149151

150152
// TODO(#41): Show message author's avatar
151153
title: RichText(
@@ -167,6 +169,7 @@ class _LightboxPageState extends State<_LightboxPage> {
167169
if (_headerFooterVisible) {
168170
bottomAppBar = BottomAppBar(
169171
color: appBarBackgroundColor,
172+
elevation: appBarElevation,
170173
child: Row(children: [
171174
_CopyLinkButton(url: widget.src),
172175
// TODO(#43): Share image

lib/widgets/login.dart

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -392,19 +392,13 @@ class _PasswordLoginPageState extends State<PasswordLoginPage> {
392392
decoration: InputDecoration(
393393
labelText: zulipLocalizations.loginPasswordLabel,
394394
helperText: kLayoutPinningHelperText,
395-
// TODO(material-3): Simplify away `Semantics` by using IconButton's
396-
// M3-only params `isSelected` / `selectedIcon`, after fixing
397-
// https://github.com/flutter/flutter/issues/127145 . (Also, the
398-
// `Semantics` seen here would misbehave in M3 for reasons
399-
// involving a `Semantics` with `container: true` in an underlying
400-
// [ButtonStyleButton].)
401-
suffixIcon: Semantics(toggled: _obscurePassword,
402-
child: IconButton(
403-
tooltip: zulipLocalizations.loginHidePassword,
404-
onPressed: _handlePasswordVisibilityPress,
405-
icon: _obscurePassword
406-
? const Icon(Icons.visibility_off)
407-
: const Icon(Icons.visibility)))));
395+
suffixIcon: IconButton(
396+
tooltip: zulipLocalizations.loginHidePassword,
397+
onPressed: _handlePasswordVisibilityPress,
398+
icon: const Icon(Icons.visibility),
399+
isSelected: _obscurePassword,
400+
selectedIcon: const Icon(Icons.visibility_off),
401+
)));
408402

409403
return Scaffold(
410404
appBar: AppBar(title: Text(zulipLocalizations.loginPageTitle),

0 commit comments

Comments
 (0)