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

Upgrade flutter, library versions, and include minCacheExtent property #84

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions example/lib/common/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Languages extends GithubLanguage with ISuspensionBean {
@override
Map<String, dynamic> toJson() {
final Map<String, dynamic> map = super.toJson();
// ignore: unused_element
void addIfNonNull(String fieldName, dynamic value) {
if (value != null) {
map[fieldName] = value;
Expand Down
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class MyApp extends StatelessWidget {
title: 'AzListView Demo',
theme: ThemeData(
primaryColor: Colors.white,
// ignore: deprecated_member_use
accentColor: Colors.grey,
//primarySwatch: Colors.white,
visualDensity: VisualDensity.adaptivePlatformDensity,
Expand Down
2 changes: 0 additions & 2 deletions example/lib/ui/car_models_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:developer';

import 'package:azlistview/azlistview.dart';
import 'package:azlistview_example/common/index.dart';
import 'package:flutter/material.dart';
Expand Down
7 changes: 4 additions & 3 deletions example/lib/ui/citylist_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ class _CityListPageState extends State<CityListPage> {
child: Card(
clipBehavior: Clip.hardEdge,
margin: const EdgeInsets.only(left: 8, top: 8, right: 8),
shape: const RoundedRectangleBorder(
shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(4.0),
topRight: Radius.circular(4.0)),
topLeft: Radius.circular(4.0),
topRight: Radius.circular(4.0),
),
),
child: Column(
children: [
Expand Down
105 changes: 49 additions & 56 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ packages:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.9.0"
azlistview:
dependency: "direct main"
description:
Expand All @@ -19,79 +19,72 @@ packages:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
common_utils:
dependency: "direct main"
description:
name: common_utils
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.1.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.2"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.2"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "1.0.5"
decimal:
dependency: transitive
description:
name: decimal
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "2.2.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -108,58 +101,58 @@ packages:
path: "."
ref: HEAD
resolved-ref: b4f88207ebc0c5dcc8baa1676a0fd7796974173a
url: "git://github.com/Sky24n/github_language_colors.git"
url: "https://github.com/Sky24n/github_language_colors.git"
source: git
version: "2.0.0"
lpinyin:
dependency: "direct main"
description:
name: lpinyin
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.3"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.2"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "2.2.0"
scrollable_positioned_list:
dependency: transitive
description:
name: scrollable_positioned_list
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
version: "0.3.2"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -169,58 +162,58 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.1"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.17.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.12.0"
8 changes: 4 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ dependencies:

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
common_utils: ^2.0.0
cupertino_icons: ^1.0.5
common_utils: ^2.1.0
# 汉字转拼音
lpinyin: ^2.0.0
lpinyin: ^2.0.3
azlistview:
path: ../

Expand All @@ -41,7 +41,7 @@ dependencies:
# url: git://github.com/Sky24n/github_language_colors.git
github_language_colors:
git:
url: git://github.com/Sky24n/github_language_colors.git
url: https://github.com/Sky24n/github_language_colors.git

dev_dependencies:
flutter_test:
Expand Down
6 changes: 6 additions & 0 deletions lib/src/az_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AzListView extends StatefulWidget {
this.indexBarAlignment = Alignment.centerRight,
this.indexBarMargin,
this.indexBarOptions = const IndexBarOptions(),
this.minCacheExtent,
}) : super(key: key);

/// with ISuspensionBean Data
Expand Down Expand Up @@ -93,6 +94,10 @@ class AzListView extends StatefulWidget {
/// IndexBar options.
final IndexBarOptions indexBarOptions;

/// The minimum cache extent used by the underlying scroll lists.
/// See [ScrollView.cacheExtent].
final double? minCacheExtent;

@override
_AzListViewState createState() => _AzListViewState();
}
Expand Down Expand Up @@ -193,6 +198,7 @@ class _AzListViewState extends State<AzListView> {
susPosition: widget.susPosition,
padding: widget.padding,
physics: widget.physics,
minCacheExtent: widget.minCacheExtent,
),
Align(
alignment: widget.indexBarAlignment,
Expand Down
8 changes: 3 additions & 5 deletions lib/src/index_bar.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'dart:math' as math;
Expand Down Expand Up @@ -280,7 +278,7 @@ class _IndexBarState extends State<IndexBar> {
@override
void initState() {
super.initState();
widget.indexBarDragNotifier?.dragDetails?.addListener(_valueChanged);
widget.indexBarDragNotifier?.dragDetails.addListener(_valueChanged);
widget.controller?._attach(this);
}

Expand Down Expand Up @@ -319,7 +317,7 @@ class _IndexBarState extends State<IndexBar> {
void dispose() {
widget.controller?._detach();
_removeOverlay();
widget.indexBarDragNotifier?.dragDetails?.removeListener(_valueChanged);
widget.indexBarDragNotifier?.dragDetails.removeListener(_valueChanged);
super.dispose();
}

Expand Down Expand Up @@ -527,7 +525,7 @@ class _BaseIndexBarState extends State<BaseIndexBar> {
action == IndexBarDragDetails.actionUpdate)) {
HapticFeedback.vibrate();
}
widget.indexBarDragNotifier?.dragDetails?.value = IndexBarDragDetails(
widget.indexBarDragNotifier?.dragDetails.value = IndexBarDragDetails(
action: action,
index: lastIndex,
tag: widget.data[lastIndex],
Expand Down
Loading