diff --git a/lib/ui/base/songs/page.dart b/lib/ui/base/songs/page.dart index c8b865b..7399697 100644 --- a/lib/ui/base/songs/page.dart +++ b/lib/ui/base/songs/page.dart @@ -69,134 +69,137 @@ class _SongsPageState extends ConsumerState { 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) diff --git a/pubspec.lock b/pubspec.lock index 92164b9..de5cfea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: