Documents
This commit is contained in:
parent
6d77200dae
commit
c2b4e76fe3
|
|
@ -5,6 +5,7 @@ import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/buttons/elevated_button.dart';
|
import 'package:invoiceninja_flutter/ui/app/buttons/elevated_button.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
class DocumentTile extends StatelessWidget {
|
class DocumentTile extends StatelessWidget {
|
||||||
|
|
@ -69,22 +70,35 @@ class DocumentTile extends StatelessWidget {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => showDocumentModal(context),
|
onTap: () => showDocumentModal(context),
|
||||||
child: Padding(
|
child: Card(
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 16, top: 16, right: 16, bottom: 28),
|
|
||||||
child: Text(document.name ?? '',
|
|
||||||
style: Theme.of(context).textTheme.subhead),
|
|
||||||
),
|
|
||||||
DocumentPreview(document),
|
DocumentPreview(document),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
document.name ?? '',
|
||||||
|
style: Theme.of(context).textTheme.subhead,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
formatDate(
|
||||||
|
convertTimestampToDateString(document.updatedAt),
|
||||||
|
context),
|
||||||
|
style: Theme.of(context).textTheme.caption,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@ class FormCard extends StatelessWidget {
|
||||||
const FormCard({
|
const FormCard({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.children,
|
@required this.children,
|
||||||
|
this.crossAxisAlignment,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final List<Widget> children;
|
final List<Widget> children;
|
||||||
|
final CrossAxisAlignment crossAxisAlignment;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -21,7 +23,7 @@ class FormCard extends StatelessWidget {
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.center,
|
||||||
children: children,
|
children: children,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class IconText extends StatelessWidget {
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(icon),
|
Icon(icon),
|
||||||
SizedBox(width: 6.0),
|
SizedBox(width: 8),
|
||||||
Text(text),
|
Text(text),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/document/document_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/document/document_selectors.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/buttons/elevated_button.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/document_tile.dart';
|
import 'package:invoiceninja_flutter/ui/app/document_tile.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
|
|
@ -36,9 +37,29 @@ class _ExpenseViewDocumentsState extends State<ExpenseViewDocuments> {
|
||||||
|
|
||||||
return ListView(
|
return ListView(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Padding(
|
||||||
color: Theme.of(context).backgroundColor,
|
padding: const EdgeInsets.all(14),
|
||||||
height: 12.0,
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton(
|
||||||
|
icon: Icons.camera_alt,
|
||||||
|
label: localization.takePicture,
|
||||||
|
//onPressed: _confirmDelete,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 14,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton(
|
||||||
|
icon: Icons.attach_file,
|
||||||
|
label: localization.uploadFile,
|
||||||
|
//onPressed: _confirmDelete,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
GridView.count(
|
GridView.count(
|
||||||
physics: NeverScrollableScrollPhysics(),
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ abstract class LocaleCodeAware {
|
||||||
mixin LocalizationsProvider on LocaleCodeAware {
|
mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
|
'take_picture': 'Take Picture',
|
||||||
|
'upload_file': 'Upload File',
|
||||||
'document': 'Document',
|
'document': 'Document',
|
||||||
'documents': 'Documents',
|
'documents': 'Documents',
|
||||||
'new_document': 'New Document',
|
'new_document': 'New Document',
|
||||||
|
|
@ -12264,6 +12266,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get noHistory => _localizedValues[localeCode]['no_history'];
|
String get noHistory => _localizedValues[localeCode]['no_history'];
|
||||||
|
|
||||||
|
String get takePicture => _localizedValues[localeCode]['take_picture'];
|
||||||
|
|
||||||
|
String get uploadFile => _localizedValues[localeCode]['upload_file'];
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
return _localizedValues[localeCode][lookupKey] ??
|
return _localizedValues[localeCode][lookupKey] ??
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue