Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Page transitions consistency on desktop platforms (#203)
* Consistent page transition on all desktop platforms. Per conversation in canonical/ubuntu-desktop-installer#1121 * Test for page transitions consistency on desktop platforms.
- Loading branch information
1 parent
536d067
commit 6f7fb5d
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:yaru/src/themes/yaru.dart'; | ||
|
||
void main() { | ||
testWidgets('consistent page transitions', (_) async { | ||
const platforms = [ | ||
TargetPlatform.linux, | ||
TargetPlatform.macOS, | ||
TargetPlatform.windows, | ||
]; | ||
final builders = yaruLight.pageTransitionsTheme.builders; | ||
final first = builders.entries.first.value; | ||
var allEqual = false; | ||
|
||
for (var entry in builders.entries) { | ||
if (platforms.contains(entry.key)) { | ||
allEqual = entry.value == first; | ||
} | ||
} | ||
expect(allEqual, isTrue); | ||
}); | ||
} |