File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
- import 'dart:io' show Platform;
2
1
import 'package:flutter/material.dart' ;
3
2
import 'package:intl/intl.dart' ;
4
3
@@ -172,12 +171,13 @@ class _MessageListState extends State<MessageList> {
172
171
// TODO: Offer `ScrollViewKeyboardDismissBehavior.interactive` (or
173
172
// similar) if that is ever offered:
174
173
// https://github.com/flutter/flutter/issues/57609#issuecomment-1355340849
175
- keyboardDismissBehavior: Platform .isIOS
174
+ keyboardDismissBehavior: switch ( Theme . of (context).platform) {
176
175
// This seems to offer the only built-in way to close the keyboard
177
176
// on iOS. It's not ideal; see TODO above.
178
- ? ScrollViewKeyboardDismissBehavior .onDrag
177
+ TargetPlatform .iOS => ScrollViewKeyboardDismissBehavior .onDrag,
179
178
// The Android keyboard seems to have a built-in close button.
180
- : ScrollViewKeyboardDismissBehavior .manual,
179
+ _ => ScrollViewKeyboardDismissBehavior .manual,
180
+ },
181
181
182
182
itemCount: length,
183
183
// Setting reverse: true means the scroll starts at the bottom.
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ final TextStyle kMonospaceTextStyle = TextStyle(
19
19
20
20
// Oddly, iOS doesn't handle 'monospace':
21
21
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20monospace.20font.20fallback/near/1570622
22
+ // TODO use Theme.of, not Platform, so that this is testable (needs a BuildContext)
22
23
fontFamilyFallback: Platform .isIOS ? ['Menlo' , 'Courier' ] : ['monospace' ],
23
24
24
25
inherit: true ,
You can’t perform that action at this time.
0 commit comments