- FilesControlsRow (and Photos' own controls row) wrapped its Row in a SingleChildScrollView, which gives a child unbounded width - silently breaking the trailing Spacer (a flex child needs bounded width) and leaving the List/Grid toggle sitting right after the filter chip instead of pinned to the row's right edge, "not enough controls to fill the row" or not. Removed the scroll wrapper (two chips and an icon toggle never need it) and the dead scroll-hint plumbing that went with it in files_view.dart. - Photos' All/Photos/Videos chips moved into the filter sheet as a full-width segmented control (matching Settings' Theme control), instead of their own row of chips competing for space with the sort and filter chips. - Settings' Theme row: the System/Light/Dark segmented control now sits on its own row below the label instead of squeezed into a trailing slot beside it, where three icon+label segments were too cramped to read comfortably - same shape as the sort sheet's Ascending/Descending control. - NooBanner (Trash's "Empty trash") and NooSummaryCard (Offline's "Sync now") both move their action onto its own row below the description text instead of squeezed onto the same line, where a longer caption had no room to share with it. - SharesController now caches each scope (with you / by you, which also covers links) after its first fetch instead of re-fetching on every single switch, including switching straight back to a scope already loaded seconds ago. - Shares' per-row overflow menu jumped straight to the unshare confirmation with no menu at all - a link share had no way to copy its own URL short of opening the full Share sheet. It's a real menu now: "Copy link" (link shares only) plus remove/unshare. - Settings gained a trailing jump rail on mobile (one small icon per section) so a specific section can be reached in one tap instead of scrolling the whole list by hand; desktop's 2-column grid doesn't need one. - The media viewer's PageView now disables its own left/right swipe while the current photo is zoomed in, so panning around it doesn't also swipe to the next item. - The PDF preview no longer sets minScale below 1.0: pdfx's PdfViewPinch hard-codes an *infinite* pan boundary whenever minScale < 1 (not an exposed parameter, so there's no way to override it), which let a page be panned arbitrarily far off-screen without ever zooming.
84 lines
2.5 KiB
Dart
84 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../theme/design_tokens.dart';
|
|
import '../core/noo_progress_bar.dart';
|
|
|
|
enum NooSummaryCardTone { normal, danger, accent }
|
|
|
|
/// Stat card with optional progress, meta and action (Offline summary,
|
|
/// desktop stats) - Noo Design System project,
|
|
/// `components/lists/SummaryCard.jsx`, mobile variant.
|
|
class NooSummaryCard extends StatelessWidget {
|
|
final String stat;
|
|
final String? caption;
|
|
|
|
/// 0-1; renders a [NooProgressBar].
|
|
final double? progress;
|
|
final String? meta;
|
|
final Widget? action;
|
|
final NooSummaryCardTone tone;
|
|
|
|
const NooSummaryCard({
|
|
super.key,
|
|
required this.stat,
|
|
this.caption,
|
|
this.progress,
|
|
this.meta,
|
|
this.action,
|
|
this.tone = NooSummaryCardTone.normal,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colors = context.nooColors;
|
|
final bg = tone == NooSummaryCardTone.danger
|
|
? colors.dangerSoft
|
|
: colors.surface;
|
|
final statColor = switch (tone) {
|
|
NooSummaryCardTone.danger => colors.danger,
|
|
NooSummaryCardTone.accent => colors.accentText,
|
|
NooSummaryCardTone.normal => colors.fg1,
|
|
};
|
|
final capColor = tone == NooSummaryCardTone.danger
|
|
? colors.danger
|
|
: colors.fg2;
|
|
|
|
return Container(
|
|
padding: const EdgeInsets.all(18),
|
|
decoration: BoxDecoration(
|
|
color: bg,
|
|
borderRadius: BorderRadius.circular(NooRadii.card),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(stat, style: NooText.stat.copyWith(color: statColor)),
|
|
if (caption != null) ...[
|
|
const SizedBox(height: 6),
|
|
Text(
|
|
caption!,
|
|
style: NooText.body.copyWith(
|
|
fontSize: 14,
|
|
height: 1.2,
|
|
color: capColor,
|
|
),
|
|
),
|
|
],
|
|
// Its own row below the description, not squeezed beside the
|
|
// stat/caption - there wasn't room to grow the action (e.g. a
|
|
// labelled "Sync now" button) without it colliding with a long
|
|
// caption.
|
|
if (action != null) ...[const SizedBox(height: 14), action!],
|
|
if (progress != null) ...[
|
|
const SizedBox(height: 14),
|
|
NooProgressBar(value: progress!),
|
|
],
|
|
if (meta != null) ...[
|
|
const SizedBox(height: 14),
|
|
Text(meta!, style: NooText.meta.copyWith(color: colors.fg3)),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|