This commit is contained in:
Hillel Coren 2018-12-27 21:15:13 +02:00
parent ed7fa02d63
commit 059d02e63c
2 changed files with 18 additions and 12 deletions

View File

@ -124,7 +124,9 @@ class _TaskEditState extends State<TaskEdit>
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
floatingActionButton: FloatingActionButton(
floatingActionButton: task.isInvoiced || task.isDeleted
? SizedBox()
: FloatingActionButton(
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
viewModel.onFabPressed();

View File

@ -68,8 +68,9 @@ class _TaskViewState extends State<TaskView> {
List<Widget> _buildView() {
final widgets = <Widget>[
TwoValueHeader(
backgroundColor:
task.isInvoiced ? Colors.green : task.isRunning ? Colors.blue : null,
backgroundColor: task.isInvoiced
? Colors.green
: task.isRunning ? Colors.blue : null,
label1: localization.duration,
value1: formatDuration(task.calculateDuration),
label2: localization.amount,
@ -197,15 +198,18 @@ class _TaskViewState extends State<TaskView> {
},
),
floatingActionButton: Builder(builder: (BuildContext context) {
return FloatingActionButton(
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () => viewModel.onFabPressed(context),
child: Icon(
task.isRunning ? Icons.stop : Icons.play_arrow,
color: Colors.white,
),
tooltip: task.isRunning ? localization.stop : localization.start,
);
return task.isInvoiced || task.isDeleted
? SizedBox()
: FloatingActionButton(
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () => viewModel.onFabPressed(context),
child: Icon(
task.isRunning ? Icons.stop : Icons.play_arrow,
color: Colors.white,
),
tooltip:
task.isRunning ? localization.stop : localization.start,
);
}),
),
);