CSV import
This commit is contained in:
parent
853953a99e
commit
8d59c6efc9
|
|
@ -1,5 +1,9 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/forms/app_dropdown_button.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/forms/app_form.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/settings/import_export_vm.dart';
|
import 'package:invoiceninja_flutter/ui/settings/import_export_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||||
|
|
@ -17,20 +21,28 @@ class ImportExport extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ImportExportState extends State<ImportExport> {
|
class _ImportExportState extends State<ImportExport> {
|
||||||
//static final GlobalKey<FormState> _formKey = GlobalKey<FormState>(debugLabel: '_importExport);
|
static final GlobalKey<FormState> _formKey =
|
||||||
|
GlobalKey<FormState>(debugLabel: '_importExport');
|
||||||
|
FocusScopeNode _focusNode;
|
||||||
bool autoValidate = false;
|
bool autoValidate = false;
|
||||||
|
|
||||||
final _firstNameController = TextEditingController();
|
final _firstNameController = TextEditingController();
|
||||||
|
|
||||||
List<TextEditingController> _controllers = [];
|
List<TextEditingController> _controllers = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_focusNode = FocusScopeNode();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_controllers.forEach((dynamic controller) {
|
_controllers.forEach((dynamic controller) {
|
||||||
controller.removeListener(_onChanged);
|
controller.removeListener(_onChanged);
|
||||||
controller.dispose();
|
controller.dispose();
|
||||||
});
|
});
|
||||||
|
_focusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,7 +78,38 @@ class _ImportExportState extends State<ImportExport> {
|
||||||
title: Text(localization.importExport),
|
title: Text(localization.importExport),
|
||||||
actions: <Widget>[],
|
actions: <Widget>[],
|
||||||
),
|
),
|
||||||
body: SizedBox(),
|
body: AppForm(
|
||||||
|
formKey: _formKey,
|
||||||
|
focusNode: _focusNode,
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
FormCard(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
InputDecorator(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: localization.importType,
|
||||||
|
),
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton<EntityType>(
|
||||||
|
isDense: true,
|
||||||
|
value: EntityType.client,
|
||||||
|
onChanged: (dynamic value) {
|
||||||
|
//
|
||||||
|
},
|
||||||
|
items: [EntityType.client]
|
||||||
|
.map((entityType) => DropdownMenuItem<EntityType>(
|
||||||
|
value: entityType,
|
||||||
|
child:
|
||||||
|
Text(localization.lookup('$entityType'))))
|
||||||
|
.toList()),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'import_type': 'Import Type',
|
||||||
'draft_mode': 'Draft Mode',
|
'draft_mode': 'Draft Mode',
|
||||||
'draft_mode_help': 'Preview updates faster but is less accurate',
|
'draft_mode_help': 'Preview updates faster but is less accurate',
|
||||||
'view_licenses': 'View Licenses',
|
'view_licenses': 'View Licenses',
|
||||||
|
|
@ -4400,6 +4401,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get type => _localizedValues[localeCode]['type'] ?? '';
|
String get type => _localizedValues[localeCode]['type'] ?? '';
|
||||||
|
|
||||||
|
String get importType => _localizedValues[localeCode]['import_type'] ?? '';
|
||||||
|
|
||||||
String get invoiceAmount =>
|
String get invoiceAmount =>
|
||||||
_localizedValues[localeCode]['invoice_amount'] ?? '';
|
_localizedValues[localeCode]['invoice_amount'] ?? '';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue