Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing the cursor attribute of the ListTile widget #901

Merged
merged 3 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [next]

- Exposing the cursor attribute on the ListTile widget

## 4.7.1

- Add vertical support to `CommandBar`. ([#872](https://github.com/bdlukaa/fluent_ui/pull/872))
Expand Down
14 changes: 13 additions & 1 deletion lib/src/controls/surfaces/list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ListTile extends StatelessWidget {
this.focusNode,
this.autofocus = false,
this.semanticLabel,
this.cursor,
}) : assert(
subtitle != null ? title != null : true,
'To have a subtitle, there must be a title',
Expand All @@ -65,6 +66,7 @@ class ListTile extends StatelessWidget {
this.selectionMode = ListTileSelectionMode.single,
this.onSelectionChange,
this.semanticLabel,
this.cursor,
}) : assert(
subtitle != null ? title != null : true,
'To have a subtitle, there must be a title',
Expand Down Expand Up @@ -140,9 +142,18 @@ class ListTile extends StatelessWidget {
/// {@macro flutter.widgets.Focus.autofocus}
final bool autofocus;

// {@macro fluent_ui.controls.inputs.HoverButton.semanticLabel}
/// {@macro fluent_ui.controls.inputs.HoverButton.semanticLabel}
final String? semanticLabel;

/// Mouse Cursor to display
///
/// If null, [MouseCursor.defer] is used by default
///
/// See also cursors like:
///
/// * [SystemMouseCursors.click], which turns the mouse cursor to click
final MouseCursor? cursor;

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
Expand Down Expand Up @@ -187,6 +198,7 @@ class ListTile extends StatelessWidget {
onPressed ?? (onSelectionChange != null ? _onSelectionChange : null),
focusNode: focusNode,
autofocus: autofocus,
cursor: cursor,
semanticLabel: semanticLabel,
builder: (context, states) {
final tileColor = () {
Expand Down
Loading