-
-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update lib/src/models/special_item.dart
Co-authored-by: Alex Li <github@alexv525.com>
- Loading branch information
Showing
1 changed file
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:wechat_assets_picker/wechat_assets_picker.dart'; | ||
|
||
/// Allow users to set a special item in the picker grid with specified [position]. | ||
/// 允许用户在选择器中添加一个自定义item,并指定其位置。 | ||
@immutable | ||
class SpecialItem { | ||
SpecialItem({ | ||
required this.itemPosition, | ||
this.itemBuilder, | ||
class SpecialItem<Path> { | ||
const SpecialItem({ | ||
required this.builder, | ||
required this.position, | ||
}); | ||
|
||
/// Allow users set a special item in the picker with several positions. | ||
/// 允许用户在选择器中添加一个自定义item,并指定位置 | ||
final SpecialItemPosition itemPosition; | ||
|
||
/// The widget builder for the the special item. | ||
/// 自定义item列表 | ||
final SpecialItemBuilder<AssetPathEntity>? itemBuilder; | ||
/// 自定义item构建。 | ||
final SpecialItemBuilder<Path>? builder; | ||
|
||
/// Define how the item will be positioned. | ||
/// 定义如何摆放item。 | ||
final SpecialItemPosition position; | ||
} |