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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: chat-server-service | |
namespace: default | |
labels: &labels | |
app: chat-server | |
env: production | |
tier: backend | |
spec: |
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
{ | |
"_type": "export", | |
"__export_format": 4, | |
"__export_date": "2022-06-09T13:06:44.366Z", | |
"__export_source": "insomnia.desktop.app:v2022.3.0", | |
"resources": [ | |
{ | |
"_id": "req_7d7050b7b3b2440aa784ee60a30f514b", | |
"parentId": "fld_893e9f5c77a4466fbc67f564275ff60e", | |
"modified": 1654779978786, |
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
const dgram = require('dgram'); | |
const client = dgram.createSocket({ type: 'udp4', reuseAddr: true }); | |
const sdp = require('./sdp'); | |
//config | |
const addr = '10.10.1.100'; | |
const danteMulticast = '239.255.220.221'; | |
const aes67Multicast = '239.69.1.122'; | |
const samplerate = 48000; | |
const channels = 2; |
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
@@ -31,7 +31,7 @@ | |
child: FlatButton( | |
textColor: Colors.red, | |
onPressed: () { | |
- // we will do delete here | |
+ TodoList.of(context).removeTodoById(todo.id); | |
}, | |
child: Text('Delete'), | |
) |
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
@@ -2,6 +2,11 @@ | |
import 'package:uuid/uuid.dart'; | |
class TodoList extends StatefulWidget { | |
+ | |
+ static TodoListState of(BuildContext context) { | |
+ return context.findAncestorStateOfType<TodoListState>(); | |
+ } | |
+ | |
@override |
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
@@ -55,7 +55,14 @@ | |
) | |
), | |
IconButton(icon: Icon(Icons.delete), onPressed: () { | |
- // delete todo item here | |
+ showDialog( | |
+ context: context, | |
+ builder: (dialogContext) { | |
+ return DeleteTodoDialog( | |
+ todo: todo, |
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
class DeleteTodoDialog extends StatelessWidget { | |
final Todo todo; | |
const DeleteTodoDialog({Key key, this.todo}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Dialog( | |
child: Container( |
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
@@ -24,6 +24,12 @@ | |
}); | |
} | |
+ void removeTodoById(String id) { | |
+ setState(() { | |
+ todos.remove(id); | |
+ }); | |
+ } | |
+ |
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
@@ -34,13 +34,14 @@ | |
child: Row( | |
children: [ | |
- Checkbox(value: false, onChanged: (value) { | |
- // we will update todo item here | |
+ Checkbox(value: todo.isDone, onChanged: (value) { | |
+ todo.isDone = value; | |
+ updateTodo(todo); | |
}), | |
Expanded( |
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
@@ -18,6 +18,12 @@ | |
}); | |
} | |
+ void updateTodo(Todo todo) { | |
+ setState(() { | |
+ todos[todo.id] = todo; | |
+ }); | |
+ } | |
+ |
NewerOlder