Added method to the task model that returns its priority in string format
This commit is contained in:
parent
4cc5578576
commit
1566310a02
2 changed files with 24 additions and 0 deletions
|
|
@ -35,6 +35,22 @@ class TaskModel {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getPriorityText() {
|
||||||
|
switch (priority) {
|
||||||
|
case 0:
|
||||||
|
return 'Low';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return 'Medium';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return 'High';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return 'None';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
id.hashCode ^
|
id.hashCode ^
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,15 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../models/task_model.dart';
|
||||||
|
|
||||||
class TaskListTile extends StatelessWidget {
|
class TaskListTile extends StatelessWidget {
|
||||||
|
final TaskModel task;
|
||||||
|
|
||||||
|
TaskListTile({@required this.task});
|
||||||
|
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
String getTaskPriority() {}
|
||||||
|
|
||||||
return FractionallySizedBox(
|
return FractionallySizedBox(
|
||||||
widthFactor: .9,
|
widthFactor: .9,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue