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

feat: bump yaru version to ^5.0.0 #41

Merged
merged 3 commits into from
Sep 17, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
FLUTTER_VERSION: 3.16.x
FLUTTER_VERSION: 3.24.x

jobs:
analyze:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
sdk: flutter
flutter_test:
sdk: flutter
yaru: ^4.0.0
yaru: ^5.0.0
yaru_window_platform_interface: ^0.1.0

dev_dependencies:
Expand Down
18 changes: 9 additions & 9 deletions test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ class MaterialTestState {
const MaterialTestState(this.name, this.states);

final String name;
final Set<MaterialState?> states;
final Set<WidgetState?> states;

bool get hasFocus => states.contains(MaterialState.focused);
bool get hasFocus => states.contains(WidgetState.focused);
bool get isChecked =>
states.contains(MaterialState.selected) && !states.contains(null);
bool get isEnabled => !states.contains(MaterialState.disabled);
states.contains(WidgetState.selected) && !states.contains(null);
bool get isEnabled => !states.contains(WidgetState.disabled);
bool get isPartiallyChecked =>
states.contains(MaterialState.selected) && states.contains(null);
states.contains(WidgetState.selected) && states.contains(null);

@override
String toString() => name;
}

final stateVariant = ValueVariant(const {
MaterialTestState('default', {}),
MaterialTestState('disabled', {MaterialState.disabled}),
MaterialTestState('focused', {MaterialState.focused}),
MaterialTestState('disabled', {WidgetState.disabled}),
MaterialTestState('focused', {WidgetState.focused}),
});

final togglableStateVariant = ValueVariant({
...stateVariant.values,
const MaterialTestState('unchecked', {}),
const MaterialTestState('checked', {MaterialState.selected}),
const MaterialTestState('checked', {WidgetState.selected}),
});

final partiallyTogglableStateVariant = ValueVariant({
...togglableStateVariant.values,
const MaterialTestState('partial', {null, MaterialState.selected}),
const MaterialTestState('partial', {null, WidgetState.selected}),
});

extension WidgetTesterX on WidgetTester {
Expand Down
Loading