diff --git a/lib/ui/app/view_scaffold.dart b/lib/ui/app/view_scaffold.dart index 7d2797b9f..2f6a699e5 100644 --- a/lib/ui/app/view_scaffold.dart +++ b/lib/ui/app/view_scaffold.dart @@ -22,7 +22,6 @@ class ViewScaffold extends StatelessWidget { const ViewScaffold({ @required this.body, @required this.entity, - this.floatingActionButton, this.appBarBottom, this.isFilter = false, this.onBackPressed, @@ -34,7 +33,6 @@ class ViewScaffold extends StatelessWidget { final BaseEntity entity; final Widget body; final Function onBackPressed; - final Widget floatingActionButton; final Widget appBarBottom; final String title; final bool isEditable; diff --git a/lib/ui/client/view/client_view.dart b/lib/ui/client/view/client_view.dart index 3e5af9388..c239bbb66 100644 --- a/lib/ui/client/view/client_view.dart +++ b/lib/ui/client/view/client_view.dart @@ -198,98 +198,6 @@ class _ClientViewState extends State ], ); }), - floatingActionButton: FloatingActionButton( - heroTag: 'client_view_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () { - showDialog( - context: context, - builder: (BuildContext context) => SimpleDialog(children: [ - userCompany.canViewCreateOrEdit(EntityType.client) - ? ListTile( - //dense: true, - leading: Icon(Icons.add_circle_outline), - title: Text(localization.invoice), - onTap: () { - Navigator.of(context).pop(); - handleClientAction( - context, [client], EntityAction.newInvoice); - }, - ) - : Container(), - userCompany.canViewCreateOrEdit(EntityType.payment) - ? ListTile( - //dense: true, - leading: Icon(Icons.add_circle_outline), - title: Text(localization.payment), - onTap: () { - Navigator.of(context).pop(); - handleClientAction( - context, [client], EntityAction.newPayment); - }, - ) - : Container(), - userCompany.canViewCreateOrEdit(EntityType.quote) - ? ListTile( - //dense: true, - leading: Icon(Icons.add_circle_outline), - title: Text(localization.quote), - onTap: () { - Navigator.of(context).pop(); - handleClientAction( - context, [client], EntityAction.newQuote); - }, - ) - : Container(), - userCompany.canViewCreateOrEdit(EntityType.project) - ? ListTile( - //dense: true, - leading: Icon(Icons.add_circle_outline), - title: Text(localization.project), - onTap: () { - Navigator.of(context).pop(); - handleClientAction( - context, [client], EntityAction.newProject); - }, - ) - : Container(), - userCompany.canViewCreateOrEdit(EntityType.task) - ? ListTile( - //dense: true, - leading: Icon(Icons.add_circle_outline), - title: Text(localization.task), - onTap: () { - Navigator.of(context).pop(); - handleClientAction( - context, [client], EntityAction.newTask); - }, - ) - : Container(), - userCompany.canViewCreateOrEdit(EntityType.expense) - ? ListTile( - //dense: true, - leading: Icon(Icons.add_circle_outline), - title: Text(localization.expense), - onTap: () { - Navigator.of(context).pop(); - createEntity( - context: context, - entity: ExpenseEntity( - state: store.state, - client: client, - )); - }, - ) - : Container(), - ]), - ); - }, - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.create, - ), ); } } diff --git a/lib/ui/expense/view/expense_view.dart b/lib/ui/expense/view/expense_view.dart index f328d1bbc..3b1fbb277 100644 --- a/lib/ui/expense/view/expense_view.dart +++ b/lib/ui/expense/view/expense_view.dart @@ -161,44 +161,6 @@ class _ExpenseViewState extends State ], ); }), - floatingActionButton: viewModel.state.isEnterprisePlan - ? Builder(builder: (BuildContext context) { - return FloatingActionButton( - heroTag: 'expense_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () async { - MultipartFile multipartFile; - if (kIsWeb) { - multipartFile = await pickFile(); - } else { - final status = await Permission.camera.request(); - if (status == PermissionStatus.granted) { - final image = await ImagePicker() - .pickImage(source: ImageSource.camera); - if (image != null && image.path != null) { - final croppedFile = await ImageCropper() - .cropImage(sourcePath: image.path); - final bytes = await croppedFile.readAsBytes(); - multipartFile = MultipartFile.fromBytes('file', bytes, - filename: image.path.split('/').last); - } - } else { - openAppSettings(); - } - } - if (multipartFile != null) { - viewModel.onUploadDocument( - navigatorKey.currentContext, multipartFile); - } - }, - child: Icon( - Icons.camera_alt, - color: Colors.white, - ), - tooltip: localization.create, - ); - }) - : null, ); } } diff --git a/lib/ui/project/view/project_view.dart b/lib/ui/project/view/project_view.dart index 7ed7bbe7a..0b6b3cadc 100644 --- a/lib/ui/project/view/project_view.dart +++ b/lib/ui/project/view/project_view.dart @@ -128,16 +128,6 @@ class _ProjectViewState extends State ], ); }), - floatingActionButton: FloatingActionButton( - heroTag: 'project_view_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () => viewModel.onAddTaskPressed(context), - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newTask, - ), ); } } diff --git a/lib/ui/task/view/task_view.dart b/lib/ui/task/view/task_view.dart index f2358cd09..bc2277a15 100644 --- a/lib/ui/task/view/task_view.dart +++ b/lib/ui/task/view/task_view.dart @@ -137,21 +137,6 @@ class _TaskViewState extends State ], ); }), - floatingActionButton: Builder(builder: (BuildContext context) { - return task.isInvoiced || task.isDeleted - ? SizedBox() - : FloatingActionButton( - heroTag: 'task_view_fab', - 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, - ); - }), ); } } diff --git a/lib/ui/vendor/view/vendor_view.dart b/lib/ui/vendor/view/vendor_view.dart index 56c048c05..994a7db94 100644 --- a/lib/ui/vendor/view/vendor_view.dart +++ b/lib/ui/vendor/view/vendor_view.dart @@ -172,16 +172,6 @@ class _VendorViewState extends State ], ); }), - floatingActionButton: FloatingActionButton( - heroTag: 'vendor_view_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () => viewModel.onAddExpensePressed(context), - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.create, - ), ); } }