Web
This commit is contained in:
parent
e498e51e3d
commit
399e1b6f4d
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponseClients = '''
|
const dynamic kMockClients = '''
|
||||||
{
|
{
|
||||||
"data": [],
|
"data": [],
|
||||||
"meta": {
|
"meta": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponseDashboard = '''
|
const dynamic kMockDashboard = '''
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"activities": []
|
"activities": []
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
const dynamic kMockExpenses = '''
|
||||||
|
{
|
||||||
|
"data": [],
|
||||||
|
"meta": {
|
||||||
|
"pagination": {
|
||||||
|
"total": 0,
|
||||||
|
"count": 0,
|
||||||
|
"per_page": 5000,
|
||||||
|
"current_page": 1,
|
||||||
|
"total_pages": 1,
|
||||||
|
"links": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''';
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponseInvoices = '''
|
const dynamic kMockInvoices = '''
|
||||||
{
|
{
|
||||||
"data": [],
|
"data": [],
|
||||||
"meta": {
|
"meta": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponseLogin = '''
|
const dynamic kMockLogin = '''
|
||||||
{
|
{
|
||||||
"data": [
|
"data": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponsePayments = '''
|
const dynamic kMockPayments = '''
|
||||||
{
|
{
|
||||||
"data": [],
|
"data": [],
|
||||||
"meta": {
|
"meta": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponseProducts = '''
|
const dynamic kMockProducts = '''
|
||||||
{
|
{
|
||||||
"data": [],
|
"data": [],
|
||||||
"meta": {
|
"meta": {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
const dynamic kMockProjects = '''
|
||||||
|
{
|
||||||
|
"data": [],
|
||||||
|
"meta": {
|
||||||
|
"pagination": {
|
||||||
|
"total": 0,
|
||||||
|
"count": 0,
|
||||||
|
"per_page": 5000,
|
||||||
|
"current_page": 1,
|
||||||
|
"total_pages": 1,
|
||||||
|
"links": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''';
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const dynamic kAPIResponseQuotes = '''
|
const dynamic kMockQuotes = '''
|
||||||
{
|
{
|
||||||
"data": [],
|
"data": [],
|
||||||
"meta": {
|
"meta": {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
const dynamic kMockTasks = '''
|
||||||
|
{
|
||||||
|
"data": [],
|
||||||
|
"meta": {
|
||||||
|
"pagination": {
|
||||||
|
"total": 0,
|
||||||
|
"count": 0,
|
||||||
|
"per_page": 5000,
|
||||||
|
"current_page": 1,
|
||||||
|
"total_pages": 1,
|
||||||
|
"links": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''';
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
const dynamic kMockVendors = '''
|
||||||
|
{
|
||||||
|
"data": [],
|
||||||
|
"meta": {
|
||||||
|
"pagination": {
|
||||||
|
"total": 0,
|
||||||
|
"count": 0,
|
||||||
|
"per_page": 5000,
|
||||||
|
"current_page": 1,
|
||||||
|
"total_pages": 1,
|
||||||
|
"links": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''';
|
||||||
|
|
@ -11,6 +11,7 @@ import 'package:invoiceninja_flutter/data/models/group_model.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/task_model.dart';
|
import 'package:invoiceninja_flutter/data/models/task_model.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
|
|
||||||
part 'company_model.g.dart';
|
part 'company_model.g.dart';
|
||||||
|
|
||||||
|
|
@ -244,6 +245,20 @@ abstract class CompanyEntity extends Object
|
||||||
bool get isEnterprisePlan => isSelfHost || plan == kPlanEnterprise;
|
bool get isEnterprisePlan => isSelfHost || plan == kPlanEnterprise;
|
||||||
|
|
||||||
bool isModuleEnabled(EntityType entityType) {
|
bool isModuleEnabled(EntityType entityType) {
|
||||||
|
if (Config.DEMO_MODE) {
|
||||||
|
if ([
|
||||||
|
//EntityType.recurringInvoice,
|
||||||
|
//EntityType.credit,
|
||||||
|
EntityType.project,
|
||||||
|
EntityType.task,
|
||||||
|
EntityType.expense,
|
||||||
|
EntityType.vendor,
|
||||||
|
].contains(entityType)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO remove this
|
// TODO remove this
|
||||||
if ([
|
if ([
|
||||||
EntityType.recurringInvoice,
|
EntityType.recurringInvoice,
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class AuthRepository {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponseLogin);
|
response = json.decode(kMockLogin);
|
||||||
} else {
|
} else {
|
||||||
response =
|
response =
|
||||||
await webClient.post(url, token ?? '', data: json.encode(data));
|
await webClient.post(url, token ?? '', data: json.encode(data));
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class ClientRepository {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponseClients);
|
response = json.decode(kMockClients);
|
||||||
} else {
|
} else {
|
||||||
response =
|
response =
|
||||||
await webClient.get(url, credentials.token);
|
await webClient.get(url, credentials.token);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class DashboardRepository {
|
||||||
Future<DashboardEntity> loadItem(Credentials connectionInfo) async {
|
Future<DashboardEntity> loadItem(Credentials connectionInfo) async {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponseDashboard);
|
response = json.decode(kMockDashboard);
|
||||||
} else {
|
} else {
|
||||||
response = await webClient.get(
|
response = await webClient.get(
|
||||||
connectionInfo.url + '/dashboard?only_activity=true',
|
connectionInfo.url + '/dashboard?only_activity=true',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/mock/mock_expenses.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
@ -34,7 +36,13 @@ class ExpenseRepository {
|
||||||
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
||||||
}
|
}
|
||||||
|
|
||||||
final dynamic response = await webClient.get(url, credentials.token);
|
dynamic response;
|
||||||
|
|
||||||
|
if (Config.DEMO_MODE) {
|
||||||
|
response = json.decode(kMockExpenses);
|
||||||
|
} else {
|
||||||
|
response = await webClient.get(url, credentials.token);
|
||||||
|
}
|
||||||
|
|
||||||
final ExpenseListResponse expenseResponse =
|
final ExpenseListResponse expenseResponse =
|
||||||
serializers.deserializeWith(ExpenseListResponse.serializer, response);
|
serializers.deserializeWith(ExpenseListResponse.serializer, response);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class InvoiceRepository {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponseInvoices);
|
response = json.decode(kMockInvoices);
|
||||||
} else {
|
} else {
|
||||||
response =
|
response =
|
||||||
await webClient.get(url, credentials.token);
|
await webClient.get(url, credentials.token);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class PaymentRepository {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponsePayments);
|
response = json.decode(kMockPayments);
|
||||||
} else {
|
} else {
|
||||||
response =
|
response =
|
||||||
await webClient.get(url, credentials.token);
|
await webClient.get(url, credentials.token);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class ProductRepository {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponseProducts);
|
response = json.decode(kMockProducts);
|
||||||
} else {
|
} else {
|
||||||
response = await webClient.get(url, credentials.token);
|
response = await webClient.get(url, credentials.token);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/mock/mock_projects.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
@ -34,7 +36,13 @@ class ProjectRepository {
|
||||||
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
||||||
}
|
}
|
||||||
|
|
||||||
final dynamic response = await webClient.get(url, credentials.token);
|
dynamic response;
|
||||||
|
|
||||||
|
if (Config.DEMO_MODE) {
|
||||||
|
response = json.decode(kMockProjects);
|
||||||
|
} else {
|
||||||
|
response = await webClient.get(url, credentials.token);
|
||||||
|
}
|
||||||
|
|
||||||
final ProjectListResponse projectResponse =
|
final ProjectListResponse projectResponse =
|
||||||
serializers.deserializeWith(ProjectListResponse.serializer, response);
|
serializers.deserializeWith(ProjectListResponse.serializer, response);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class QuoteRepository {
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
if (Config.DEMO_MODE) {
|
if (Config.DEMO_MODE) {
|
||||||
response = json.decode(kAPIResponseQuotes);
|
response = json.decode(kMockQuotes);
|
||||||
} else {
|
} else {
|
||||||
response = await webClient.get(url, credentials.token);
|
response = await webClient.get(url, credentials.token);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/mock/mock_tasks.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
@ -33,7 +35,13 @@ class TaskRepository {
|
||||||
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
||||||
}
|
}
|
||||||
|
|
||||||
final dynamic response = await webClient.get(url, credentials.token);
|
dynamic response;
|
||||||
|
|
||||||
|
if (Config.DEMO_MODE) {
|
||||||
|
response = json.decode(kMockTasks);
|
||||||
|
} else {
|
||||||
|
response = await webClient.get(url, credentials.token);
|
||||||
|
}
|
||||||
|
|
||||||
final TaskListResponse taskResponse =
|
final TaskListResponse taskResponse =
|
||||||
serializers.deserializeWith(TaskListResponse.serializer, response);
|
serializers.deserializeWith(TaskListResponse.serializer, response);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/mock/mock_vendors.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
@ -34,7 +36,13 @@ class VendorRepository {
|
||||||
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';
|
||||||
}
|
}
|
||||||
|
|
||||||
final dynamic response = await webClient.get(url, credentials.token);
|
dynamic response;
|
||||||
|
|
||||||
|
if (Config.DEMO_MODE) {
|
||||||
|
response = json.decode(kMockVendors);
|
||||||
|
} else {
|
||||||
|
response = await webClient.get(url, credentials.token);
|
||||||
|
}
|
||||||
|
|
||||||
final VendorListResponse vendorResponse =
|
final VendorListResponse vendorResponse =
|
||||||
serializers.deserializeWith(VendorListResponse.serializer, response);
|
serializers.deserializeWith(VendorListResponse.serializer, response);
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,39 @@ class MainScreen extends StatelessWidget {
|
||||||
editWidget: QuoteEditScreen(),
|
editWidget: QuoteEditScreen(),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case ProjectScreen.route:
|
||||||
|
screen = EntityScreens(
|
||||||
|
entityType: EntityType.project,
|
||||||
|
listWidget: ProjectScreenBuilder(),
|
||||||
|
viewWidget: ProjectViewScreen(),
|
||||||
|
editWidget: ProjectEditScreen(),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case TaskScreen.route:
|
||||||
|
screen = EntityScreens(
|
||||||
|
entityType: EntityType.task,
|
||||||
|
listWidget: TaskScreenBuilder(),
|
||||||
|
viewWidget: TaskViewScreen(),
|
||||||
|
editWidget: TaskEditScreen(),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case VendorScreen.route:
|
||||||
|
screen = EntityScreens(
|
||||||
|
entityType: EntityType.vendor,
|
||||||
|
listWidget: VendorScreenBuilder(),
|
||||||
|
viewWidget: VendorViewScreen(),
|
||||||
|
editWidget: VendorEditScreen(),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case ExpenseScreen.route:
|
||||||
|
screen = EntityScreens(
|
||||||
|
entityType: EntityType.expense,
|
||||||
|
listWidget: ExpenseScreenBuilder(),
|
||||||
|
viewWidget: ExpenseViewScreen(),
|
||||||
|
editWidget: ExpenseEditScreen(),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
case SettingsScreen.route:
|
case SettingsScreen.route:
|
||||||
screen = SettingsScreens();
|
screen = SettingsScreens();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/expense/expense_actions.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/project/project_actions.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/task/task_actions.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/vendor/vendor_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/debug/state_inspector.dart';
|
import 'package:invoiceninja_flutter/ui/app/debug/state_inspector.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart';
|
import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart';
|
||||||
import 'package:redux/redux.dart';
|
import 'package:redux/redux.dart';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
@ -166,7 +171,9 @@ class MenuDrawer extends StatelessWidget {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
icon: kIsWeb ? Icons.dashboard : FontAwesomeIcons.tachometerAlt,
|
icon: kIsWeb
|
||||||
|
? Icons.dashboard
|
||||||
|
: FontAwesomeIcons.tachometerAlt,
|
||||||
title: localization.dashboard,
|
title: localization.dashboard,
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
store.dispatch(ViewDashboard(context: context)),
|
store.dispatch(ViewDashboard(context: context)),
|
||||||
|
|
@ -250,86 +257,86 @@ class MenuDrawer extends StatelessWidget {
|
||||||
context: context));
|
context: context));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
/*
|
if (Config.DEMO_MODE) ...[
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
entityType: EntityType.project,
|
entityType: EntityType.project,
|
||||||
icon: getEntityIcon(EntityType.project),
|
icon: getEntityIcon(EntityType.project),
|
||||||
title: localization.projects,
|
title: localization.projects,
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
store.dispatch(ViewProjectList(context: context)),
|
store.dispatch(ViewProjectList(context: context)),
|
||||||
onCreateTap: () {
|
onCreateTap: () {
|
||||||
if (isMobile(context)) {
|
if (isMobile(context)) {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
}
|
}
|
||||||
store.dispatch(EditProject(
|
store.dispatch(EditProject(
|
||||||
project: ProjectEntity(), context: context));
|
project: ProjectEntity(), context: context));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
entityType: EntityType.task,
|
entityType: EntityType.task,
|
||||||
icon: getEntityIcon(EntityType.task),
|
icon: getEntityIcon(EntityType.task),
|
||||||
title: localization.tasks,
|
title: localization.tasks,
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
store.dispatch(ViewTaskList(context: context)),
|
store.dispatch(ViewTaskList(context: context)),
|
||||||
onCreateTap: () {
|
onCreateTap: () {
|
||||||
if (isMobile(context)) {
|
if (isMobile(context)) {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
}
|
}
|
||||||
store.dispatch(EditTask(
|
store.dispatch(EditTask(
|
||||||
task: TaskEntity(
|
task: TaskEntity(
|
||||||
isRunning: state.uiState.autoStartTasks),
|
isRunning: state.uiState.autoStartTasks),
|
||||||
context: context));
|
context: context));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
entityType: EntityType.vendor,
|
entityType: EntityType.vendor,
|
||||||
icon: getEntityIcon(EntityType.vendor),
|
icon: getEntityIcon(EntityType.vendor),
|
||||||
title: localization.vendors,
|
title: localization.vendors,
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
store.dispatch(ViewVendorList(context: context)),
|
store.dispatch(ViewVendorList(context: context)),
|
||||||
onCreateTap: () {
|
onCreateTap: () {
|
||||||
if (isMobile(context)) {
|
if (isMobile(context)) {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
}
|
}
|
||||||
store.dispatch(EditVendor(
|
store.dispatch(EditVendor(
|
||||||
vendor: VendorEntity(), context: context));
|
vendor: VendorEntity(), context: context));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
entityType: EntityType.expense,
|
entityType: EntityType.expense,
|
||||||
icon: getEntityIcon(EntityType.expense),
|
icon: getEntityIcon(EntityType.expense),
|
||||||
title: localization.expenses,
|
title: localization.expenses,
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
store.dispatch(ViewExpenseList(context: context)),
|
store.dispatch(ViewExpenseList(context: context)),
|
||||||
onCreateTap: () {
|
onCreateTap: () {
|
||||||
if (isMobile(context)) {
|
if (isMobile(context)) {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
}
|
}
|
||||||
store.dispatch(EditExpense(
|
store.dispatch(EditExpense(
|
||||||
expense: ExpenseEntity(
|
expense: ExpenseEntity(
|
||||||
company: company, uiState: state.uiState),
|
company: company, uiState: state.uiState),
|
||||||
context: context));
|
context: context));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
*/
|
// STARTER: menu - do not remove comment
|
||||||
// STARTER: menu - do not remove comment
|
DrawerTile(
|
||||||
DrawerTile(
|
company: company,
|
||||||
company: company,
|
icon: kIsWeb ? Icons.settings : FontAwesomeIcons.cog,
|
||||||
icon: kIsWeb ? Icons.settings : FontAwesomeIcons.cog,
|
title: localization.settings,
|
||||||
title: localization.settings,
|
onTap: () {
|
||||||
onTap: () {
|
if (isMobile(context)) {
|
||||||
if (isMobile(context)) {
|
navigator.pop();
|
||||||
navigator.pop();
|
}
|
||||||
}
|
store.dispatch(ViewSettings(
|
||||||
store.dispatch(ViewSettings(
|
context: context,
|
||||||
context: context,
|
userCompany: state.userCompany));
|
||||||
userCompany: state.userCompany));
|
},
|
||||||
},
|
),
|
||||||
),
|
]
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Align(
|
Align(
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue