refactor(desktop): reorganize workspace panels and navigation
This commit is contained in:
1 parent
826745b407
commit
1f73765745
92 files changed
+5811
-2650
No files matched your search
@@ -0,0 +1,59 @@
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
for (final theme in [AppTheme.penLight, AppTheme.penDark]) {
|
||||
testWidgets('toolbar menu feedback is neutral in ${theme.brightness}', (
|
||||
tester,
|
||||
) async {
|
||||
var presses = 0;
|
||||
final focus = FocusNode();
|
||||
addTearDown(focus.dispose);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: theme,
|
||||
home: Scaffold(
|
||||
body: AppToolbarDropdownButton(
|
||||
buttonKey: const Key('trigger'),
|
||||
focusNode: focus,
|
||||
onPressed: () => presses++,
|
||||
style: const ButtonStyle(
|
||||
overlayColor: WidgetStatePropertyAll(Colors.blue),
|
||||
),
|
||||
child: const Text('Projects'),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
final button = tester.widget<TextButton>(
|
||||
find.byKey(const Key('trigger')),
|
||||
);
|
||||
for (final state in [
|
||||
WidgetState.hovered,
|
||||
WidgetState.focused,
|
||||
WidgetState.pressed,
|
||||
]) {
|
||||
expect(
|
||||
button.style!.backgroundColor!.resolve({state}),
|
||||
Colors.transparent,
|
||||
);
|
||||
expect(
|
||||
button.style!.overlayColor!.resolve({state}),
|
||||
theme.colorScheme.onSurface.withValues(alpha: .05),
|
||||
);
|
||||
expect(
|
||||
button.style!.overlayColor!.resolve({state, WidgetState.disabled}),
|
||||
Colors.transparent,
|
||||
);
|
||||
}
|
||||
await tester.tap(find.byKey(const Key('trigger')));
|
||||
await tester.pump();
|
||||
expect(presses, 1);
|
||||
focus.requestFocus();
|
||||
await tester.pump();
|
||||
expect(focus.hasFocus, isTrue);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user