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:
@@ -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
|
Five of the six tabs (all but Files) plus each tab's own controls share
|
||||||
[`SyncedHeaderScaffold`](../../lib/widgets/synced_header_scaffold.dart) — a
|
[`SyncedHeaderScaffold`](../../lib/widgets/synced_header_scaffold.dart) — a
|
||||||
`CustomScrollView` with a pull-down "sync status" header (Google
|
`CustomScrollView` with a pull-down "sync status" header (Google
|
||||||
Photos-style), a `Scrollbar`, and a classic Material refresh spinner shown
|
Photos-style) and a classic Material refresh spinner shown during a
|
||||||
during a pull-triggered sync. `SearchView`, `AccountView` (Settings), the
|
pull-triggered sync. `SearchView`, `AccountView` (Settings), the
|
||||||
file-details sheet, the share sheet, and `ShareUploadView` (the
|
file-details sheet, the share sheet, and `ShareUploadView` (the
|
||||||
share-to-upload destination picker) are pushed on top via
|
share-to-upload destination picker) are pushed on top via
|
||||||
`Navigator`/`showModalBottomSheet`/`showGradualBottomSheet` rather than
|
`Navigator`/`showModalBottomSheet`/`showGradualBottomSheet` rather than
|
||||||
|
|||||||
@@ -29,13 +29,10 @@ widgets. Key points:
|
|||||||
- Dark theme supports an `amoled` flag that flattens every surface tone to
|
- Dark theme supports an `amoled` flag that flattens every surface tone to
|
||||||
pure black — extend `colorScheme.copyWith(...)` there if a new surface
|
pure black — extend `colorScheme.copyWith(...)` there if a new surface
|
||||||
role needs the same treatment, don't hardcode `Colors.black` at call sites.
|
role needs the same treatment, don't hardcode `Colors.black` at call sites.
|
||||||
- **Scrollbars**: a project-wide `scrollbarTheme` (`AppTheme._scrollbarTheme`)
|
- **Scrollbars are deliberately not shown** — every scrollable list in the
|
||||||
gives every `Scrollbar` in the app a thick, rounded, always-visible,
|
app is a plain `ListView`/`CustomScrollView` with no `Scrollbar` wrapper
|
||||||
draggable thumb (Android fast-scroll style) derived from
|
and no `scrollbarTheme` override (tried once, explicitly reverted). Don't
|
||||||
`colorScheme.onSurfaceVariant` — don't pass per-instance `thickness`/
|
reintroduce one without being asked.
|
||||||
`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.
|
|
||||||
|
|
||||||
## Reusable chrome
|
## Reusable chrome
|
||||||
|
|
||||||
|
|||||||
@@ -30,37 +30,6 @@ class AppTheme {
|
|||||||
Color(0xFF2E7D32), // Emerald Green
|
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(
|
static ThemeData light(
|
||||||
Color seedColor, {
|
Color seedColor, {
|
||||||
ColorScheme? dynamicScheme,
|
ColorScheme? dynamicScheme,
|
||||||
@@ -80,7 +49,6 @@ class AppTheme {
|
|||||||
scaffoldBackgroundColor: colorScheme.surface,
|
scaffoldBackgroundColor: colorScheme.surface,
|
||||||
pageTransitionsTheme: _pageTransitionsTheme,
|
pageTransitionsTheme: _pageTransitionsTheme,
|
||||||
sliderTheme: _sliderTheme,
|
sliderTheme: _sliderTheme,
|
||||||
scrollbarTheme: _scrollbarTheme(colorScheme),
|
|
||||||
textTheme: GoogleFonts.interTextTheme(ThemeData.light().textTheme)
|
textTheme: GoogleFonts.interTextTheme(ThemeData.light().textTheme)
|
||||||
.copyWith(
|
.copyWith(
|
||||||
headlineMedium: GoogleFonts.inter(
|
headlineMedium: GoogleFonts.inter(
|
||||||
@@ -147,7 +115,6 @@ class AppTheme {
|
|||||||
scaffoldBackgroundColor: colorScheme.surface,
|
scaffoldBackgroundColor: colorScheme.surface,
|
||||||
pageTransitionsTheme: _pageTransitionsTheme,
|
pageTransitionsTheme: _pageTransitionsTheme,
|
||||||
sliderTheme: _sliderTheme,
|
sliderTheme: _sliderTheme,
|
||||||
scrollbarTheme: _scrollbarTheme(colorScheme),
|
|
||||||
textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme)
|
textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme)
|
||||||
.copyWith(
|
.copyWith(
|
||||||
headlineMedium: GoogleFonts.inter(
|
headlineMedium: GoogleFonts.inter(
|
||||||
|
|||||||
+47
-42
@@ -25,31 +25,12 @@ class AccountView extends StatelessWidget {
|
|||||||
final quota = provider.quota;
|
final quota = provider.quota;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(title: const Text('Settings')),
|
||||||
title: const Text('Settings'),
|
|
||||||
actions: [
|
|
||||||
IconButton(
|
|
||||||
onPressed: () => _showLogoutConfirmation(context, provider),
|
|
||||||
icon: const Icon(Icons.logout_rounded),
|
|
||||||
tooltip: 'Log Out',
|
|
||||||
color: colorScheme.error,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Scrollbar(
|
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.fromLTRB(20, 8, 20, 32),
|
padding: const EdgeInsets.fromLTRB(20, 8, 20, 32),
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
children: [
|
children: [
|
||||||
Text(
|
|
||||||
'Connected to ${provider.serverUrl}',
|
|
||||||
style: theme.textTheme.bodyMedium?.copyWith(
|
|
||||||
color: colorScheme.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
|
|
||||||
// User Profile & Storage Card
|
// User Profile & Storage Card
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
@@ -99,27 +80,12 @@ class AccountView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
IconButton(
|
||||||
padding: const EdgeInsets.symmetric(
|
onPressed: () =>
|
||||||
horizontal: 10,
|
_showLogoutConfirmation(context, provider),
|
||||||
vertical: 4,
|
icon: const Icon(Icons.logout_rounded),
|
||||||
),
|
tooltip: 'Log Out',
|
||||||
decoration: BoxDecoration(
|
color: colorScheme.error,
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -174,6 +140,46 @@ class AccountView extends StatelessWidget {
|
|||||||
fontSize: 11,
|
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 {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ class SearchView extends StatefulWidget {
|
|||||||
class _SearchViewState extends State<SearchView> {
|
class _SearchViewState extends State<SearchView> {
|
||||||
final _controller = TextEditingController();
|
final _controller = TextEditingController();
|
||||||
final _focusNode = FocusNode();
|
final _focusNode = FocusNode();
|
||||||
final _resultsScrollController = ScrollController();
|
|
||||||
Timer? _debounce;
|
Timer? _debounce;
|
||||||
|
|
||||||
List<NextcloudItem> _results = [];
|
List<NextcloudItem> _results = [];
|
||||||
@@ -31,7 +30,6 @@ class _SearchViewState extends State<SearchView> {
|
|||||||
_debounce?.cancel();
|
_debounce?.cancel();
|
||||||
_controller.dispose();
|
_controller.dispose();
|
||||||
_focusNode.dispose();
|
_focusNode.dispose();
|
||||||
_resultsScrollController.dispose();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,21 +185,14 @@ class _SearchViewState extends State<SearchView> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Scrollbar(
|
return ListView.builder(
|
||||||
controller: _resultsScrollController,
|
|
||||||
child: ListView.builder(
|
|
||||||
controller: _resultsScrollController,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
itemCount: _results.length,
|
itemCount: _results.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final item = _results[index];
|
final item = _results[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: Icon(_iconFor(item.type), color: colorScheme.primary),
|
leading: Icon(_iconFor(item.type), color: colorScheme.primary),
|
||||||
title: Text(
|
title: Text(item.name, maxLines: 1, overflow: TextOverflow.ellipsis),
|
||||||
item.name,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
item.isFolder
|
item.isFolder
|
||||||
? item.path
|
? item.path
|
||||||
@@ -212,7 +203,6 @@ class _SearchViewState extends State<SearchView> {
|
|||||||
onTap: () => _openResult(item),
|
onTap: () => _openResult(item),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,8 +142,7 @@ class _ShareUploadViewState extends State<ShareUploadView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Scrollbar(
|
: ListView.builder(
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: folders.length,
|
itemCount: folders.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final folder = folders[index];
|
final folder = folders[index];
|
||||||
@@ -153,16 +152,13 @@ class _ShareUploadViewState extends State<ShareUploadView> {
|
|||||||
color: colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
title: Text(folder.name),
|
title: Text(folder.name),
|
||||||
trailing: const Icon(
|
trailing: const Icon(Icons.chevron_right_rounded),
|
||||||
Icons.chevron_right_rounded,
|
|
||||||
),
|
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
provider.navigateToFolder(folder.path),
|
provider.navigateToFolder(folder.path),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
bottomNavigationBar: _uploading
|
bottomNavigationBar: _uploading
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ class _DetailsActivityTabState extends State<DetailsActivityTab> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scrollbar(
|
return ListView.builder(
|
||||||
child: ListView.builder(
|
|
||||||
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
||||||
itemCount: _activities.length,
|
itemCount: _activities.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@@ -138,7 +137,6 @@ class _DetailsActivityTabState extends State<DetailsActivityTab> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ class DetailsInfoTab extends StatelessWidget {
|
|||||||
('Favorite', item.isFavorite ? 'Yes' : 'No'),
|
('Favorite', item.isFavorite ? 'Yes' : 'No'),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Scrollbar(
|
return ListView.separated(
|
||||||
controller: scrollController,
|
|
||||||
child: ListView.separated(
|
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
||||||
itemCount: rows.length,
|
itemCount: rows.length,
|
||||||
@@ -61,7 +59,6 @@ class DetailsInfoTab extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,8 +118,7 @@ class _DetailsVersionsTabState extends State<DetailsVersionsTab> {
|
|||||||
..._versions,
|
..._versions,
|
||||||
];
|
];
|
||||||
|
|
||||||
return Scrollbar(
|
return ListView.separated(
|
||||||
child: ListView.separated(
|
|
||||||
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
||||||
itemCount: items.length,
|
itemCount: items.length,
|
||||||
separatorBuilder: (context, index) => const SizedBox(height: 4),
|
separatorBuilder: (context, index) => const SizedBox(height: 4),
|
||||||
@@ -156,7 +155,6 @@ class _DetailsVersionsTabState extends State<DetailsVersionsTab> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,9 +299,7 @@ class _ShareSheetState extends State<ShareSheet> {
|
|||||||
.toList();
|
.toList();
|
||||||
final internalLink = internalLinkFor(provider.serverUrl, widget.item.id);
|
final internalLink = internalLinkFor(provider.serverUrl, widget.item.id);
|
||||||
|
|
||||||
return Scrollbar(
|
return ListView(
|
||||||
controller: widget.scrollController,
|
|
||||||
child: ListView(
|
|
||||||
controller: widget.scrollController,
|
controller: widget.scrollController,
|
||||||
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
|
||||||
children: [
|
children: [
|
||||||
@@ -331,9 +329,7 @@ class _ShareSheetState extends State<ShareSheet> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: colorScheme.surfaceContainerLow,
|
fillColor: colorScheme.surfaceContainerLow,
|
||||||
),
|
),
|
||||||
@@ -385,9 +381,7 @@ class _ShareSheetState extends State<ShareSheet> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'Type an email',
|
hintText: 'Type an email',
|
||||||
prefixIcon: const Icon(Icons.email_outlined),
|
prefixIcon: const Icon(Icons.email_outlined),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: colorScheme.surfaceContainerLow,
|
fillColor: colorScheme.surfaceContainerLow,
|
||||||
),
|
),
|
||||||
@@ -407,7 +401,6 @@ class _ShareSheetState extends State<ShareSheet> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,8 +161,6 @@ class _SyncedHeaderScaffoldState extends State<SyncedHeaderScaffold> {
|
|||||||
children: [
|
children: [
|
||||||
NotificationListener<ScrollNotification>(
|
NotificationListener<ScrollNotification>(
|
||||||
onNotification: _handleScrollNotification,
|
onNotification: _handleScrollNotification,
|
||||||
child: Scrollbar(
|
|
||||||
controller: widget.scrollController,
|
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: widget.scrollController,
|
controller: widget.scrollController,
|
||||||
// Plain BouncingScrollPhysics only bounces/overscrolls
|
// Plain BouncingScrollPhysics only bounces/overscrolls
|
||||||
@@ -206,7 +204,6 @@ class _SyncedHeaderScaffoldState extends State<SyncedHeaderScaffold> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
// The classic Material pull-to-refresh "bubble" — a floating
|
// The classic Material pull-to-refresh "bubble" — a floating
|
||||||
// circular spinner, shown while a pull-triggered sync is in
|
// circular spinner, shown while a pull-triggered sync is in
|
||||||
// flight. Positioned just under the status bar/toolbar area so it
|
// flight. Positioned just under the status bar/toolbar area so it
|
||||||
|
|||||||
Reference in New Issue
Block a user