Remove scrollbar thumb and restructure Settings profile card

- Revert the scrollbar-thumb feature entirely (per-view Scrollbar
  wrappers and the ScrollbarThemeData override) - back to plain
  scrollables with no visible thumb
- Settings: move the logout button into the profile card (next to the
  name/email), and move the ONLINE/OFFLINE badge + "Connected to..."
  text out of the top row into a combined line at the bottom of the
  card, instead of split between the AppBar and the top of the screen
- Update architecture.md/styling.md to drop the stale scrollbar-theme
  documentation

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-16 12:28:11 -04:00
co-authored by Claude Sonnet 5
parent 1fbdc1f8d0
commit 73e05f8d22
11 changed files with 698 additions and 760 deletions
+2 -2
View File
@@ -101,8 +101,8 @@ owns the app's share-intent listener (`receive_sharing_intent`): both
Five of the six tabs (all but Files) plus each tab's own controls share
[`SyncedHeaderScaffold`](../../lib/widgets/synced_header_scaffold.dart) — a
`CustomScrollView` with a pull-down "sync status" header (Google
Photos-style), a `Scrollbar`, and a classic Material refresh spinner shown
during a pull-triggered sync. `SearchView`, `AccountView` (Settings), the
Photos-style) and a classic Material refresh spinner shown during a
pull-triggered sync. `SearchView`, `AccountView` (Settings), the
file-details sheet, the share sheet, and `ShareUploadView` (the
share-to-upload destination picker) are pushed on top via
`Navigator`/`showModalBottomSheet`/`showGradualBottomSheet` rather than
+4 -7
View File
@@ -29,13 +29,10 @@ widgets. Key points:
- Dark theme supports an `amoled` flag that flattens every surface tone to
pure black — extend `colorScheme.copyWith(...)` there if a new surface
role needs the same treatment, don't hardcode `Colors.black` at call sites.
- **Scrollbars**: a project-wide `scrollbarTheme` (`AppTheme._scrollbarTheme`)
gives every `Scrollbar` in the app a thick, rounded, always-visible,
draggable thumb (Android fast-scroll style) derived from
`colorScheme.onSurfaceVariant` — don't pass per-instance `thickness`/
`radius`/`thumbVisibility`/`interactive`, just wrap scrollable content in a
plain `Scrollbar(child: ...)` (pass `controller:` matching the scrollable's
own when one exists) and it picks up the theme automatically.
- **Scrollbars are deliberately not shown** — every scrollable list in the
app is a plain `ListView`/`CustomScrollView` with no `Scrollbar` wrapper
and no `scrollbarTheme` override (tried once, explicitly reverted). Don't
reintroduce one without being asked.
## Reusable chrome
-33
View File
@@ -30,37 +30,6 @@ class AppTheme {
Color(0xFF2E7D32), // Emerald Green
];
// Flutter's default Scrollbar renders a ~6px hairline that's easy to miss
// and hard to grab. This tunes it to read like Android's standard
// draggable fast-scroll thumb: thicker, pill-shaped, and always at least
// faintly visible (not just flashing in on scroll), while still getting
// a touch more visible/opaque while actively hovered or dragged.
static ScrollbarThemeData _scrollbarTheme(ColorScheme colorScheme) {
final thumbColor = colorScheme.onSurfaceVariant;
return ScrollbarThemeData(
thickness: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.dragged) ||
states.contains(WidgetState.hovered)) {
return 10.0;
}
return 8.0;
}),
radius: const Radius.circular(8),
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.dragged)) {
return thumbColor.withValues(alpha: 0.9);
}
if (states.contains(WidgetState.hovered)) {
return thumbColor.withValues(alpha: 0.8);
}
return thumbColor.withValues(alpha: 0.6);
}),
thumbVisibility: const WidgetStatePropertyAll(true),
trackVisibility: const WidgetStatePropertyAll(false),
interactive: true,
);
}
static ThemeData light(
Color seedColor, {
ColorScheme? dynamicScheme,
@@ -80,7 +49,6 @@ class AppTheme {
scaffoldBackgroundColor: colorScheme.surface,
pageTransitionsTheme: _pageTransitionsTheme,
sliderTheme: _sliderTheme,
scrollbarTheme: _scrollbarTheme(colorScheme),
textTheme: GoogleFonts.interTextTheme(ThemeData.light().textTheme)
.copyWith(
headlineMedium: GoogleFonts.inter(
@@ -147,7 +115,6 @@ class AppTheme {
scaffoldBackgroundColor: colorScheme.surface,
pageTransitionsTheme: _pageTransitionsTheme,
sliderTheme: _sliderTheme,
scrollbarTheme: _scrollbarTheme(colorScheme),
textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme)
.copyWith(
headlineMedium: GoogleFonts.inter(
+47 -42
View File
@@ -25,31 +25,12 @@ class AccountView extends StatelessWidget {
final quota = provider.quota;
return Scaffold(
appBar: AppBar(
title: const Text('Settings'),
actions: [
IconButton(
onPressed: () => _showLogoutConfirmation(context, provider),
icon: const Icon(Icons.logout_rounded),
tooltip: 'Log Out',
color: colorScheme.error,
),
],
),
appBar: AppBar(title: const Text('Settings')),
body: SafeArea(
child: Scrollbar(
child: ListView(
padding: const EdgeInsets.fromLTRB(20, 8, 20, 32),
physics: const BouncingScrollPhysics(),
children: [
Text(
'Connected to ${provider.serverUrl}',
style: theme.textTheme.bodyMedium?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 20),
// User Profile & Storage Card
Container(
padding: const EdgeInsets.all(20),
@@ -99,27 +80,12 @@ class AccountView extends StatelessWidget {
],
),
),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 4,
),
decoration: BoxDecoration(
color: provider.isLoggedIn
? Colors.green.withValues(alpha: 0.2)
: Colors.red.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(12),
),
child: Text(
provider.isLoggedIn ? 'ONLINE' : 'OFFLINE',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: provider.isLoggedIn
? Colors.green.shade800
: Colors.red.shade800,
),
),
IconButton(
onPressed: () =>
_showLogoutConfirmation(context, provider),
icon: const Icon(Icons.logout_rounded),
tooltip: 'Log Out',
color: colorScheme.error,
),
],
),
@@ -174,6 +140,46 @@ class AccountView extends StatelessWidget {
fontSize: 11,
),
),
const SizedBox(height: 16),
const Divider(height: 1),
const SizedBox(height: 12),
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 4,
),
decoration: BoxDecoration(
color: provider.isLoggedIn
? Colors.green.withValues(alpha: 0.2)
: Colors.red.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(12),
),
child: Text(
provider.isLoggedIn ? 'ONLINE' : 'OFFLINE',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: provider.isLoggedIn
? Colors.green.shade800
: Colors.red.shade800,
),
),
),
const SizedBox(width: 8),
Expanded(
child: Text(
'Connected to ${provider.serverUrl}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodySmall?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
),
],
),
],
),
),
@@ -443,7 +449,6 @@ class AccountView extends StatelessWidget {
],
),
),
),
);
}
+2 -12
View File
@@ -18,7 +18,6 @@ class SearchView extends StatefulWidget {
class _SearchViewState extends State<SearchView> {
final _controller = TextEditingController();
final _focusNode = FocusNode();
final _resultsScrollController = ScrollController();
Timer? _debounce;
List<NextcloudItem> _results = [];
@@ -31,7 +30,6 @@ class _SearchViewState extends State<SearchView> {
_debounce?.cancel();
_controller.dispose();
_focusNode.dispose();
_resultsScrollController.dispose();
super.dispose();
}
@@ -187,21 +185,14 @@ class _SearchViewState extends State<SearchView> {
),
);
}
return Scrollbar(
controller: _resultsScrollController,
child: ListView.builder(
controller: _resultsScrollController,
return ListView.builder(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
itemCount: _results.length,
itemBuilder: (context, index) {
final item = _results[index];
return ListTile(
leading: Icon(_iconFor(item.type), color: colorScheme.primary),
title: Text(
item.name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
title: Text(item.name, maxLines: 1, overflow: TextOverflow.ellipsis),
subtitle: Text(
item.isFolder
? item.path
@@ -212,7 +203,6 @@ class _SearchViewState extends State<SearchView> {
onTap: () => _openResult(item),
);
},
),
);
}
}
+2 -6
View File
@@ -142,8 +142,7 @@ class _ShareUploadViewState extends State<ShareUploadView> {
),
),
)
: Scrollbar(
child: ListView.builder(
: ListView.builder(
itemCount: folders.length,
itemBuilder: (context, index) {
final folder = folders[index];
@@ -153,16 +152,13 @@ class _ShareUploadViewState extends State<ShareUploadView> {
color: colorScheme.primary,
),
title: Text(folder.name),
trailing: const Icon(
Icons.chevron_right_rounded,
),
trailing: const Icon(Icons.chevron_right_rounded),
onTap: () =>
provider.navigateToFolder(folder.path),
);
},
),
),
),
],
),
bottomNavigationBar: _uploading
@@ -53,8 +53,7 @@ class _DetailsActivityTabState extends State<DetailsActivityTab> {
);
}
return Scrollbar(
child: ListView.builder(
return ListView.builder(
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
itemCount: _activities.length,
itemBuilder: (context, index) {
@@ -138,7 +137,6 @@ class _DetailsActivityTabState extends State<DetailsActivityTab> {
),
);
},
),
);
}
}
+1 -4
View File
@@ -26,9 +26,7 @@ class DetailsInfoTab extends StatelessWidget {
('Favorite', item.isFavorite ? 'Yes' : 'No'),
];
return Scrollbar(
controller: scrollController,
child: ListView.separated(
return ListView.separated(
controller: scrollController,
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
itemCount: rows.length,
@@ -61,7 +59,6 @@ class DetailsInfoTab extends StatelessWidget {
),
);
},
),
);
}
}
@@ -118,8 +118,7 @@ class _DetailsVersionsTabState extends State<DetailsVersionsTab> {
..._versions,
];
return Scrollbar(
child: ListView.separated(
return ListView.separated(
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
itemCount: items.length,
separatorBuilder: (context, index) => const SizedBox(height: 4),
@@ -156,7 +155,6 @@ class _DetailsVersionsTabState extends State<DetailsVersionsTab> {
),
);
},
),
);
}
}
+3 -10
View File
@@ -299,9 +299,7 @@ class _ShareSheetState extends State<ShareSheet> {
.toList();
final internalLink = internalLinkFor(provider.serverUrl, widget.item.id);
return Scrollbar(
controller: widget.scrollController,
child: ListView(
return ListView(
controller: widget.scrollController,
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
children: [
@@ -331,9 +329,7 @@ class _ShareSheetState extends State<ShareSheet> {
),
)
: null,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
filled: true,
fillColor: colorScheme.surfaceContainerLow,
),
@@ -385,9 +381,7 @@ class _ShareSheetState extends State<ShareSheet> {
decoration: InputDecoration(
hintText: 'Type an email',
prefixIcon: const Icon(Icons.email_outlined),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
filled: true,
fillColor: colorScheme.surfaceContainerLow,
),
@@ -407,7 +401,6 @@ class _ShareSheetState extends State<ShareSheet> {
),
),
],
),
);
}
}
-3
View File
@@ -161,8 +161,6 @@ class _SyncedHeaderScaffoldState extends State<SyncedHeaderScaffold> {
children: [
NotificationListener<ScrollNotification>(
onNotification: _handleScrollNotification,
child: Scrollbar(
controller: widget.scrollController,
child: CustomScrollView(
controller: widget.scrollController,
// Plain BouncingScrollPhysics only bounces/overscrolls
@@ -206,7 +204,6 @@ class _SyncedHeaderScaffoldState extends State<SyncedHeaderScaffold> {
],
),
),
),
// The classic Material pull-to-refresh "bubble" — a floating
// circular spinner, shown while a pull-triggered sync is in
// flight. Positioned just under the status bar/toolbar area so it