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/ui/app/buttons/elevated_button.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
|
||||
class DocumentTile extends StatelessWidget {
|
||||
|
|
@ -69,22 +70,35 @@ class DocumentTile extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => showDocumentModal(context),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Card(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
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),
|
||||
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({
|
||||
Key key,
|
||||
@required this.children,
|
||||
this.crossAxisAlignment,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<Widget> children;
|
||||
final CrossAxisAlignment crossAxisAlignment;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -21,7 +23,7 @@ class FormCard extends StatelessWidget {
|
|||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.center,
|
||||
children: children,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class IconText extends StatelessWidget {
|
|||
return Row(
|
||||
children: <Widget>[
|
||||
Icon(icon),
|
||||
SizedBox(width: 6.0),
|
||||
SizedBox(width: 8),
|
||||
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/redux/app/app_state.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/utils/localization.dart';
|
||||
|
||||
|
|
@ -36,9 +37,29 @@ class _ExpenseViewDocumentsState extends State<ExpenseViewDocuments> {
|
|||
|
||||
return ListView(
|
||||
children: [
|
||||
Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
height: 12.0,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(14),
|
||||
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(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ abstract class LocaleCodeAware {
|
|||
mixin LocalizationsProvider on LocaleCodeAware {
|
||||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
'take_picture': 'Take Picture',
|
||||
'upload_file': 'Upload File',
|
||||
'document': 'Document',
|
||||
'documents': 'Documents',
|
||||
'new_document': 'New Document',
|
||||
|
|
@ -12264,6 +12266,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
|
||||
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) {
|
||||
final lookupKey = toSnakeCase(key);
|
||||
return _localizedValues[localeCode][lookupKey] ??
|
||||
|
|
|
|||
Loading…
Reference in New Issue