-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Use case
I see that SegmentedButton are only ment to be horizontal, but we often see the need to arrange them vertically.
An example below (snipped from an android/kotlin app):

Proposal
Please add a direction parameter in SegmentedButton, which turns the direction of the layout.
...such as this one, actually suggested from Gemini:
import 'package:flutter/material.dart';
// ...
SegmentedButton<int>(
style: ButtonStyle(
// Customize the button style for verticalorientation
padding: MaterialStateProperty.all(EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0)),
textStyle: MaterialStateProperty.all(TextStyle(fontSize: 16.0)),
// Add more styling as needed
),
segments: const <ButtonSegment<int>>[
ButtonSegment<int>(value: 0, label: Text('Option 1')),
ButtonSegment<int>(value: 1, label: Text('Option 2')),
ButtonSegment<int>(value: 2, label: Text('Option 3')),
// Add more segments as needed
],
selected: <int>{0}, // Set initial selection
onSelectionChanged: (Set<int> newSelection) {
// Handle selection changes
print('Selected segment: ${newSelection.first}');
},
direction: Axis.vertical, // Set the direction to vertical
)
the call has been forwarded...
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
