From e421a5a4cf2d38b505341f9942b2e0d5cc31bc12 Mon Sep 17 00:00:00 2001 From: Tee Yu June <56582497+yujune@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:37:18 +0800 Subject: [PATCH] Update lib/src/models/special_item.dart Co-authored-by: Alex Li --- lib/src/models/special_item.dart | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/src/models/special_item.dart b/lib/src/models/special_item.dart index 24e59c35..10b9c169 100644 --- a/lib/src/models/special_item.dart +++ b/lib/src/models/special_item.dart @@ -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 { + 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? itemBuilder; + /// 自定义item构建。 + final SpecialItemBuilder? builder; + + /// Define how the item will be positioned. + /// 定义如何摆放item。 + final SpecialItemPosition position; }