9adee6cc60
Keep the public Cupertino-compatible parameters while retaining only the Material implementations and tests. The app is Material-only, so deleting unreachable Cupertino branches reduces dead code without changing the active path.
42 lines
1.4 KiB
Dart
42 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/ui/theme/app_theme.dart';
|
|
|
|
void main() {
|
|
test('dark mode is a near-black gray, with lighter layers above it', () {
|
|
final scheme = appDarkTheme().colorScheme;
|
|
expect(scheme.surface, const Color(0xFF141416));
|
|
expect(appDarkTheme().scaffoldBackgroundColor, scheme.surface);
|
|
final steps = [
|
|
scheme.surface,
|
|
scheme.surfaceContainerLow,
|
|
scheme.surfaceContainer,
|
|
scheme.surfaceContainerHigh,
|
|
scheme.surfaceContainerHighest,
|
|
].map((color) => color.computeLuminance()).toList();
|
|
for (var i = 1; i < steps.length; i++) {
|
|
expect(steps[i], greaterThan(steps[i - 1]));
|
|
}
|
|
});
|
|
|
|
test('page backgrounds are gray in dark mode and unchanged in light', () {
|
|
expect(AppColors.background.darkColor, const Color(0xFF141416));
|
|
expect(AppColors.background.color, const Color(0xFFFFFFFF));
|
|
expect(
|
|
AppColors.groupedBackground.darkColor,
|
|
isNot(const Color(0xFF000000)),
|
|
);
|
|
});
|
|
|
|
test('Android pages retain native predictive Back in both themes', () {
|
|
expect(
|
|
appDarkTheme().pageTransitionsTheme.builders[TargetPlatform.android],
|
|
isA<PredictiveBackPageTransitionsBuilder>(),
|
|
);
|
|
expect(
|
|
appLightTheme().pageTransitionsTheme.builders[TargetPlatform.android],
|
|
isA<PredictiveBackPageTransitionsBuilder>(),
|
|
);
|
|
});
|
|
}
|