tane/apps/app_seeds/lib/ui/theme.dart
vjrj 42c16c0e3f feat(ui): Material 3 redesign, cover-photo viewer, About screen
Apply a Material 3 seed-green palette and rounded components across the
home, inventory, quick-add, quantity picker and variety-detail screens.
The full-screen photo viewer can now set any photo as the cover (via
attachment sort order) and delete after confirmation. Lot forms and
packaging surface as choice chips.

Extract About out of Settings into its own screen (app version via
package_info_plus, website link). Add es/en strings for the new lot
types, presentation, home tagline and About. Update Seedees v2 mockups.
2026-07-09 11:51:59 +02:00

104 lines
4 KiB
Dart

import 'package:flutter/material.dart';
/// Material 3 palette from the Seedees v2 redesign
/// (docs/mockups/seedees_material3.html): green app bars over a pale-green
/// canvas, a saturated green for primary actions (FAB, buttons, links, category
/// headers) and a soft green container for selected/tonal surfaces.
const seedGreen = Color(0xFF2F7D34); // primary (actions, links, headers)
const seedGreenDark = Color(0xFF22521E); // status bar / darker green
const seedAppBar = Color(0xFF3E8C38); // app-bar green
const seedCanvas = Color(0xFFE7F1E0); // surface / scaffold
const seedPrimaryContainer = Color(0xFFD3E8C8); // tonal green container
const seedOnPrimaryContainer = Color(0xFF2F6D2A);
const seedField = Color(0xFFF3F7EE); // outlined field fill
const seedAvatar = Color(0xFFCFE7C3); // list avatar disc
const seedOnAvatar = Color(0xFF3B7A34);
const seedOutline = Color(0xFFC3CBB6);
const seedDivider = Color(0xFFE4E9DD);
const seedTitle = Color(0xFF1B2416); // heading text on canvas
const seedOnSurface = Color(0xFF1B2416);
const seedOnSurfaceVariant = Color(0xFF5C6B52); // scientific names, secondary
const seedMuted = Color(0xFF8A9880); // hints, list edit icon
const seedRating = Color(0xFFE8A200); // stars
ThemeData buildTaneTheme() {
final scheme =
ColorScheme.fromSeed(
seedColor: seedGreen,
brightness: Brightness.light,
).copyWith(
primary: seedGreen,
onPrimary: Colors.white,
primaryContainer: seedPrimaryContainer,
onPrimaryContainer: seedOnPrimaryContainer,
secondaryContainer: seedPrimaryContainer,
onSecondaryContainer: seedOnPrimaryContainer,
tertiary: seedRating,
onTertiary: Colors.white,
surface: seedCanvas,
onSurface: seedOnSurface,
surfaceContainerHighest: seedField,
onSurfaceVariant: seedOnSurfaceVariant,
outline: seedMuted,
outlineVariant: seedOutline,
);
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
scaffoldBackgroundColor: seedCanvas,
// Green app bars — aligned with the v2 mockups and the real app.
appBarTheme: const AppBarTheme(
backgroundColor: seedAppBar,
foregroundColor: Colors.white,
surfaceTintColor: Colors.transparent,
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: false,
iconTheme: IconThemeData(color: Colors.white),
titleTextStyle: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
// Squircle FAB (20px radius) as in the mockups, in the saturated primary.
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: seedGreen,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
),
drawerTheme: const DrawerThemeData(
backgroundColor: Colors.white,
surfaceTintColor: Colors.transparent,
),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: seedCanvas,
surfaceTintColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(26)),
),
),
// Pill "Save" actions across sheets and dialogs, as in the v3 mockups.
filledButtonTheme: FilledButtonThemeData(
style: FilledButton.styleFrom(
backgroundColor: seedGreen,
foregroundColor: Colors.white,
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 13),
),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(foregroundColor: seedGreen),
),
// Green floating labels on the edit-seed / add-batch text fields. (Borders
// are left to each field so the inventory search keeps its borderless pill.)
inputDecorationTheme: const InputDecorationTheme(
floatingLabelStyle: TextStyle(color: seedGreen),
),
dividerTheme: const DividerThemeData(
space: 1,
thickness: 1,
color: seedDivider,
),
);
}