Skip to content

Commit 6b203cf

Browse files
Apply suggestions from code review
Co-authored-by: Amos <[email protected]>
1 parent 6016274 commit 6b203cf

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/content/cookbook/effects/drag-a-widget.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ and display a draggable photo of a menu item.
4444

4545
## Press and drag
4646

47-
## 按压和拖动
47+
## 按下并拖动
4848

4949
Flutter provides a widget called [`LongPressDraggable`][]
5050
that provides the exact behavior that you need to begin
@@ -104,7 +104,7 @@ This `DraggingListItem` displays a photo of the
104104
selected food item, centered beneath
105105
the user's finger.
106106

107-
在这种情况下,当用户长按 `MenuListItem` widget 时,
107+
在本例中,当用户长按 `MenuListItem` widget 时,
108108
`LongPressDraggable` widget 会显示一个 `DraggingListItem`
109109
这个 `DraggingListItem` 会在用户手指下方居中显示所选的食物图片。
110110

@@ -129,7 +129,7 @@ food menu item that the user pressed on.
129129

130130
如果拖放操作在释放时没有传递任何信息,那么它几乎没有什么用处。
131131
为此,`LongPressDraggable` 提供了一个 `data` 参数。
132-
在这种情况下`data` 的类型是 `Item`
132+
在本例中`data` 的类型是 `Item`
133133
它包含了用户按下的菜单项的食物信息。
134134

135135
The `data` associated with a `LongPressDraggable`
@@ -143,7 +143,7 @@ You'll implement the drop behavior next.
143143

144144
## Drop the draggable
145145

146-
## 放下可拖动组件
146+
## 放下拖动项
147147

148148
The user can drop a `LongPressDraggable` wherever they choose,
149149
but dropping the draggable has no effect unless it's dropped
@@ -229,15 +229,15 @@ different decision.
229229

230230
当用户将一个可拖放的 widget 放在 `DragTarget` widget 上时,
231231
会调用 `onAcceptWithDetails` 回调。这时你可以决定是否接受拖放的数据。
232-
在示例中,项目总是会被接受和处理
233-
你也可以选择检查传入的项目以做出不同的决定
232+
在本例中,数据项总是会被接受和处理
233+
你也可以选择检查传入的数据项,以做出不同的决定
234234

235235
Notice that the type of item dropped on `DragTarget`
236236
must match the type of the item dragged from `LongPressDraggable`.
237237
If the types are not compatible, then
238238
the `onAcceptWithDetails` method isn't invoked.
239239

240-
注意,拖放到 `DragTarget` 上的项目类型必须与从 `LongPressDraggable` 拖出的项目类型匹配
240+
注意,拖放到 `DragTarget` 上的数据项类型必须与从 `LongPressDraggable` 拖出的数据项类型匹配
241241
如果类型不兼容,`onAcceptWithDetails` 方法将不会被调用。
242242

243243
With a `DragTarget` widget configured to accept your
@@ -254,7 +254,7 @@ you update the customer's cart with the dropped menu item.
254254

255255
## Add a menu item to a cart
256256

257-
## 添加一个菜单项到购物车
257+
## 将菜单项添加到购物车
258258

259259
Each customer is represented by a `Customer` object,
260260
which maintains a cart of items and a price total.
@@ -332,18 +332,18 @@ Run the app:
332332

333333
* Scroll through the food items.
334334

335-
浏览食物项列表。
335+
浏览食物项列表。
336336

337337
* Press and hold on one with your
338338
finger or click and hold with the
339339
mouse.
340340

341-
用手指长安其中一个食物项,或用鼠标点击并按住。
341+
用手指长按其中一个食物项,或用鼠标点击并按住。
342342

343343
* While holding, the food item's image
344344
will appear above the list.
345345

346-
按住时,食物项的图片将出现在列表上方。
346+
按住时,食物项的图片将出现在列表上方。
347347

348348
* Drag the image and drop it on one of the
349349
people at the bottom of the screen.
@@ -352,9 +352,9 @@ Run the app:
352352
You can continue to add food items
353353
and watch the charges accumulate.
354354

355-
将图片拖动并放到屏幕底部的某个人身上。
356-
图片下方的文本会更新,显示该人的费用。
357-
你可以继续添加食物项,观察费用的累积情况
355+
将图片拖动并放到屏幕底部的某个人身上。
356+
图片下方的文本会更新,显示该人的费用。
357+
你可以继续添加食物项,观察费用的累计情况
358358

359359
<!-- Start DartPad -->
360360

0 commit comments

Comments
 (0)