Skip to content

refactor: Centralize table formatting logic into a new formatTable utility function.#182196

Merged
jwren merged 5 commits into
flutter:masterfrom
jwren:running-apps-03-rm-dup-tables-180949
Feb 14, 2026
Merged

refactor: Centralize table formatting logic into a new formatTable utility function.#182196
jwren merged 5 commits into
flutter:masterfrom
jwren:running-apps-03-rm-dup-tables-180949

Conversation

@jwren

@jwren jwren commented Feb 11, 2026

Copy link
Copy Markdown
Member

This resolves #180949

This is follow-up on #180098

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 11, 2026
@jwren jwren requested a review from bkonyi February 11, 2026 05:00

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors duplicated table formatting logic into a new centralized utility function formatTable. This is a good improvement for code reuse and maintainability. The changes in running_apps.dart and device.dart correctly adopt this new utility. I've found an opportunity to improve the new formatTable function for robustness and performance. Please see my detailed comment.

Comment thread packages/flutter_tools/lib/src/base/utils.dart
// Join columns into lines of text
return <String>[
for (final List<String> row in table)
'$indentString${indices.map<String>((int i) => row[i].padRight(widths[i])).followedBy(<String>[row.last]).join(separator)}',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit hard to read. How about this?

  return table.map<String>((row) {
    final formatted = indices
        .map<String>((int i) => row[i].padRight(widths[i]))
        .followedBy(<String>[row.last])
        .join();
    return '$indentString$formatted';
  }).toList();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread packages/flutter_tools/lib/src/base/utils.dart
<String>['Col1', 'Col2'],
<String>['Value1', 'Value2'],
]),
<String>['Col1 • Col2', 'Value1 • Value2'],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it maybe worth joining the result and verifying against the resulting formatted string? Visually, it'll be easier to tell that the formatting is correct:

const expected = '''
Col1   • Col2
Value1 • Value2
''';

expect(
  formatTable(<List<String>>[
    <String>['Col1', 'Col2'],
    <String>['Value1', 'Value2'],
  ]).join(Platform.lineTerminator),
  expected,
);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jwren jwren force-pushed the running-apps-03-rm-dup-tables-180949 branch from 0844cf1 to c055309 Compare February 13, 2026 08:57
@jwren jwren requested a review from bkonyi February 13, 2026 08:58

@bkonyi bkonyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once analysis check is passing. Thanks for coming back to this!

@jwren jwren force-pushed the running-apps-03-rm-dup-tables-180949 branch from c055309 to 4720b7b Compare February 13, 2026 21:58
@jwren jwren added this pull request to the merge queue Feb 13, 2026
Merged via the queue into flutter:master with commit ac3aa6d Feb 14, 2026
147 of 148 checks passed
@jwren jwren deleted the running-apps-03-rm-dup-tables-180949 branch February 14, 2026 00:09
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Feb 17, 2026
Roll Flutter from 9bda20a11f1e to 6e4a481bdf27 (103 revisions)

flutter/flutter@9bda20a...6e4a481

2026-02-17 [email protected] Fix iOS CI tests for Xcode 26 Swift compatibility (flutter/flutter#182132)
2026-02-17 [email protected] Revert "[Android] Add mechanism for setting Android engine flags via … (flutter/flutter#182388)
2026-02-17 [email protected] Roll Skia from 4ed9faf843e6 to dfe78d132e24 (1 revision) (flutter/flutter#182485)
2026-02-17 [email protected] Roll Skia from ff0af46bf172 to 4ed9faf843e6 (2 revisions) (flutter/flutter#182483)
2026-02-17 [email protected] Roll Skia from 24c7b6f5760f to ff0af46bf172 (1 revision) (flutter/flutter#182481)
2026-02-16 [email protected] Roll Dart SDK from ff57548fcf54 to 44895e617182 (1 revision) (flutter/flutter#182479)
2026-02-16 [email protected] Roll Fuchsia Linux SDK from YND8TyaxKkkkEvlD9... to mcN42vw48OPH3JDNm... (flutter/flutter#182478)
2026-02-16 [email protected] Roll Dart SDK from c819ebe0cbe3 to ff57548fcf54 (1 revision) (flutter/flutter#182472)
2026-02-16 [email protected] feat: add routes support in TestWidgetsApp (flutter/flutter#181695)
2026-02-16 [email protected] Roll Skia from 5c8a6641902f to 24c7b6f5760f (1 revision) (flutter/flutter#182467)
2026-02-16 [email protected] Roll Skia from 94d5d5e5f785 to 5c8a6641902f (6 revisions) (flutter/flutter#182463)
2026-02-16 [email protected] Roll Dart SDK from f2289e13a20a to c819ebe0cbe3 (1 revision) (flutter/flutter#182462)
2026-02-15 [email protected] Roll Dart SDK from 294e6e248512 to f2289e13a20a (1 revision) (flutter/flutter#182448)
2026-02-15 [email protected] Roll Skia from b7cea4cbe546 to 94d5d5e5f785 (1 revision) (flutter/flutter#182446)
2026-02-15 [email protected] Roll Fuchsia Linux SDK from pkyhAZ3sQZDzeNZym... to YND8TyaxKkkkEvlD9... (flutter/flutter#182445)
2026-02-15 [email protected] Roll Skia from a3a82d359a7b to b7cea4cbe546 (1 revision) (flutter/flutter#182439)
2026-02-15 [email protected] Roll Skia from a147ae2d4adc to a3a82d359a7b (1 revision) (flutter/flutter#182435)
2026-02-15 [email protected] Roll Dart SDK from f82ec89435f5 to 294e6e248512 (1 revision) (flutter/flutter#182432)
2026-02-14 [email protected] Roll Skia from 91d158b0a61e to a147ae2d4adc (2 revisions) (flutter/flutter#182424)
2026-02-14 [email protected] Roll Fuchsia Linux SDK from V30FBkJySjFKXwVjW... to pkyhAZ3sQZDzeNZym... (flutter/flutter#182423)
2026-02-14 [email protected] Roll Skia from e5a18f8f0d4a to 91d158b0a61e (1 revision) (flutter/flutter#182422)
2026-02-14 [email protected] Roll Dart SDK from 7a2a28dbd0d4 to f82ec89435f5 (2 revisions) (flutter/flutter#182414)
2026-02-14 [email protected] Roll Skia from befeec673f1b to e5a18f8f0d4a (1 revision) (flutter/flutter#182412)
2026-02-14 [email protected] Roll Skia from 7dc3ba9b1d90 to befeec673f1b (1 revision) (flutter/flutter#182408)
2026-02-14 [email protected] [Web] Fix IME and selection by syncing more text styles (flutter/flutter#180436)
2026-02-14 [email protected] Roll Skia from bb69b5b71b4f to 7dc3ba9b1d90 (2 revisions) (flutter/flutter#182401)
2026-02-14 [email protected] Disable multithread opengles, enables remaining fragment shader tests (flutter/flutter#182384)
2026-02-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Standardize on Test* widgets in *_tester.dart files (#182395)" (flutter/flutter#182406)
2026-02-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix cross imports for all Cupertino tests (#181634)" (flutter/flutter#182404)
2026-02-13 [email protected] Add await to tester.pump callsites (flutter/flutter#182398)
2026-02-13 [email protected] refactor: Centralize table formatting logic into a new `formatTable` utility function. (flutter/flutter#182196)
2026-02-13 [email protected] Adds impeller backend to golden workspace name (flutter/flutter#182387)
2026-02-13 [email protected] Standardize on Test* widgets in *_tester.dart files (flutter/flutter#182395)
2026-02-13 [email protected] Remove Material dependency from transformed_scrollable_test.dart (flutter/flutter#182141)
2026-02-13 [email protected] Fix cross imports for all Cupertino tests (flutter/flutter#181634)
2026-02-13 [email protected] remove MaterialApp import from raw_radio_test.dart (flutter/flutter#181721)
2026-02-13 [email protected] Roll Skia from e2991aa99710 to bb69b5b71b4f (37 revisions) (flutter/flutter#182390)
2026-02-13 [email protected] Turns on most of fragment_shader_test.dart for opengles (flutter/flutter#182229)
2026-02-13 [email protected] Update `CHANGELOG` for 3.41.1 release (flutter/flutter#182393)
2026-02-13 [email protected] Remove Material dependency from semantics_keep_alive_offstage_test.dart (flutter/flutter#182211)
2026-02-13 [email protected] Update iOS/macOS plugin template to add dependency on FlutterFramework (flutter/flutter#181416)
2026-02-13 [email protected] Add plugin dependencies to Add to App FlutterPluginRegistrant (flutter/flutter#182304)
2026-02-13 [email protected] Preparation to add contentTextStyle flag to SimpleDialog. (flutter/flutter#182200)
2026-02-13 [email protected] Roll Packages from af1d610 to 09104b0 (4 revisions) (flutter/flutter#182383)
2026-02-13 [email protected] Roll Dart SDK from de5915148fde to 7a2a28dbd0d4 (2 revisions) (flutter/flutter#182380)
2026-02-13 [email protected] [Impeller] Dispose thread local caches on each frame when using GPUSurfaceVulkanImpeller with a delegate (flutter/flutter#182265)
...
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
okorohelijah pushed a commit to okorohelijah/packages that referenced this pull request Mar 26, 2026
…er#11041)

Roll Flutter from 9bda20a11f1e to 6e4a481bdf27 (103 revisions)

flutter/flutter@9bda20a...6e4a481

2026-02-17 [email protected] Fix iOS CI tests for Xcode 26 Swift compatibility (flutter/flutter#182132)
2026-02-17 [email protected] Revert "[Android] Add mechanism for setting Android engine flags via … (flutter/flutter#182388)
2026-02-17 [email protected] Roll Skia from 4ed9faf843e6 to dfe78d132e24 (1 revision) (flutter/flutter#182485)
2026-02-17 [email protected] Roll Skia from ff0af46bf172 to 4ed9faf843e6 (2 revisions) (flutter/flutter#182483)
2026-02-17 [email protected] Roll Skia from 24c7b6f5760f to ff0af46bf172 (1 revision) (flutter/flutter#182481)
2026-02-16 [email protected] Roll Dart SDK from ff57548fcf54 to 44895e617182 (1 revision) (flutter/flutter#182479)
2026-02-16 [email protected] Roll Fuchsia Linux SDK from YND8TyaxKkkkEvlD9... to mcN42vw48OPH3JDNm... (flutter/flutter#182478)
2026-02-16 [email protected] Roll Dart SDK from c819ebe0cbe3 to ff57548fcf54 (1 revision) (flutter/flutter#182472)
2026-02-16 [email protected] feat: add routes support in TestWidgetsApp (flutter/flutter#181695)
2026-02-16 [email protected] Roll Skia from 5c8a6641902f to 24c7b6f5760f (1 revision) (flutter/flutter#182467)
2026-02-16 [email protected] Roll Skia from 94d5d5e5f785 to 5c8a6641902f (6 revisions) (flutter/flutter#182463)
2026-02-16 [email protected] Roll Dart SDK from f2289e13a20a to c819ebe0cbe3 (1 revision) (flutter/flutter#182462)
2026-02-15 [email protected] Roll Dart SDK from 294e6e248512 to f2289e13a20a (1 revision) (flutter/flutter#182448)
2026-02-15 [email protected] Roll Skia from b7cea4cbe546 to 94d5d5e5f785 (1 revision) (flutter/flutter#182446)
2026-02-15 [email protected] Roll Fuchsia Linux SDK from pkyhAZ3sQZDzeNZym... to YND8TyaxKkkkEvlD9... (flutter/flutter#182445)
2026-02-15 [email protected] Roll Skia from a3a82d359a7b to b7cea4cbe546 (1 revision) (flutter/flutter#182439)
2026-02-15 [email protected] Roll Skia from a147ae2d4adc to a3a82d359a7b (1 revision) (flutter/flutter#182435)
2026-02-15 [email protected] Roll Dart SDK from f82ec89435f5 to 294e6e248512 (1 revision) (flutter/flutter#182432)
2026-02-14 [email protected] Roll Skia from 91d158b0a61e to a147ae2d4adc (2 revisions) (flutter/flutter#182424)
2026-02-14 [email protected] Roll Fuchsia Linux SDK from V30FBkJySjFKXwVjW... to pkyhAZ3sQZDzeNZym... (flutter/flutter#182423)
2026-02-14 [email protected] Roll Skia from e5a18f8f0d4a to 91d158b0a61e (1 revision) (flutter/flutter#182422)
2026-02-14 [email protected] Roll Dart SDK from 7a2a28dbd0d4 to f82ec89435f5 (2 revisions) (flutter/flutter#182414)
2026-02-14 [email protected] Roll Skia from befeec673f1b to e5a18f8f0d4a (1 revision) (flutter/flutter#182412)
2026-02-14 [email protected] Roll Skia from 7dc3ba9b1d90 to befeec673f1b (1 revision) (flutter/flutter#182408)
2026-02-14 [email protected] [Web] Fix IME and selection by syncing more text styles (flutter/flutter#180436)
2026-02-14 [email protected] Roll Skia from bb69b5b71b4f to 7dc3ba9b1d90 (2 revisions) (flutter/flutter#182401)
2026-02-14 [email protected] Disable multithread opengles, enables remaining fragment shader tests (flutter/flutter#182384)
2026-02-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Standardize on Test* widgets in *_tester.dart files (#182395)" (flutter/flutter#182406)
2026-02-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix cross imports for all Cupertino tests (#181634)" (flutter/flutter#182404)
2026-02-13 [email protected] Add await to tester.pump callsites (flutter/flutter#182398)
2026-02-13 [email protected] refactor: Centralize table formatting logic into a new `formatTable` utility function. (flutter/flutter#182196)
2026-02-13 [email protected] Adds impeller backend to golden workspace name (flutter/flutter#182387)
2026-02-13 [email protected] Standardize on Test* widgets in *_tester.dart files (flutter/flutter#182395)
2026-02-13 [email protected] Remove Material dependency from transformed_scrollable_test.dart (flutter/flutter#182141)
2026-02-13 [email protected] Fix cross imports for all Cupertino tests (flutter/flutter#181634)
2026-02-13 [email protected] remove MaterialApp import from raw_radio_test.dart (flutter/flutter#181721)
2026-02-13 [email protected] Roll Skia from e2991aa99710 to bb69b5b71b4f (37 revisions) (flutter/flutter#182390)
2026-02-13 [email protected] Turns on most of fragment_shader_test.dart for opengles (flutter/flutter#182229)
2026-02-13 [email protected] Update `CHANGELOG` for 3.41.1 release (flutter/flutter#182393)
2026-02-13 [email protected] Remove Material dependency from semantics_keep_alive_offstage_test.dart (flutter/flutter#182211)
2026-02-13 [email protected] Update iOS/macOS plugin template to add dependency on FlutterFramework (flutter/flutter#181416)
2026-02-13 [email protected] Add plugin dependencies to Add to App FlutterPluginRegistrant (flutter/flutter#182304)
2026-02-13 [email protected] Preparation to add contentTextStyle flag to SimpleDialog. (flutter/flutter#182200)
2026-02-13 [email protected] Roll Packages from af1d610 to 09104b0 (4 revisions) (flutter/flutter#182383)
2026-02-13 [email protected] Roll Dart SDK from de5915148fde to 7a2a28dbd0d4 (2 revisions) (flutter/flutter#182380)
2026-02-13 [email protected] [Impeller] Dispose thread local caches on each frame when using GPUSurfaceVulkanImpeller with a delegate (flutter/flutter#182265)
...
mboetger pushed a commit to mboetger/flutter that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate table output from flutter devices and flutter running-apps

2 participants