This commit is contained in:
HooDie
2023-11-11 19:57:09 +03:30
parent b567d4dac9
commit f43f5cc54f
41 changed files with 1181 additions and 399 deletions
@@ -1,3 +1,4 @@
import 'package:cssd/config/routes.dart';
import 'package:cssd/providers/items.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
@@ -51,6 +52,30 @@ class UploaderImage extends StatelessWidget {
),
),
),
SizedBox(
height: 10,
),
InkWell(
onTap: () async {
await Navigator.of(context)
.pushNamed(Routes.captureImageScreen);
// await captureImage(context);
},
child: Container(
width: MediaQuery.of(context).size.width - 40,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.black,
),
child: Text(
'+ Add an image from camera',
textDirection: TextDirection.ltr,
style: TextStyle(color: Colors.white),
textAlign: TextAlign.center,
),
),
),
],
),
),
@@ -120,16 +120,39 @@ class ItemItemBox extends StatelessWidget {
: InkWell(
customBorder: CircleBorder(),
onTap: () {
Provider.of<ItemProvider>(context,
listen: false)
.changeStatus(item!.id)
.then(
(value) {
if (value) {
print('true');
}
Navigator.of(context).popAndPushNamed(
Routes.itemResultScreen);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Do you want to change the status of the item?'),
actions: <Widget>[
TextButton(
onPressed: () {
Provider.of<ItemProvider>(context,
listen: false)
.changeStatus(item!.id)
.then(
(value) {
if (value) {
print('true');
}
Navigator.of(context)
.popAndPushNamed(Routes
.itemResultScreen);
},
);
},
child: Text('Yes'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('No'),
),
],
);
},
);
},