Settings
This commit is contained in:
parent
82375ce605
commit
a31c643791
|
|
@ -89,7 +89,7 @@ class AuthRepository {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
url +=
|
url +=
|
||||||
'?include=company.groups,company.company_gateways.gateway&include_static=true';
|
'?include=account,user,token,company.groups,company.company_gateways.gateway&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));
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'dart:io';
|
||||||
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/ui/app/debug/state_inspector.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart';
|
import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/upgrade_dialog.dart';
|
import 'package:invoiceninja_flutter/ui/app/upgrade_dialog.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/pdf.dart';
|
import 'package:invoiceninja_flutter/utils/pdf.dart';
|
||||||
|
|
@ -474,6 +475,14 @@ class SidebarFooter extends StatelessWidget {
|
||||||
icon: Icon(Icons.info_outline),
|
icon: Icon(Icons.info_outline),
|
||||||
onPressed: () => showAbout(),
|
onPressed: () => showAbout(),
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.settings_applications),
|
||||||
|
onPressed: () => showDialog<StateInspector>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return StateInspector();
|
||||||
|
}),
|
||||||
|
),
|
||||||
if (state.lastError.isNotEmpty)
|
if (state.lastError.isNotEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
|
|
||||||
|
class StateInspector extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_StateInspectorState createState() => _StateInspectorState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _StateInspectorState extends State<StateInspector> {
|
||||||
|
|
||||||
|
String _text;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final state = StoreProvider.of<AppState>(context).state;
|
||||||
|
final data = serializers.serializeWith(AppState.serializer, state);
|
||||||
|
final json = jsonEncode(data);
|
||||||
|
|
||||||
|
final JsonEncoder encoder = new JsonEncoder.withIndent(' ');
|
||||||
|
final String prettyJson = encoder.convert(json);
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 100, top: 20, right: 100),
|
||||||
|
child: Material(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(30),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
TextFormField(
|
||||||
|
autofocus: true,
|
||||||
|
onChanged: (value) {
|
||||||
|
print('TEXT: $value');
|
||||||
|
if (value.endsWith('\t')) {
|
||||||
|
print('ends with tab');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
for (var key in (data as Map).keys)
|
||||||
|
Text('$key')
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
Text(prettyJson.substring(0, 1000)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue