Skip to content

Commit 600d835

Browse files
authored
Remove scaleByFontFactor method and usages (#9304)
1 parent 8e65592 commit 600d835

File tree

111 files changed

+456
-575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+456
-575
lines changed

packages/devtools_app/lib/src/extensions/embedded/_view_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class _ExtensionIFrameController extends DisposableController
311311
buildTextSpans: (_) => [
312312
TextSpan(
313313
text: showBannerMessageEvent.message,
314-
style: TextStyle(fontSize: defaultFontSize),
314+
style: const TextStyle(fontSize: defaultFontSize),
315315
),
316316
],
317317
);

packages/devtools_app/lib/src/extensions/extension_screen_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class DisableExtensionDialog extends StatelessWidget {
183183
text: 'DevTools Extensions ',
184184
style: theme.boldTextStyle,
185185
),
186-
WidgetSpan(
186+
const WidgetSpan(
187187
child: Icon(Icons.extension_rounded, size: defaultIconSize),
188188
),
189189
const TextSpan(text: ' menu.'),

packages/devtools_app/lib/src/extensions/extension_settings.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ class ExtensionSettingsDialog extends StatelessWidget {
4848
Widget build(BuildContext context) {
4949
final theme = Theme.of(context);
5050
// This dialog needs a fixed height because it contains a scrollable list.
51-
final dialogHeight = anyTestMode
52-
? scaleByFontFactor(1000.0)
53-
: scaleByFontFactor(300.0);
51+
final dialogHeight = anyTestMode ? 1000.0 : 300.0;
5452
return DevToolsDialog(
5553
title: const DialogTitleText('DevTools Extensions'),
5654
content: SizedBox(

packages/devtools_app/lib/src/framework/home_screen.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class _HomeScreenBodyState extends State<HomeScreenBody> with AutoDisposeMixin {
8282
class ConnectionSection extends StatelessWidget {
8383
const ConnectionSection({super.key, required this.connected});
8484

85-
static const _primaryMinScreenWidthForTextBeforeScaling = 480.0;
86-
static const _secondaryMinScreenWidthForTextBeforeScaling = 600.0;
85+
static const _primaryMinScreenWidthForText = 480.0;
86+
static const _secondaryMinScreenWidthForText = 600.0;
8787

8888
final bool connected;
8989

@@ -95,14 +95,12 @@ class ConnectionSection extends StatelessWidget {
9595
actions: [
9696
ViewVmFlagsButton(
9797
gaScreen: gac.home,
98-
minScreenWidthForTextBeforeScaling:
99-
_secondaryMinScreenWidthForTextBeforeScaling,
98+
minScreenWidthForText: _secondaryMinScreenWidthForText,
10099
),
101100
const SizedBox(width: defaultSpacing),
102101
ConnectToNewAppButton(
103102
gaScreen: gac.home,
104-
minScreenWidthForTextBeforeScaling:
105-
_primaryMinScreenWidthForTextBeforeScaling,
103+
minScreenWidthForText: _primaryMinScreenWidthForText,
106104
routerDelegate: DevToolsRouterDelegate.of(context),
107105
onPressed: () =>
108106
Navigator.of(context, rootNavigator: true).pop('dialog'),
@@ -202,7 +200,7 @@ class _ConnectInputState extends State<ConnectInput> with BlockingActionMixin {
202200
children: [
203201
SizedBox(
204202
height: defaultTextFieldHeight,
205-
width: scaleByFontFactor(350.0),
203+
width: 350.0,
206204
child: DevToolsClearableTextField(
207205
labelText: 'URL',
208206
onSubmitted: actionInProgress

packages/devtools_app/lib/src/framework/notifications_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import '../shared/managers/notifications.dart';
1414
import '../shared/primitives/utils.dart';
1515
import '../shared/ui/common_widgets.dart';
1616

17-
double get _notificationHeight => scaleByFontFactor(175.0);
17+
const _notificationHeight = 175.0;
1818
final _notificationWidth = _notificationHeight * goldenRatio;
1919

2020
/// Manager for notifications in the app.
@@ -151,7 +151,7 @@ class _NotificationOverlay extends StatelessWidget {
151151
child: Padding(
152152
// Position the notifications in the lower right of the app window, and
153153
// high enough up that we don't obscure the status line.
154-
padding: EdgeInsets.only(
154+
padding: const EdgeInsets.only(
155155
right: defaultSpacing,
156156
bottom: statusLineHeight + defaultSpacing,
157157
),

packages/devtools_app/lib/src/framework/observer/memory_observer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ class _ReduceMemoryButtonState extends State<_ReduceMemoryButton> {
231231
child: Padding(
232232
padding: const EdgeInsets.symmetric(horizontal: denseSpacing),
233233
child: inProgress
234-
? SizedBox(
234+
? const SizedBox(
235235
height: actionsIconSize,
236236
width: actionsIconSize,
237-
child: const CircularProgressIndicator(),
237+
child: CircularProgressIndicator(),
238238
)
239239
: ValueListenableBuilder(
240240
valueListenable: result,

packages/devtools_app/lib/src/framework/scaffold/app_bar.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class DevToolsAppBar extends StatelessWidget {
5959
if (screens.isNotEmpty && actionsWithSpacer.isNotEmpty) {
6060
actionsWithSpacer.insert(
6161
0,
62-
VerticalLineSpacer(height: defaultToolbarHeight),
62+
const VerticalLineSpacer(height: defaultToolbarHeight),
6363
);
6464
}
6565

@@ -219,7 +219,7 @@ class TabOverflowButton extends StatelessWidget {
219219

220220
@visibleForTesting
221221
class SelectedTabWrapper extends StatelessWidget {
222-
SelectedTabWrapper({super.key, required this.child, double? width})
222+
const SelectedTabWrapper({super.key, required this.child, double? width})
223223
: width = width ?? buttonMinWidth;
224224

225225
final Widget child;

packages/devtools_app/lib/src/framework/scaffold/scaffold.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,9 @@ class DevToolsScaffoldState extends State<DevToolsScaffold>
327327
child: Scaffold(
328328
appBar: showAppBar
329329
? PreferredSize(
330-
preferredSize: Size.fromHeight(defaultToolbarHeight),
330+
preferredSize: const Size.fromHeight(
331+
defaultToolbarHeight,
332+
),
331333
// Place the AppBar inside of a Hero widget to keep it the same across
332334
// route transitions.
333335
child: Hero(

packages/devtools_app/lib/src/framework/scaffold/settings_dialog.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class SettingsDialog extends StatelessWidget {
107107
class _VerboseLoggingSetting extends StatelessWidget {
108108
const _VerboseLoggingSetting();
109109

110-
static const _minScreenWidthForTextBeforeScaling = 500.0;
110+
static const _minScreenWidthForText = 500.0;
111111

112112
@override
113113
Widget build(BuildContext context) {
@@ -130,8 +130,7 @@ class _VerboseLoggingSetting extends StatelessWidget {
130130
icon: Icons.copy_outlined,
131131
gaScreen: gac.settingsDialog,
132132
gaSelection: gac.copyLogs,
133-
minScreenWidthForTextBeforeScaling:
134-
_minScreenWidthForTextBeforeScaling,
133+
minScreenWidthForText: _minScreenWidthForText,
135134
onPressed: () async => await copyToClipboard(
136135
LogStorage.root.toString(),
137136
successMessage: 'Successfully copied logs',
@@ -142,8 +141,7 @@ class _VerboseLoggingSetting extends StatelessWidget {
142141
label: 'Clear logs',
143142
gaScreen: gac.settingsDialog,
144143
gaSelection: gac.clearLogs,
145-
minScreenWidthForTextBeforeScaling:
146-
_minScreenWidthForTextBeforeScaling,
144+
minScreenWidthForText: _minScreenWidthForText,
147145
onPressed: LogStorage.root.clear,
148146
),
149147
],

packages/devtools_app/lib/src/framework/scaffold/status_line.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class StatusLine extends StatelessWidget {
190190
}
191191
},
192192
child: screenWidth <= MediaSize.xxs
193-
? DevToolsTooltip(
193+
? const DevToolsTooltip(
194194
message: noConnectionMsg,
195195
child: Icon(Icons.warning_amber_rounded, size: actionsIconSize),
196196
)

0 commit comments

Comments
 (0)