Reports
This commit is contained in:
parent
a02d8343c0
commit
bb7436a97e
|
|
@ -1,9 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/forms/app_dropdown_button.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
|
||||
void multiselectDialog(
|
||||
{BuildContext context,
|
||||
String title,
|
||||
String addTitle,
|
||||
List<String> options,
|
||||
List<String> selected,
|
||||
Function(List<String>) onSelected}) {
|
||||
|
|
@ -36,10 +38,11 @@ void multiselectDialog(
|
|||
}
|
||||
|
||||
class _MultiSelectList extends StatefulWidget {
|
||||
const _MultiSelectList({this.options, this.selected});
|
||||
const _MultiSelectList({this.options, this.selected, this.addTitle});
|
||||
|
||||
final List<String> options;
|
||||
final List<String> selected;
|
||||
final String addTitle;
|
||||
|
||||
@override
|
||||
_MultiSelectListState createState() => _MultiSelectListState();
|
||||
|
|
@ -61,6 +64,20 @@ class _MultiSelectListState extends State<_MultiSelectList> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
AppDropdownButton<String>(
|
||||
labelText: widget.addTitle,
|
||||
items: widget.options
|
||||
.map((option) => DropdownMenuItem(
|
||||
child: Text(option),
|
||||
value: option,
|
||||
))
|
||||
.toList(),
|
||||
value: null,
|
||||
showBlank: true,
|
||||
onChanged: (dynamic value) {
|
||||
print('## selected $value');
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: ReorderableListView(
|
||||
children: selected
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
options: ['one', 'two', 'three', 'four'],
|
||||
selected: ['one', 'two', 'three'],
|
||||
title: localization.editColumns,
|
||||
addTitle: localization.addColumn,
|
||||
);
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ abstract class LocaleCodeAware {
|
|||
mixin LocalizationsProvider on LocaleCodeAware {
|
||||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
'add_column': 'Add Column',
|
||||
'edit_columns': 'Edit Columns',
|
||||
'columns': 'Columns',
|
||||
'aging': 'Aging',
|
||||
|
|
@ -15996,6 +15997,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
|
||||
String get editColumns => _localizedValues[localeCode]['edit_columns'];
|
||||
|
||||
String get addColumn => _localizedValues[localeCode]['add_column'];
|
||||
|
||||
|
||||
String lookup(String key) {
|
||||
final lookupKey = toSnakeCase(key);
|
||||
|
|
|
|||
Loading…
Reference in New Issue