fix
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:fcs/pages/widgets/show_img.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class PaymentPage extends StatefulWidget {
|
||||
@@ -57,15 +58,20 @@ 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: () {
|
||||
modelBottomSheet(context, onFile: (file) {
|
||||
setState(() {
|
||||
_file = file;
|
||||
});
|
||||
});
|
||||
})
|
||||
_file != null
|
||||
? InkWell(
|
||||
onTap: () async {
|
||||
await _dialog(context);
|
||||
},
|
||||
child: Chip(
|
||||
label: Icon(Icons.image, color: primaryColor),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
icon: Icon(Icons.attachment, color: primaryColor),
|
||||
onPressed: () async {
|
||||
await _dialog(context);
|
||||
}),
|
||||
]);
|
||||
|
||||
final payBox = Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
@@ -133,18 +139,23 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
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))),
|
||||
flex: 2,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ShowImage(
|
||||
// localImage: attachment.value.fileUrl,
|
||||
localImage: 'assets/logo.jpg',
|
||||
url: null,
|
||||
fileName: 'image')));
|
||||
},
|
||||
child: Chip(
|
||||
label: Icon(Icons.image, color: primaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(flex: 1, child: Center(child: Text('pending'))),
|
||||
Expanded(flex: 1, child: Center(child: Text('\$ ${r.amount}'))),
|
||||
],
|
||||
@@ -218,4 +229,73 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
));
|
||||
return dataRow;
|
||||
}
|
||||
|
||||
Future<void> _dialog(BuildContext context) {
|
||||
return showDialog<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: Container(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.camera,
|
||||
size: 30,
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () async {
|
||||
// Navigator.pop(context);
|
||||
// cameraPress();
|
||||
var selectedFile =
|
||||
await pickImage(ImageSource.camera);
|
||||
setState(() {
|
||||
_file = selectedFile;
|
||||
});
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
Text("Camera")
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.photo_library,
|
||||
size: 30,
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () async {
|
||||
// Navigator.pop(context);
|
||||
// photoPress();
|
||||
var selectedFile =
|
||||
await pickImage(ImageSource.gallery);
|
||||
setState(() {
|
||||
_file = selectedFile;
|
||||
});
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
Text("Gallery")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
pickImage(ImageSource source) async {
|
||||
var tempImage = await ImagePicker.pickImage(source: source);
|
||||
return tempImage;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user