forked from Fuzail-Raza/Pet-Care-App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Tracking issue , add Dynamic Data in Screens , created AddPet File
- Loading branch information
1 parent
4ad9c4c
commit 2f1ee79
Showing
15 changed files
with
681 additions
and
35 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
pet_care/.dart_tool/flutter_build/880231b68eb572aa1fc3e7a52a7c2b36/.filecache
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+56.3 KB
(100%)
pet_care/.dart_tool/flutter_build/880231b68eb572aa1fc3e7a52a7c2b36/app.dill
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
....dart_tool/flutter_build/880231b68eb572aa1fc3e7a52a7c2b36/debug_android_application.stamp
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
pet_care/.dart_tool/flutter_build/880231b68eb572aa1fc3e7a52a7c2b36/flutter_assets.d
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
pet_care/.dart_tool/flutter_build/880231b68eb572aa1fc3e7a52a7c2b36/kernel_snapshot.d
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
pet_care/.dart_tool/flutter_build/880231b68eb572aa1fc3e7a52a7c2b36/kernel_snapshot.stamp
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:firebase_core/firebase_core.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/rendering.dart'; | ||
import 'package:pet_care/petDetails.dart'; | ||
import 'package:pet_care/uihelper.dart'; | ||
|
||
class petScreenDynamic extends StatefulWidget { | ||
Map<String,dynamic> userData; | ||
petScreenDynamic({super.key,required this.userData}); | ||
|
||
@override | ||
State<petScreenDynamic> createState() => _petScreenDynamicState(); | ||
} | ||
|
||
class _petScreenDynamicState extends State<petScreenDynamic> { | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack(children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Container( | ||
decoration: BoxDecoration( | ||
color: Colors.pinkAccent.shade100, | ||
borderRadius: BorderRadius.circular(10)), | ||
), | ||
), | ||
Container( | ||
decoration: BoxDecoration( | ||
color: Colors.white70, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Container( | ||
decoration: BoxDecoration(color: Colors.transparent), | ||
child: StreamBuilder( | ||
stream: FirebaseFirestore.instance | ||
.collection("PetData") | ||
.doc(widget.userData["Email"]+"1") | ||
.snapshots(), | ||
builder: (context, snapshot) { | ||
if (snapshot.connectionState == ConnectionState.active) { | ||
if (!snapshot.requireData.exists) { | ||
return Center( | ||
child: Container( | ||
width: RenderErrorBox.minimumWidth, | ||
height: RenderErrorBox.minimumWidth / 1.5, | ||
decoration: BoxDecoration( | ||
color: Colors.blueGrey, | ||
borderRadius: BorderRadius.circular(10), | ||
border: | ||
Border.all(color: Colors.pinkAccent.shade200)), | ||
child: Center( | ||
child: Text( | ||
"Error ${snapshot.error.toString()}", | ||
style: TextStyle( | ||
fontSize: 18, fontWeight: FontWeight.bold), | ||
)), | ||
), | ||
); | ||
} else if (snapshot.hasData) { | ||
// print("Snap Data : ${snapshot.data.toString()}"); | ||
// Todo setList Info | ||
|
||
// list = snapshot.data!["petIds"]; | ||
return ListView.builder( | ||
itemBuilder: (context, index) { | ||
return Padding( | ||
padding: const EdgeInsets.all(20.0), | ||
child: InkWell( | ||
onTap: () { | ||
Navigator.push(context, MaterialPageRoute(builder: (context) => petDetails(petData: snapshot.data!.data(),),)); | ||
}, | ||
child: Container( | ||
decoration: BoxDecoration( | ||
color: Colors.pinkAccent.shade100, | ||
borderRadius: BorderRadius.circular(13)), | ||
child: ListTile( | ||
style: ListTileStyle.drawer, | ||
leading: CircleAvatar( | ||
backgroundImage: NetworkImage(snapshot.data!["Photo"])), | ||
contentPadding: EdgeInsets.all(30), | ||
title: Text( | ||
"${snapshot.data!["Name"]} + $index"), | ||
subtitle: Text( | ||
"${snapshot.data!["Breed"]} "), | ||
trailing: Icon( | ||
Icons.ads_click, | ||
color: Colors.pinkAccent.shade700, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
|
||
// Todo Fix The Iterator lenght | ||
itemCount: 1, | ||
); | ||
} | ||
} | ||
|
||
return Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
}), | ||
), | ||
) | ||
]); | ||
} | ||
} |
Oops, something went wrong.