Skip to content

Commit 7841ac3

Browse files
authored
Fix grid layout (#108)
* Fix grid layout * Clean up * Format files * Clean up
1 parent 2468974 commit 7841ac3

16 files changed

+225
-443
lines changed

analysis_options.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# invoked from the command line by running `flutter analyze`.
2+
3+
# The following line activates a set of recommended lints for Flutter apps,
4+
# packages, and plugins designed to encourage good coding practices.
5+
include: package:flutter_lints/flutter.yaml
6+
7+
linter:
8+
# The lint rules applied to this project can be customized in the
9+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
10+
# included above or to enable additional rules. A list of all available lints
11+
# and their documentation is published at
12+
# https://dart-lang.github.io/linter/lints/index.html.
13+
#
14+
# Instead of disabling a lint rule for the entire project in the
15+
# section below, it can also be suppressed for a single line of code
16+
# or a specific dart file by using the `// ignore: name_of_lint` and
17+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
18+
# producing the lint.
19+
rules:
20+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
21+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
22+
23+
# Additional information about this file can be found at
24+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class _HomePageState extends State<HomePage> {
109109
);
110110
},
111111
sliverGridDelegate:
112-
SliverReorderableGridDelegateWithFixedCrossAxisCount(
112+
const SliverGridDelegateWithFixedCrossAxisCount(
113113
crossAxisCount: 4),
114114
enterTransition: animations,
115115
exitTransition: animations,
@@ -146,24 +146,24 @@ class _HomePageState extends State<HomePage> {
146146

147147
/* A custom builder that is for inserting items with animations.
148148
149-
insertItemBuilder: (Widget child, Animation<double> animation){
150-
return ScaleTransition(
151-
scale: animation,
152-
child: child,
153-
);
154-
},
149+
insertItemBuilder: (Widget child, Animation<double> animation){
150+
return ScaleTransition(
151+
scale: animation,
152+
child: child,
153+
);
154+
},
155155
156156
157-
*/
157+
*/
158158
/* A custom builder that is for removing items with animations.
159159
160-
removeItemBuilder: (Widget child, Animation<double> animation){
161-
return ScaleTransition(
162-
scale: animation,
163-
child: child,
164-
);
165-
},
166-
*/
160+
removeItemBuilder: (Widget child, Animation<double> animation){
161+
return ScaleTransition(
162+
scale: animation,
163+
child: child,
164+
);
165+
},
166+
*/
167167
)
168168
: AnimatedReorderableListView(
169169
items: list,

lib/animated_reorderable_list.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ export 'src/animated_gridview.dart';
55
export 'src/animated_listview.dart';
66
export 'src/animated_reorderable_gridview.dart';
77
export 'src/animated_reorderable_listview.dart';
8-
export 'src/component/sliver_grid_with_fixed_cross_axis_count.dart';
9-
export 'src/component/sliver_grid_with_main_axis_extent.dart';

lib/src/animated_gridview.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:flutter/cupertino.dart';
22
import 'package:flutter/gestures.dart';
33
import '../../animated_reorderable_list.dart';
4-
import 'builder/motion_list_base.dart';
5-
import 'builder/motion_list_impl.dart';
4+
import 'builder/reorderable_animated_list_base.dart';
5+
import 'builder/reorderable_animated_list_impl.dart';
66

77
/// A Flutter AnimatedGridView that animates insertion and removal of the item.
88
///
@@ -380,7 +380,7 @@ class AnimatedGridViewState<E extends Object>
380380
slivers: [
381381
SliverPadding(
382382
padding: widget.padding ?? EdgeInsets.zero,
383-
sliver: MotionListImpl.grid(
383+
sliver: ReorderableAnimatedListImpl.grid(
384384
items: widget.items,
385385
itemBuilder: widget.itemBuilder,
386386
sliverGridDelegate: widget.sliverGridDelegate,

lib/src/animated_listview.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:flutter/cupertino.dart';
22
import 'package:flutter/gestures.dart';
33
import 'package:animated_reorderable_list/animated_reorderable_list.dart';
4-
import 'builder/motion_list_base.dart';
5-
import 'builder/motion_list_impl.dart';
4+
import 'builder/reorderable_animated_list_base.dart';
5+
import 'builder/reorderable_animated_list_impl.dart';
66

77
/// A Flutter AnimatedListView that animates insertion and removal of the item.
88
///
@@ -376,7 +376,7 @@ class AnimatedListViewState<E extends Object>
376376
slivers: [
377377
SliverPadding(
378378
padding: widget.padding ?? EdgeInsets.zero,
379-
sliver: MotionListImpl(
379+
sliver: ReorderableAnimatedListImpl(
380380
items: widget.items,
381381
itemBuilder: widget.itemBuilder,
382382
enterTransition: widget.enterTransition,

lib/src/animated_reorderable_gridview.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'package:flutter/cupertino.dart';
22
import 'package:flutter/gestures.dart';
33

44
import '../../animated_reorderable_list.dart';
5-
import 'builder/motion_list_base.dart';
6-
import 'builder/motion_list_impl.dart';
5+
import 'builder/reorderable_animated_list_base.dart';
6+
import 'builder/reorderable_animated_list_impl.dart';
77

88
/// @docImport 'animated_reorderable_listview';
99
@@ -451,7 +451,7 @@ class AnimatedReorderableGridViewState<E extends Object>
451451
slivers: [
452452
SliverPadding(
453453
padding: widget.padding ?? EdgeInsets.zero,
454-
sliver: MotionListImpl.grid(
454+
sliver: ReorderableAnimatedListImpl.grid(
455455
items: widget.items,
456456
itemBuilder: widget.itemBuilder,
457457
sliverGridDelegate: widget.sliverGridDelegate,

lib/src/animated_reorderable_listview.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:flutter/gestures.dart';
22
import 'package:animated_reorderable_list/animated_reorderable_list.dart';
33
import 'package:flutter/material.dart';
4-
import 'builder/motion_list_base.dart';
5-
import 'builder/motion_list_impl.dart';
4+
import 'builder/reorderable_animated_list_base.dart';
5+
import 'builder/reorderable_animated_list_impl.dart';
66

77
///A [ListView] that enables users to interactively reorder items through dragging, with animated insertion and removal of items.
88
///
@@ -469,7 +469,7 @@ class AnimatedReorderableListViewState<E extends Object>
469469
slivers: [
470470
SliverPadding(
471471
padding: widget.padding ?? EdgeInsets.zero,
472-
sliver: MotionListImpl(
472+
sliver: ReorderableAnimatedListImpl(
473473
items: widget.items,
474474
itemBuilder: widget.itemBuilder,
475475
enterTransition: widget.enterTransition,

0 commit comments

Comments
 (0)