Skip to content

Commit cc7cfbd

Browse files
committed
add: lints
1 parent a815fc8 commit cc7cfbd

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

analysis_options.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
analyzer:
4+
exclude:
5+
# workaround for https://github.com/dart-lang/sdk/issues/42910
6+
- 'example/**'

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ packages:
6666
path: ".."
6767
relative: true
6868
source: path
69-
version: "0.0.1"
69+
version: "0.1.0"
7070
matcher:
7171
dependency: transitive
7272
description:

lib/src/cycled_list_view.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class _CycledListViewState extends State<CycledListView> {
172172
final itemCount = widget.itemCount;
173173
return SliverChildBuilderDelegate(
174174
(context, index) {
175-
if (index == 0) return SizedBox.shrink();
175+
if (index == 0) return const SizedBox.shrink();
176176
return widget.itemBuilder(
177177
context, -index % widget.contentCount, -index);
178178
},
@@ -206,7 +206,7 @@ class _CycledListViewState extends State<CycledListView> {
206206
class CycledScrollController extends ScrollController {
207207
/// Creates a new [CycledScrollController]
208208
CycledScrollController({
209-
this.initialScrollOffset = 0.0,
209+
double initialScrollOffset = 0.0,
210210
bool keepScrollOffset = true,
211211
String? debugLabel,
212212
}) : super(
@@ -215,8 +215,6 @@ class CycledScrollController extends ScrollController {
215215
debugLabel: debugLabel,
216216
);
217217

218-
final double initialScrollOffset;
219-
220218
ScrollDirection get currentScrollDirection => position.userScrollDirection;
221219

222220
@override

lib/src/infinite_scroll_tab_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class __ContentState extends State<_Content>
339339
scrollDirection: Axis.horizontal,
340340
contentCount: widget.contentLength,
341341
controller: _pageController,
342-
physics: PageScrollPhysics(),
342+
physics: const PageScrollPhysics(),
343343
itemBuilder: (context, modIndex, rawIndex) => SizedBox(
344344
width: widget.size.width,
345345
child: ValueListenableBuilder<int>(
@@ -434,7 +434,7 @@ class _CenteredIndicator extends StatelessWidget {
434434
valueListenable: size,
435435
builder: (context, value, _) => Center(
436436
child: Transform.translate(
437-
offset: Offset(0.0, -2.0),
437+
offset: const Offset(0.0, -2.0),
438438
child: Container(
439439
height: 2.0,
440440
decoration: BoxDecoration(

pubspec.lock

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,25 @@ packages:
5555
description: flutter
5656
source: sdk
5757
version: "0.0.0"
58+
flutter_lints:
59+
dependency: "direct dev"
60+
description:
61+
name: flutter_lints
62+
url: "https://pub.dartlang.org"
63+
source: hosted
64+
version: "1.0.4"
5865
flutter_test:
5966
dependency: "direct dev"
6067
description: flutter
6168
source: sdk
6269
version: "0.0.0"
70+
lints:
71+
dependency: transitive
72+
description:
73+
name: lints
74+
url: "https://pub.dartlang.org"
75+
source: hosted
76+
version: "1.0.1"
6377
matcher:
6478
dependency: transitive
6579
description:

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: infinite_scroll_tab_view
22
description: A Flutter package for tab view component that can scroll infinitely.
3-
version: 0.0.1
3+
version: 0.1.0
44
repository: https://github.com/cb-cloud/flutter_infinite_scroll_tab_view
55

66
environment:
@@ -12,6 +12,7 @@ dependencies:
1212
sdk: flutter
1313

1414
dev_dependencies:
15+
flutter_lints: ^1.0.4
1516
flutter_test:
1617
sdk: flutter
1718

0 commit comments

Comments
 (0)