Skip to content

Commit 81d8828

Browse files
authored
[RTDB] [Sample App] Added a delete option to items in the RTDB sample (#2411)
* Added delete option to RTDB sample Merging since this does not impact on the CI breakage.
1 parent 1e2f173 commit 81d8828

File tree

1 file changed

+10
-1
lines changed
  • packages/firebase_database/example/lib

1 file changed

+10
-1
lines changed

packages/firebase_database/example/lib/main.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,16 @@ class _MyHomePageState extends State<MyHomePage> {
156156
Animation<double> animation, int index) {
157157
return SizeTransition(
158158
sizeFactor: animation,
159-
child: Text("$index: ${snapshot.value.toString()}"),
159+
child: ListTile(
160+
trailing: IconButton(
161+
onPressed: () =>
162+
_messagesRef.child(snapshot.key).remove(),
163+
icon: Icon(Icons.delete),
164+
),
165+
title: Text(
166+
"$index: ${snapshot.value.toString()}",
167+
),
168+
),
160169
);
161170
},
162171
),

0 commit comments

Comments
 (0)