Remove sliver_tools

This commit is contained in:
Elias Bonnici 2024-04-03 12:33:55 +02:00
parent f6dcb4ff2c
commit dfc2de7063
No known key found for this signature in database
GPG Key ID: 5EAC28EA3F980CCF
3 changed files with 36 additions and 18 deletions

View File

@ -22,7 +22,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:sliver_tools/sliver_tools.dart';
import '../../core/state.dart';
import '../../management/models.dart';
@ -432,15 +431,20 @@ class _AppPageState extends ConsumerState<AppPage> {
slivers: [
SliverMainAxisGroup(
slivers: [
SliverPinnedHeader(
child: ColoredBox(
color: Theme.of(context).colorScheme.background,
child: Padding(
key: _sliverTitleWrapperGlobalKey,
padding: const EdgeInsets.only(
left: 16.0, right: 16.0, bottom: 12.0, top: 4.0),
child: _buildTitle(context),
SliverPersistentHeader(
pinned: true,
delegate: _SliverTitleDelegate(
child: ColoredBox(
color: Theme.of(context).colorScheme.background,
child: Padding(
key: _sliverTitleWrapperGlobalKey,
padding: const EdgeInsets.only(
left: 16.0, right: 16.0, bottom: 12.0, top: 4.0),
child: _buildTitle(context),
),
),
// The height will always be 60.0 with the current configuration
height: 60.0,
),
),
if (widget.headerSliver != null)
@ -880,3 +884,26 @@ class _VisibilityListenerState extends State<_VisibilityListener> {
}
}
}
class _SliverTitleDelegate extends SliverPersistentHeaderDelegate {
_SliverTitleDelegate({
required this.height,
required this.child,
});
final double height;
final Widget child;
@override
double get minExtent => height;
@override
double get maxExtent => height;
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return child;
}
@override
bool shouldRebuild(_SliverTitleDelegate oldDelegate) => true;
}

View File

@ -815,14 +815,6 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
sliver_tools:
dependency: "direct main"
description:
name: sliver_tools
sha256: eae28220badfb9d0559207badcbbc9ad5331aac829a88cb0964d330d2a4636a6
url: "https://pub.dev"
source: hosted
version: "0.2.12"
source_gen:
dependency: transitive
description:

View File

@ -71,7 +71,6 @@ dependencies:
base32: ^2.1.3
convert: ^3.1.1
material_symbols_icons: ^4.2719.3
sliver_tools: ^0.2.12
dev_dependencies:
integration_test: