todo save, popup, dismiss show dialog
This commit is contained in:
45
lib/utils/todo_tile.dart
Normal file
45
lib/utils/todo_tile.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ToDoTile extends StatelessWidget {
|
||||
const ToDoTile(
|
||||
{Key? key,
|
||||
required this.taskName,
|
||||
required this.taskCompleted,
|
||||
required this.onChanged})
|
||||
: super(key: key);
|
||||
|
||||
final String taskName;
|
||||
final bool taskCompleted;
|
||||
final Function(bool?)? onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(25.0, 25, 25, 0),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(24.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
taskName,
|
||||
style: TextStyle(
|
||||
decoration: taskCompleted
|
||||
? TextDecoration.lineThrough
|
||||
: TextDecoration.none),
|
||||
),
|
||||
Checkbox(
|
||||
value: taskCompleted,
|
||||
onChanged: onChanged,
|
||||
activeColor: Colors.redAccent,
|
||||
)
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user