- add INTERNET permission, iOS localizations, html lang - make focus ring visible on FilledButton - neutral SITE_URL default, idempotent logger configure Refs #31 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
62 lines
1.7 KiB
Dart
62 lines
1.7 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
/// Spacing tokens (dp) on a 4dp grid.
|
|
abstract final class AppSpacing {
|
|
static const double xxs = 2;
|
|
static const double xs = 4;
|
|
static const double sm = 8;
|
|
static const double md = 12;
|
|
static const double lg = 16;
|
|
static const double xl = 24;
|
|
static const double xxl = 32;
|
|
static const double xxxl = 48;
|
|
|
|
/// Minimum size of interactive targets (WCAG 2.5.5 / Material: 48dp).
|
|
static const double minTouchTarget = 48;
|
|
|
|
/// Page padding per width class.
|
|
static EdgeInsets pagePadding(double width) => EdgeInsets.symmetric(
|
|
horizontal: width >= AppBreakpoints.expanded
|
|
? xxl
|
|
: width >= AppBreakpoints.medium
|
|
? xl
|
|
: lg,
|
|
vertical: lg,
|
|
);
|
|
}
|
|
|
|
/// Corner radius tokens (dp).
|
|
abstract final class AppRadius {
|
|
static const double sm = 8;
|
|
static const double md = 12;
|
|
static const double lg = 16;
|
|
static const double xl = 28;
|
|
|
|
static BorderRadius get smAll => BorderRadius.circular(sm);
|
|
static BorderRadius get mdAll => BorderRadius.circular(md);
|
|
static BorderRadius get lgAll => BorderRadius.circular(lg);
|
|
}
|
|
|
|
/// Width breakpoints: compact < 600, medium 600-1023, expanded >= 1024.
|
|
abstract final class AppBreakpoints {
|
|
static const double medium = 600;
|
|
static const double expanded = 1024;
|
|
|
|
/// Max content width for forms/text on wide screens.
|
|
static const double maxContentWidth = 560;
|
|
|
|
/// Max width of the centered auth card (Spec #1 § 6) from the medium class on.
|
|
static const double authCardMaxWidth = 480;
|
|
}
|
|
|
|
enum AppWidthClass {
|
|
compact,
|
|
medium,
|
|
expanded;
|
|
|
|
static AppWidthClass of(double width) => width >= AppBreakpoints.expanded
|
|
? expanded
|
|
: width >= AppBreakpoints.medium
|
|
? medium
|
|
: compact;
|
|
}
|