Settings
This commit is contained in:
parent
838ee50d41
commit
8f68fc32f5
|
|
@ -83,13 +83,15 @@ class AuthRepository {
|
||||||
|
|
||||||
Future<LoginResponse> sendRequest(
|
Future<LoginResponse> sendRequest(
|
||||||
{String url, dynamic data, String token}) async {
|
{String url, dynamic data, String token}) async {
|
||||||
/*
|
final includes = [
|
||||||
url +=
|
'account',
|
||||||
'?include=tax_rates,users,custom_payment_terms,task_statuses,expense_categories&include_static=true';
|
'user',
|
||||||
*/
|
'token',
|
||||||
|
'company.users',
|
||||||
url +=
|
'company.groups',
|
||||||
'?include=account,user,token,company.groups,company.company_gateways.gateway&include_static=true';
|
'company.company_gateways',
|
||||||
|
];
|
||||||
|
url += '?include=${includes.join(',')}&include_static=true';
|
||||||
|
|
||||||
final dynamic response =
|
final dynamic response =
|
||||||
await webClient.post(url, token ?? '', data: json.encode(data));
|
await webClient.post(url, token ?? '', data: json.encode(data));
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,15 @@ class _DeviceSettingsState extends State<DeviceSettings> {
|
||||||
secondary: Icon(FontAwesomeIcons.moon),
|
secondary: Icon(FontAwesomeIcons.moon),
|
||||||
activeColor: Theme.of(context).accentColor,
|
activeColor: Theme.of(context).accentColor,
|
||||||
),
|
),
|
||||||
|
SwitchListTile(
|
||||||
|
title: Text(AppLocalization.of(context)
|
||||||
|
.longPressSelectionIsDefault),
|
||||||
|
value: widget.viewModel.longPressSelectionIsDefault,
|
||||||
|
onChanged: (value) => widget.viewModel
|
||||||
|
.onLongPressSelectionIsDefault(context, value),
|
||||||
|
secondary: Icon(FontAwesomeIcons.checkSquare),
|
||||||
|
activeColor: Theme.of(context).accentColor,
|
||||||
|
),
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: widget.viewModel.authenticationSupported,
|
future: widget.viewModel.authenticationSupported,
|
||||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||||
|
|
@ -84,15 +93,10 @@ class _DeviceSettingsState extends State<DeviceSettings> {
|
||||||
activeColor: Theme.of(context).accentColor,
|
activeColor: Theme.of(context).accentColor,
|
||||||
)
|
)
|
||||||
: SizedBox(),
|
: SizedBox(),
|
||||||
SwitchListTile(
|
],
|
||||||
title: Text(AppLocalization.of(context)
|
),
|
||||||
.longPressSelectionIsDefault),
|
FormCard(
|
||||||
value: widget.viewModel.longPressSelectionIsDefault,
|
children: <Widget>[
|
||||||
onChanged: (value) => widget.viewModel
|
|
||||||
.onLongPressSelectionIsDefault(context, value),
|
|
||||||
secondary: Icon(FontAwesomeIcons.checkSquare),
|
|
||||||
activeColor: Theme.of(context).accentColor,
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: Icon(FontAwesomeIcons.syncAlt),
|
leading: Icon(FontAwesomeIcons.syncAlt),
|
||||||
title: Text(AppLocalization.of(context).refreshData),
|
title: Text(AppLocalization.of(context).refreshData),
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/settings/settings_list_vm.dart';
|
import 'package:invoiceninja_flutter/ui/settings/settings_list_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
|
||||||
|
|
||||||
class SettingsScreen extends StatelessWidget {
|
class SettingsScreen extends StatelessWidget {
|
||||||
static const String route = '/settings';
|
static const String route = '/settings';
|
||||||
|
|
@ -13,7 +12,6 @@ class SettingsScreen extends StatelessWidget {
|
||||||
|
|
||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
appBarTitle: Text(localization.settings),
|
appBarTitle: Text(localization.settings),
|
||||||
hideHamburgerButton: !isMobile(context),
|
|
||||||
body: SettingsListBuilder(),
|
body: SettingsListBuilder(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue