Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use super_sliver_list in example #281

Merged
merged 1 commit into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions super_drag_and_drop/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:super_drag_and_drop/super_drag_and_drop.dart';
import 'package:super_clipboard_example/widget_for_reader.dart';
import 'package:super_sliver_list/super_sliver_list.dart';

void main() async {
runApp(const MyApp());
Expand Down Expand Up @@ -413,11 +414,18 @@ class _DropZoneState extends State<_DropZone> {

buildWidgetsForReaders(context, readers, (value) {
setState(() {
_content = ListView(
padding: const EdgeInsets.all(10),
children: value
.intersperse(const SizedBox(height: 10))
.toList(growable: false),
// Use super_sliver_list to get around bad sliver list performance
// with large amount if items.
final delegate = SliverChildListDelegate(value
.intersperse(const SizedBox(height: 10))
.toList(growable: false));
_content = CustomScrollView(
slivers: [
SliverPadding(
padding: const EdgeInsets.all(10),
sliver: SuperSliverList(delegate: delegate),
)
],
);
});
});
Expand Down
8 changes: 8 additions & 0 deletions super_drag_and_drop/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ packages:
relative: true
source: path
version: "0.8.1"
super_sliver_list:
dependency: "direct main"
description:
name: super_sliver_list
sha256: "6729ea1f44c678978e9f3121de4f2cbf2feaaa49d1fb8a0a69c05c4db2cdeb86"
url: "https://pub.dev"
source: hosted
version: "0.0.8"
term_glyph:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions super_drag_and_drop/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
super_clipboard_example:
path: ../../super_clipboard/example
super_context_menu: ^0.8.1
super_sliver_list: ^0.0.8

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down
Loading