Skip to content

Commit

Permalink
add scaffold around song list (mobile overflow)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedyAu committed Nov 19, 2024
1 parent a709f0b commit 1eccb64
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 115 deletions.
225 changes: 114 additions & 111 deletions lib/ui/base/songs/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,134 +69,137 @@ class _SongsPageState extends ConsumerState<SongsPage> {
return Row(
children: [
Expanded(
child: Column(
children: [
SizedBox(height: 5, child: songResults.isLoading ? LinearProgressIndicator() : null),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: TextField(
controller: _searchFieldController,
autocorrect: false,
decoration: InputDecoration(
hintText: 'Keresés (min. 3 betű)',
prefixIcon: _searchFieldController.text.isEmpty
? Icon(Icons.search)
: IconButton(
icon: Icon(Icons.clear), onPressed: () => _searchFieldController.clear()),
suffixIcon: CompositedTransformTarget(
link: _link,
child: OverlayPortal(
controller: _overlayPortalController,
overlayChildBuilder: (context) => CompositedTransformFollower(
link: _link,
followerAnchor: Alignment.topRight,
targetAnchor: Alignment.bottomRight,
child: Align(
alignment: Alignment.topRight,
child: SizedBox(
width: 300,
child: Card(
elevation: 10,
clipBehavior: Clip.antiAlias,
child: SingleChildScrollView(
child: SearchFieldSelectorColumn(),
child: Scaffold(
body: Column(
children: [
SizedBox(height: 5, child: songResults.isLoading ? LinearProgressIndicator() : null),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: TextField(
controller: _searchFieldController,
autocorrect: false,
decoration: InputDecoration(
hintText: 'Keresés (min. 3 betű)',
prefixIcon: _searchFieldController.text.isEmpty
? Icon(Icons.search)
: IconButton(
icon: Icon(Icons.clear),
onPressed: () => _searchFieldController.clear()),
suffixIcon: CompositedTransformTarget(
link: _link,
child: OverlayPortal(
controller: _overlayPortalController,
overlayChildBuilder: (context) => CompositedTransformFollower(
link: _link,
followerAnchor: Alignment.topRight,
targetAnchor: Alignment.bottomRight,
child: Align(
alignment: Alignment.topRight,
child: SizedBox(
width: 300,
child: Card(
elevation: 10,
clipBehavior: Clip.antiAlias,
child: SingleChildScrollView(
child: SearchFieldSelectorColumn(),
),
),
),
),
),
),
child: IconButton(
tooltip: 'Miben keressen',
icon: _overlayPortalController.isShowing
? const Icon(Icons.close)
: const Icon(Icons.check_box_outlined),
onPressed: () {
_overlayPortalController.toggle();
setState(() {});
},
child: IconButton(
tooltip: 'Miben keressen',
icon: _overlayPortalController.isShowing
? const Icon(Icons.close)
: const Icon(Icons.check_box_outlined),
onPressed: () {
_overlayPortalController.toggle();
setState(() {});
},
),
),
),
),
),
),
),
if (constraints.maxWidth < globals.tabletFromWidth)
Card(
clipBehavior: Clip.antiAlias,
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: constraints.maxHeight / 2),
child: Stack(
children: [
FadingEdgeScrollView.fromSingleChildScrollView(
child: SingleChildScrollView(
controller: _filterExpansionScrollController,
child: Theme(
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
child: ExpansionTile(
expansionAnimationStyle: AnimationStyle(
duration: Durations.medium1,
curve: Curves.easeInOutCubicEmphasized,
//reverseDuration: Durations.medium1,
//reverseCurve: Curves.easeInOutCubicEmphasized,
if (constraints.maxWidth < globals.tabletFromWidth)
Card(
clipBehavior: Clip.antiAlias,
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: constraints.maxHeight / 2),
child: Stack(
children: [
FadingEdgeScrollView.fromSingleChildScrollView(
child: SingleChildScrollView(
controller: _filterExpansionScrollController,
child: Theme(
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
child: ExpansionTile(
expansionAnimationStyle: AnimationStyle(
duration: Durations.medium1,
curve: Curves.easeInOutCubicEmphasized,
//reverseDuration: Durations.medium1,
//reverseCurve: Curves.easeInOutCubicEmphasized,
),
collapsedBackgroundColor:
(filterState.isEmpty && keyFilterState.isEmpty)
? null
: Theme.of(context).colorScheme.secondaryContainer,
collapsedIconColor: (filterState.isEmpty && keyFilterState.isEmpty)
? null
: Theme.of(context).colorScheme.onSecondaryContainer,
controller: _filterExpansionTileController,
leading: const Icon(Icons.filter_list),
title: FiltersTitle(
filterState: filterState, keyFilterState: keyFilterState),
children: [
FiltersColumn(),
],
),
collapsedBackgroundColor:
(filterState.isEmpty && keyFilterState.isEmpty)
? null
: Theme.of(context).colorScheme.secondaryContainer,
collapsedIconColor: (filterState.isEmpty && keyFilterState.isEmpty)
? null
: Theme.of(context).colorScheme.onSecondaryContainer,
controller: _filterExpansionTileController,
leading: const Icon(Icons.filter_list),
title: FiltersTitle(
filterState: filterState, keyFilterState: keyFilterState),
children: [
FiltersColumn(),
],
),
),
),
),
if (filtersScrolled)
Positioned(
right: 12,
top: 6,
child: IconButton.filledTonal(
icon: Icon(Icons.expand_less),
onPressed: () {
_filterExpansionScrollController.jumpTo(0);
_filterExpansionTileController.collapse();
},
if (filtersScrolled)
Positioned(
right: 12,
top: 6,
child: IconButton.filledTonal(
icon: Icon(Icons.expand_less),
onPressed: () {
_filterExpansionScrollController.jumpTo(0);
_filterExpansionTileController.collapse();
},
),
),
),
],
],
),
),
),
),
Expanded(
child: switch (songResults) {
AsyncError(:final error, :final stackTrace) => Center(
child: LErrorCard(
type: LErrorType.error,
title: 'Hová lettek a dalok? :(',
message: error.toString(),
icon: Icons.error,
stack: stackTrace.toString(),
Expanded(
child: switch (songResults) {
AsyncError(:final error, :final stackTrace) => Center(
child: LErrorCard(
type: LErrorType.error,
title: 'Hová lettek a dalok? :(',
message: error.toString(),
icon: Icons.error,
stack: stackTrace.toString(),
),
),
),
AsyncValue(:final value) => value == null
? const Center(
child: CircularProgressIndicator(),
)
: ListView.separated(
itemBuilder: (BuildContext context, int i) {
return LSongResultTile(value.elementAt(i));
},
separatorBuilder: (_, __) => const SizedBox(height: 0),
itemCount: value.length),
},
)
],
AsyncValue(:final value) => value == null
? const Center(
child: CircularProgressIndicator(),
)
: ListView.separated(
itemBuilder: (BuildContext context, int i) {
return LSongResultTile(value.elementAt(i));
},
separatorBuilder: (_, __) => const SizedBox(height: 0),
itemCount: value.length),
},
)
],
),
),
),
if (constraints.maxWidth >= globals.tabletFromWidth)
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ packages:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
code_builder:
dependency: transitive
description:
Expand Down Expand Up @@ -553,10 +553,10 @@ packages:
dependency: "direct main"
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.1"
path_parsing:
dependency: transitive
description:
Expand Down

0 comments on commit 1eccb64

Please sign in to comment.