production
This commit is contained in:
@@ -66,19 +66,26 @@ void main() {
|
||||
// still holds is the one that matters: whatever the bar's surface is, the
|
||||
// type on it has to clear contrast against it, and every bar in the app has
|
||||
// to agree on the answer.
|
||||
testWidgets('is solid brand with a white title', (tester) async {
|
||||
testWidgets('is the brand ground with a white title', (tester) async {
|
||||
await pump(
|
||||
tester,
|
||||
Scaffold(appBar: milerPageBar('Saved Addresses', onBack: () {})),
|
||||
);
|
||||
|
||||
final bar = tester.widget<AppBar>(find.byType(AppBar));
|
||||
expect(bar.backgroundColor, ColorConstants.primary);
|
||||
expect(
|
||||
bar.flexibleSpace,
|
||||
isNull,
|
||||
reason: 'a solid ground needs no surface layered over it',
|
||||
);
|
||||
// ── The fill is transparent, and the surface paints ──
|
||||
//
|
||||
// It was the brand as a safety net behind [kBrandGradient]. It cannot be
|
||||
// one now: the bar's bottom corners are rounded so the page shows through
|
||||
// them (see [milerBrandSurface]), and an opaque rectangle behind a
|
||||
// rounded surface fills in exactly the two corners the curve exists to
|
||||
// open. What must hold is that the bar still *renders* the brand, which
|
||||
// is the gradient assertion below.
|
||||
expect(bar.backgroundColor, Colors.transparent);
|
||||
// [kBrandGradient], as a `flexibleSpace` — a colour cannot be a gradient.
|
||||
// The fill stays the brand red underneath, so a bar that fails to paint
|
||||
// its surface comes out the right colour rather than transparent.
|
||||
expect(bar.flexibleSpace, isNotNull);
|
||||
expect(
|
||||
bar.systemOverlayStyle?.statusBarIconBrightness,
|
||||
Brightness.light,
|
||||
|
||||
Reference in New Issue
Block a user