mirror of
https://github.com/we-promise/sure.git
synced 2026-07-18 15:55:22 +00:00
On screens not yet redesigned with SureColors (the Chats list, etc.), Material's primary/secondary *container* roles were unset, so they fell back to defaults that read as blue on the FAB, unread-badge, and avatar surfaces. - Pin `primaryContainer`/`secondaryContainer` to a neutral Sure surface (`surfaceInset` + `textPrimary`), and add a `FloatingActionButtonThemeData` so FABs use Sure's neutral primary action color (`buttonPrimary`). `primary` / `secondary` stay `link` / `info`, so existing link/accent callers are unchanged. - Add a `SureLogo` widget that renders `logomark.svg` with the wordmark's `currentColor` strokes tinted to the theme's secondary text color, and route every logomark consumer (nav bar, login) through it — so the mark stays legible in dark mode (the hardcoded grey was too dim) and no caller renders the strokes as the flutter_svg default (black). The green brand mark keeps its fill. Refs #2235.
25 lines
900 B
Dart
25 lines
900 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:sure_mobile/theme/sure_theme.dart';
|
|
import 'package:sure_mobile/widgets/sure_logo.dart';
|
|
|
|
void main() {
|
|
testWidgets('renders the logomark at the requested size under the Sure theme',
|
|
(tester) async {
|
|
// Building under SureTheme.dark exercises the SureColors lookup that themes
|
|
// the wordmark's `currentColor` strokes — the regression guard for routing
|
|
// every logomark consumer through SureLogo rather than a bare SvgPicture.
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
theme: SureTheme.dark,
|
|
home: const Scaffold(body: Center(child: SureLogo(size: 40))),
|
|
),
|
|
);
|
|
|
|
final svg = tester.widget<SvgPicture>(find.byType(SvgPicture));
|
|
expect(svg.width, 40);
|
|
expect(svg.height, 40);
|
|
});
|
|
}
|