Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
anishsreenivas82 committed Jul 30, 2021
1 parent 8d7e900 commit ff4ea01
Showing 1 changed file with 1 addition and 163 deletions.
164 changes: 1 addition & 163 deletions lib/pages/verification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';
import 'package:flutterlogindesign/pages/qr.dart';
import 'package:flutterlogindesign/pages/qrscan.dart';

import 'package:flutterlogindesign/pages/volunteer_page.dart';

String doc;
String uid;
String qr_code;
<<<<<<< HEAD
var tee;

=======
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
var name, type, quantity, babyproduct;

class VerifcationPage extends StatefulWidget {
Expand All @@ -42,17 +39,10 @@ class _VerifcationPageState extends State<VerifcationPage> {
radio2 = 0;
radio3 = 0;
i = 0;
<<<<<<< HEAD
name = "";
type = "";
quantity = "";
babyproduct = "";
=======
name = "";
type = "";
quantity = "";
babyproduct = "";
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
qrscan();
}

Expand All @@ -70,57 +60,20 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection

@override
Widget build(BuildContext context) {
<<<<<<< HEAD


=======
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
CollectionReference a = FirebaseFirestore.instance.collection('Shelter');
CollectionReference b = FirebaseFirestore.instance.collection('Owners');

doc = qr_code.substring(0, 20);
uid = qr_code.substring(20);
<<<<<<< HEAD
=======

// for(int i=0;i<20;i++)
// {
// doc = ''+qrcode[i];
// }
// for(int i=20;i<48;i++)
// {
// uid = ''+qrcode[i];
// }

var info = FirebaseFirestore.instance
.collection('Owners')
.doc(uid)
.collection('items')
.doc(doc);
info.get().then((DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists) {
name = documentSnapshot.get('Name').toString();
type = documentSnapshot.get('Type').toString();
quantity = documentSnapshot.get('Quantity').toString();
babyproduct = documentSnapshot.get('Baby').toString();
} else
CircularProgressIndicator();
print("here");
});

>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
print(qr_code);
print(doc);
print(name);
print(type);
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;

<<<<<<< HEAD
=======
TextButton(onPressed: () {}, child: Text('Accept'));
double width = MediaQuery.of(context).size.width;
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991


return FutureBuilder(
Expand All @@ -141,7 +94,6 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Text(
'Name',
<<<<<<< HEAD
style: TextStyle(fontSize: 22),
),
Text('-',style: TextStyle(fontSize: 25),),
Expand Down Expand Up @@ -182,48 +134,10 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
Text(
snapshot.data['Baby'],
style: TextStyle(fontSize: 22),
=======
style: TextStyle(fontSize: 15),
),
Text(
name,
style: TextStyle(fontSize: 15),
),
]),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Text(
'Type',
style: TextStyle(fontSize: 15),
),
Text(
type,
style: TextStyle(fontSize: 15),
),
]),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Text(
'Quantity',
style: TextStyle(fontSize: 15),
),
Text(
quantity,
style: TextStyle(fontSize: 15),
),
]),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Text(
'Baby Product',
style: TextStyle(fontSize: 15),
),
Text(
babyproduct,
style: TextStyle(fontSize: 15),
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
),
]),

SizedBox(height: 20),
<<<<<<< HEAD
Divider(height: 3,color: Colors.black,),

Row(
Expand All @@ -232,14 +146,6 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
Container(
child: Wrap(children: [Text('Are the products sealed?',style: TextStyle(fontSize: 18),)]),
width: width * 0.8),
=======

Row(
children: [
Container(
child: Wrap(children: [Text('Are the products sealed?')]),
width: width * 0.6),
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
Radio(
value: 1,
groupValue: radio1,
Expand All @@ -255,22 +161,13 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
SizedBox(height: 20),

Row(
<<<<<<< HEAD
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Wrap(children: [
Text('Do the products have atleast 2 weeks before expiry?',style: TextStyle(fontSize: 18),)
]),
width: width * 0.8),
=======
children: [
Container(
child: Wrap(children: [
Text('Do the products have atleast 2 weeks before expiry')
]),
width: width * 0.6),
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
Radio(
value: 2,
groupValue: radio2,
Expand All @@ -285,22 +182,13 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
SizedBox(height: 20),

Row(
<<<<<<< HEAD
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Wrap(children: [
Text('Do the products match the description above?',style: TextStyle(fontSize: 18),)
]),
width: width * 0.8),
=======
children: [
Container(
child: Wrap(children: [
Text('Do the products match the description above')
]),
width: width * 0.6),
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
Radio(
value: 3,
groupValue: radio3,
Expand All @@ -315,10 +203,7 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
SizedBox(height: 20),

Row(
<<<<<<< HEAD
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
=======
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
children: [
TextButton(
onPressed: () {
Expand All @@ -341,20 +226,14 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection
Navigator.push(context,
MaterialPageRoute(builder: (context) => Volunteer()));
},
<<<<<<< HEAD
child: Text('Accept',style: TextStyle(fontSize: 25,color: Colors.green),)),
TextButton(

=======
child: Text('Accept')),
TextButton(
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
onPressed: () {
b.doc(uid).collection('items').doc(doc).delete();
Navigator.push(context,
MaterialPageRoute(builder: (context) => Volunteer()));
},
<<<<<<< HEAD
child: Text('Reject',style: TextStyle(fontSize: 25,color: Colors.red),))
],
)
Expand All @@ -377,58 +256,17 @@ return await FirebaseFirestore.instance.collection("Owners").doc(uid).collection



=======
child: Text('Reject'))
],
)

// Text('Do the products have more than 2 weeks of time before expiry?'),
// Text('Does the product match the description?')

// ]),
// ),
// Column(children: [
// Radio(
// value: 1,
// groupValue: 0,
// onChanged: (value) {
// setRadio();
// i++;
// }),
// Radio(
// value: 1,
// groupValue: 0,
// onChanged: (value) {
// setRadio();
// i++;
// }),
// Radio(
// value: 1,
// groupValue: 0,
// onChanged: (value) {
// setRadio();
// i++;
// })
// ],)
// ]),
]),
),
);
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
}

Future<void> qrscan() async {
try {
qr_code = await FlutterBarcodeScanner.scanBarcode(
'#ff6666', 'Cancel', true, ScanMode.QR);
<<<<<<< HEAD
setState(() {
return;
});


=======
>>>>>>> 23440c316dcb4e887e4b97c255c50982b1260991
} on PlatformException {
qr_code = 'Error';
}
Expand Down

0 comments on commit ff4ea01

Please sign in to comment.