b9e68e3bc8
Per-screen application of the design system to the Flutter app. Mirrors the web's surface phase landed in FabledScribe v26.04.28.1. Foundation port shipped in 0f05f47; this is the surface work. Lucide icon migration - Added lucide_icons ^0.257.0 dependency - 107 Material Icons references → LucideIcons across 21 files. Drop-in IconData swap (Icon(LucideIcons.X) instead of Icon(Icons.x)). - Lucide import added to each touched file. Input border radius - theme.dart inputDecorationTheme borderRadius 24 → 8 in both light and dark themes. Doc says radius-md (8px) for inputs; previous pill shape was Material default that the doc deviates from. Illuminated Transcript pattern (ChatMessageBubble) - User bubble: accent-tinted border → neutral Pewter (scheme.outline). Asymmetric corner already correct (bottomRight 4px). - Assistant bubble: topLeft corner 4 → 16; only bottomLeft stays 4 (the "tail" effect, mirroring web's `border-bottom-left-radius: 4px`). Background switched from surfaceContainerHighest (Slate) to surface (Iron) per the doc spec "card surface". - Assistant bubble glow shadow added — accent-tinted blur (28px alpha 0.14) + depth shadow (8px alpha 0.4 black). Mirrors web's --color-bubble-asst-shadow. ActionColors wiring (Hybrid rule) - 5 'Delete' confirm buttons across notes / tasks / chat conversations / calendar event sheet → Oxblood action-destructive via the ActionColors ThemeExtension defined in the foundation port. Foreground for ghost/text variants, backgroundColor for filled. - Calendar event Save button → Moss action-primary. The first call site to wire ActionColors.primary; serves as the pattern for future Save reclassifications. - Other Save buttons (note edit, task edit, project edit, etc.) still flow through colorScheme.primary (dusty violet) and read as brand-moment. Reclassifying those is deferred — the wiring pattern is established and can be applied incrementally as files are touched. Indigo cleanup - 4 hardcoded #7C3AED / #5B21B6 literals → dusty-violet equivalents (#5B4A8A / #3F3560). Spots: project_tasks_screen color fallback (×2), journal_screen gradient. Verification - flutter analyze: No issues found What's deferred - Per-screen Save / Cancel reclassification beyond the calendar event Save button. Wiring pattern established; rollout opportunistic. - Long-form 1.7 line-height on assistant Markdown content (would require MarkdownStyleSheet work; minor). - Surface walk on Knowledge / Projects / Settings screens for any hardcoded styling that needs touch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
74 lines
2.3 KiB
Dart
74 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lucide_icons/lucide_icons.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../providers/auth_provider.dart';
|
|
|
|
/// Sticky banner shown when the backend is unreachable. Surfaces a retry
|
|
/// action and reserves space for future "last sync X min ago" messaging once
|
|
/// Tier 2 offline caching lands.
|
|
class OfflineBanner extends ConsumerStatefulWidget {
|
|
const OfflineBanner({super.key});
|
|
|
|
@override
|
|
ConsumerState<OfflineBanner> createState() => _OfflineBannerState();
|
|
}
|
|
|
|
class _OfflineBannerState extends ConsumerState<OfflineBanner> {
|
|
bool _retrying = false;
|
|
|
|
Future<void> _retry() async {
|
|
if (_retrying) return;
|
|
setState(() => _retrying = true);
|
|
try {
|
|
await ref.read(authProvider.notifier).verify();
|
|
} finally {
|
|
if (mounted) setState(() => _retrying = false);
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final status = ref.watch(authProvider);
|
|
if (status != AuthStatus.offline) return const SizedBox.shrink();
|
|
|
|
final scheme = Theme.of(context).colorScheme;
|
|
return Material(
|
|
color: scheme.errorContainer,
|
|
child: SafeArea(
|
|
bottom: false,
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
child: Row(
|
|
children: [
|
|
Icon(LucideIcons.cloudOff,
|
|
size: 18, color: scheme.onErrorContainer),
|
|
const SizedBox(width: 8),
|
|
Expanded(
|
|
child: Text(
|
|
'Offline — showing cached data.',
|
|
style: TextStyle(color: scheme.onErrorContainer),
|
|
),
|
|
),
|
|
TextButton(
|
|
onPressed: _retrying ? null : _retry,
|
|
style: TextButton.styleFrom(
|
|
foregroundColor: scheme.onErrorContainer,
|
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
),
|
|
child: _retrying
|
|
? const SizedBox(
|
|
width: 14,
|
|
height: 14,
|
|
child: CircularProgressIndicator(strokeWidth: 2),
|
|
)
|
|
: const Text('Retry'),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|