Skip to content

Commit e421a5a

Browse files
yujuneAlexV525
andauthored
Update lib/src/models/special_item.dart
Co-authored-by: Alex Li <[email protected]>
1 parent 3991cba commit e421a5a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lib/src/models/special_item.dart

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import 'package:flutter/material.dart';
22
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
33

4+
/// Allow users to set a special item in the picker grid with specified [position].
5+
/// 允许用户在选择器中添加一个自定义item,并指定其位置。
46
@immutable
5-
class SpecialItem {
6-
SpecialItem({
7-
required this.itemPosition,
8-
this.itemBuilder,
7+
class SpecialItem<Path> {
8+
const SpecialItem({
9+
required this.builder,
10+
required this.position,
911
});
1012

11-
/// Allow users set a special item in the picker with several positions.
12-
/// 允许用户在选择器中添加一个自定义item,并指定位置
13-
final SpecialItemPosition itemPosition;
14-
1513
/// The widget builder for the the special item.
16-
/// 自定义item列表
17-
final SpecialItemBuilder<AssetPathEntity>? itemBuilder;
14+
/// 自定义item构建。
15+
final SpecialItemBuilder<Path>? builder;
16+
17+
/// Define how the item will be positioned.
18+
/// 定义如何摆放item。
19+
final SpecialItemPosition position;
1820
}

0 commit comments

Comments
 (0)