update invoice
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fcs/domain/entities/invoice.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/invoice/payment_page_edit.dart';
|
||||
import 'package:fcs/pages/widgets/image_file_picker.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_file.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:fcs/pages/widgets/number_cell.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:fcs/pages/widgets/show_img.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PaymentPage extends StatefulWidget {
|
||||
final Invoice invoice;
|
||||
@@ -33,6 +31,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
bool _isLoading = false;
|
||||
|
||||
bool isNew;
|
||||
File _file;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -59,7 +58,25 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
final receiptFileBox = Row(children: [
|
||||
LocalText(context, 'pm.attachment', fontSize: 16, color: Colors.grey),
|
||||
IconButton(
|
||||
icon: Icon(Icons.attachment, color: primaryColor), onPressed: () {})
|
||||
icon: Icon(Icons.attachment, color: primaryColor),
|
||||
onPressed: () {
|
||||
modelBottomSheet(context, onFile: (file) {
|
||||
setState(() {
|
||||
_file = file;
|
||||
});
|
||||
});
|
||||
})
|
||||
]);
|
||||
|
||||
final payBox = Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Container(
|
||||
height: 50,
|
||||
width: 100,
|
||||
alignment: Alignment.center,
|
||||
child: Text(AppTranslations.of(context).text("pm.pay"),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14)),
|
||||
color: primaryColor)
|
||||
]);
|
||||
|
||||
return LocalProgress(
|
||||
@@ -73,9 +90,6 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("pm_.title")),
|
||||
actions: [
|
||||
IconButton(icon: Icon(Icons.cloud_upload), onPressed: () {})
|
||||
],
|
||||
),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
@@ -84,6 +98,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
SizedBox(height: 10),
|
||||
receiptFileBox,
|
||||
SizedBox(height: 10),
|
||||
payBox,
|
||||
Divider(),
|
||||
SizedBox(height: 10),
|
||||
LocalTitle(textKey: "pm.receipt"),
|
||||
@@ -109,15 +124,31 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||
padding:
|
||||
const EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(flex: 2, child: Text(dateFormatter.format(r.date))),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Center(child: Text('receipt' + k.toString() + '.png'))),
|
||||
Expanded(flex: 1, child: Center(child: Text('pending'))),
|
||||
Expanded(flex: 1, child: Center(child: Text('\$ ${r.amount}'))),
|
||||
],
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(CupertinoPageRoute(
|
||||
builder: (context) => PaymentPageEdit(receipt: r)));
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(flex: 2, child: Text('${r.date}')),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ShowImage(
|
||||
localImage: 'assets/logo.jpg',
|
||||
url: null,
|
||||
fileName: 'image')));
|
||||
},
|
||||
child: Icon(Icons.attachment, color: primaryColor))),
|
||||
Expanded(flex: 1, child: Center(child: Text('pending'))),
|
||||
Expanded(flex: 1, child: Center(child: Text('\$ ${r.amount}'))),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
@@ -133,7 +164,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('Product', style: TextStyle(color: Colors.grey))),
|
||||
child: Text('Date', style: TextStyle(color: Colors.grey))),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('File',
|
||||
|
||||
Reference in New Issue
Block a user