Skip to content

Commit c79953b

Browse files
committed
Mirror the remaining commonly used Flutter parameters
Radio side/innerRadius/backgroundColor; Slider showValueIndicator, secondaryTrackValue, secondaryActiveTrackColor and padding; ListTile minTileHeight and titleAlignment; CircularProgressIndicator strokeAlign and trackGap; ExpansionTile showTrailingIcon; Text softWrap. New enums ShowValueIndicatorC and ListTileTitleAlignmentC. All optional with Flutter's defaults, so existing JSON is unchanged. Button minimumSize/fixedSize stay out: the node's box sizes the button. Also run CI on pushes to every branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A67XoQYsLVvoMtiKcXXUxY
1 parent c9df812 commit c79953b

18 files changed

Lines changed: 438 additions & 61 deletions

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
65
pull_request:
76
workflow_dispatch:
87

‎CHANGELOG.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,17 @@
3232
`AutovalidateModeC.onUnfocus`/`onUserInteractionIfError`,
3333
`SliderTrackShapeEnum.gapped`, `SliderValueIndicatorShape.drop`/
3434
`roundedRectangle` and `CShapeBorder.roundedSuperellipse`.
35-
- Add `AppBarProperties.foregroundColor`/`scrolledUnderElevation` and
36-
`TabBarProperties.tabAlignment`/`dividerHeight`.
35+
- Add Flutter parameters that were missing:
36+
- `AppBarProperties.foregroundColor`, `scrolledUnderElevation`
37+
- `TabBarProperties.tabAlignment` (new `TabAlignmentC`), `dividerHeight`
38+
- `RadioProperties.side`, `innerRadius`, `backgroundColor`
39+
- `SliderProperties.showValueIndicator` (new `ShowValueIndicatorC`),
40+
`secondaryTrackValue`, `secondaryActiveTrackColor`, `padding`
41+
- `ListTileProperties.minTileHeight`, `titleAlignment` (new
42+
`ListTileTitleAlignmentC`)
43+
- `MaterialLoadingIndicatorProperties.strokeAlign`, `trackGap`
44+
- `ExpansionTileProperties.showTrailingIcon`
45+
- `TextMixin.softWrap`
3746
- Document the Flutter replacements for deprecated `cacheExtent`
3847
(`scrollCacheExtent`) and `Radio.groupValue` (`RadioGroup`).
3948
- New nodes use Material 3 defaults: switches use Material 3, buttons are

‎lib/src/api/mixins.dart‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,25 @@ enum SliderTrackShapeEnum {
562562
}
563563
}
564564

565+
/// When a slider shows its value indicator. Mirrors Flutter's
566+
/// `ShowValueIndicator`.
567+
enum ShowValueIndicatorC {
568+
/// Only for discrete sliders, while dragging.
569+
onlyForDiscrete,
570+
571+
/// Only for continuous sliders, while dragging.
572+
onlyForContinuous,
573+
574+
/// For all sliders, while dragging.
575+
onDrag,
576+
577+
/// Always, regardless of interaction.
578+
alwaysVisible,
579+
580+
/// Never.
581+
never,
582+
}
583+
565584
/// Represents the shape of the value indicator showed above the thumb of a
566585
/// slider when interacted.
567586
enum SliderValueIndicatorShape {

‎lib/src/api/models/list_tile_control_affinity.dart‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,23 @@ enum ListTileControlAffinityC {
1414
/// side.
1515
platform,
1616
}
17+
18+
/// How a list tile aligns its leading and trailing widgets with its title.
19+
/// Mirrors Flutter's `ListTileTitleAlignment`.
20+
enum ListTileTitleAlignmentC {
21+
/// Top-aligned for three-line tiles, centered otherwise. The Material 3
22+
/// default.
23+
threeLine,
24+
25+
/// Aligned relative to the title's height. The Material 2 default.
26+
titleHeight,
27+
28+
/// Aligned to the top of the tile.
29+
top,
30+
31+
/// Centered in the tile.
32+
center,
33+
34+
/// Aligned to the bottom of the tile.
35+
bottom,
36+
}

‎lib/src/api/nodes/button_node.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ class ButtonNode extends SceneNode with CustomPropertiesMixin {
194194
}
195195

196196
/// Holds configurable properties of a [ButtonNode].
197+
///
198+
/// Flutter's `ButtonStyle.minimumSize` and `fixedSize` are not repeated here:
199+
/// the node's box is the button's size.
197200
@JsonSerializable()
198201
class ButtonProperties extends CustomProperties
199202
with ShapeBorderMixin, FieldsHolder {

‎lib/src/api/nodes/expansion_tile_node.dart‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ class ExpansionTileProperties extends CustomProperties with FieldsHolder {
226226
/// Whether to show a divider between header and body.
227227
bool showDividers;
228228

229+
/// Whether to show the expansion arrow. Mirrors
230+
/// `ExpansionTile.showTrailingIcon`.
231+
bool showTrailingIcon;
232+
229233
/// Platform or null affinity defaults to trailing.
230234
ListTileControlAffinityC effectiveAffinity(
231235
ListTileControlAffinityC? affinity,
@@ -256,6 +260,7 @@ class ExpansionTileProperties extends CustomProperties with FieldsHolder {
256260
this.controlAffinity,
257261
this.visualDensity = VisualDensityModel.standard,
258262
this.showDividers = true,
263+
this.showTrailingIcon = true,
259264
});
260265

261266
/// Duplicates this [ExpansionTileProperties] instance with given data
@@ -276,6 +281,7 @@ class ExpansionTileProperties extends CustomProperties with FieldsHolder {
276281
ListTileControlAffinityC? controlAffinity,
277282
VisualDensityModel? visualDensity,
278283
bool? showDividers,
284+
bool? showTrailingIcon,
279285
}) {
280286
return ExpansionTileProperties(
281287
backgroundColor: backgroundColor ?? this.backgroundColor,
@@ -295,6 +301,7 @@ class ExpansionTileProperties extends CustomProperties with FieldsHolder {
295301
controlAffinity: controlAffinity ?? this.controlAffinity,
296302
visualDensity: visualDensity ?? this.visualDensity,
297303
showDividers: showDividers ?? this.showDividers,
304+
showTrailingIcon: showTrailingIcon ?? this.showTrailingIcon,
298305
);
299306
}
300307

@@ -393,6 +400,12 @@ class ExpansionTileProperties extends CustomProperties with FieldsHolder {
393400
(value) => showDividers = value,
394401
requiresLayout: true,
395402
),
403+
'showTrailingIcon': BoolFieldAccess(
404+
'Show Trailing Icon',
405+
'Whether to show the expansion arrow.',
406+
() => showTrailingIcon,
407+
(value) => showTrailingIcon = value,
408+
),
396409
};
397410

398411
@override
@@ -412,6 +425,7 @@ class ExpansionTileProperties extends CustomProperties with FieldsHolder {
412425
controlAffinity,
413426
visualDensity,
414427
showDividers,
428+
showTrailingIcon,
415429
];
416430

417431
@override

‎lib/src/api/nodes/expansion_tile_node.g.dart‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/src/api/nodes/list_tile_node.dart‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,15 @@ class ListTileProperties extends CustomProperties
283283
/// Whether to show the trailing widget.
284284
bool showTrailing;
285285

286+
/// Minimum height of the tile. When null, Flutter derives it from the number
287+
/// of lines and [visualDensity]. Mirrors `ListTile.minTileHeight`.
288+
double? minTileHeight;
289+
290+
/// How the leading and trailing widgets align with the title. When null,
291+
/// Flutter uses [ListTileTitleAlignmentC.threeLine] in Material 3. Mirrors
292+
/// `ListTile.titleAlignment`.
293+
ListTileTitleAlignmentC? titleAlignment;
294+
286295
/// Creates a new [ListTileProperties] with given data.
287296
ListTileProperties({
288297
this.showLeading = true,
@@ -311,6 +320,8 @@ class ListTileProperties extends CustomProperties
311320
this.minLeadingWidth,
312321
ColorRGBA? borderColor,
313322
double? borderWidth,
323+
this.minTileHeight,
324+
this.titleAlignment,
314325
}) {
315326
setShapeBorderMixin(
316327
shape: shape,
@@ -349,6 +360,8 @@ class ListTileProperties extends CustomProperties
349360
bool? showTitle,
350361
bool? showSubtitle,
351362
bool? showTrailing,
363+
double? minTileHeight,
364+
ListTileTitleAlignmentC? titleAlignment,
352365
}) {
353366
return ListTileProperties(
354367
isThreeLine: isThreeLine ?? this.isThreeLine,
@@ -377,6 +390,8 @@ class ListTileProperties extends CustomProperties
377390
showTitle: showTitle ?? this.showTitle,
378391
showSubtitle: showSubtitle ?? this.showSubtitle,
379392
showTrailing: showTrailing ?? this.showTrailing,
393+
minTileHeight: minTileHeight ?? this.minTileHeight,
394+
titleAlignment: titleAlignment ?? this.titleAlignment,
380395
);
381396
}
382397

@@ -492,6 +507,22 @@ class ListTileProperties extends CustomProperties
492507
(value) => minLeadingWidth = value,
493508
requiresLayout: true,
494509
),
510+
'minTileHeight': NumFieldAccess<double?>(
511+
'Min Tile Height',
512+
'Minimum height of the tile.',
513+
() => minTileHeight,
514+
(value) => minTileHeight = value,
515+
requiresLayout: true,
516+
),
517+
'titleAlignment': EnumFieldAccess<ListTileTitleAlignmentC?>(
518+
'Title Alignment',
519+
'How the leading and trailing widgets align with the title.',
520+
() => titleAlignment,
521+
(value) => titleAlignment = value,
522+
defaultValue: () => null,
523+
options: () => ListTileTitleAlignmentC.values,
524+
requiresLayout: true,
525+
),
495526
};
496527

497528
@override
@@ -521,6 +552,8 @@ class ListTileProperties extends CustomProperties
521552
showTitle,
522553
showSubtitle,
523554
showTrailing,
555+
minTileHeight,
556+
titleAlignment,
524557
];
525558

526559
@override

‎lib/src/api/nodes/list_tile_node.g.dart‎

Lines changed: 45 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)