Skip to content

Commit

Permalink
Added Remainder Details Form , fixes issues , added TODO Marks, Conve…
Browse files Browse the repository at this point in the history
…rted stf to stl (where possible)
  • Loading branch information
Fuzail-Raza committed May 6, 2024
1 parent 2094a58 commit 4ad9c4c
Show file tree
Hide file tree
Showing 18 changed files with 328 additions and 102 deletions.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pet_care/.flutter-plugins-dependencies

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pet_care/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:value="2" />
<!--&lt;!&ndash; Todo Change API KEY VALUE Accordingly-->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCzaAl9_14o73H6wyYzx9o0X6Y-XediM0I"/>
android:value="AIzaSyBSnFpHnup88if4QNvcgTPHfBKRkIhOym4"/>
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
Expand Down
7 changes: 1 addition & 6 deletions pet_care/lib/CheckFiles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ import 'package:pet_care/SplashScreen.dart';
import 'package:pet_care/TrackingPet.dart';
import 'package:pet_care/phoneAuthentication.dart';

class checkFiles extends StatefulWidget {
class checkFiles extends StatelessWidget {
const checkFiles({super.key});

@override
State<checkFiles> createState() => _checkFilesState();
}

class _checkFilesState extends State<checkFiles> {
@override
Widget build(BuildContext context) {

Expand Down
9 changes: 2 additions & 7 deletions pet_care/lib/HomePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_nav_bar/google_nav_bar.dart';

class HomePage extends StatefulWidget {
class HomePage extends StatelessWidget {
Map<String,dynamic> userData;
HomePage({super.key,required this.userData});

@override
State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {

Expand All @@ -21,7 +16,7 @@ class _HomePageState extends State<HomePage> {
child: Scaffold(

appBar: AppBar(
title: Text("Welcome ${widget.userData["Name"]}" ),
title: Text("Welcome ${userData["Name"]}" ),
// centerTitle: true,
bottom: const TabBar(tabs: [
Tab(
Expand Down
8 changes: 6 additions & 2 deletions pet_care/lib/PetDetailsWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart';
import 'package:pet_care/ColorsScheme.dart';
import 'package:pet_care/addTaskContainer.dart';
import 'package:pet_care/petReminderDetailsWidget.dart';
import 'package:pet_care/showTaskDetailsContainer.dart';
import 'package:pet_care/uihelper.dart';

class PetDetailsWidget extends StatefulWidget {
Expand Down Expand Up @@ -78,8 +79,11 @@ class _PetDetailsWidgetState extends State<PetDetailsWidget> {
flex: 9,
child: InkWell(
onTap: () {},
child: SingleChildScrollView(
child: petReminderDetails())),

/// TODO fix scrolling issue
child: ListView(children: [petReminderDetails()])
),
)
: Expanded(
child: InkWell(
Expand Down
21 changes: 8 additions & 13 deletions pet_care/lib/ProfilePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ import 'package:flutter/material.dart';
import 'package:pet_care/LoginPage.dart';
import 'package:pet_care/phoneAuthentication.dart';

class ProfilePage extends StatefulWidget {
class ProfilePage extends StatelessWidget {

Map<String,dynamic> userData;

ProfilePage({super.key,required this.userData});

@override
State<ProfilePage> createState() => _ProfilePageState();
}

class _ProfilePageState extends State<ProfilePage> {
@override
Widget build(BuildContext context) {
return Stack(children: [
Expand Down Expand Up @@ -44,9 +39,9 @@ class _ProfilePageState extends State<ProfilePage> {
},

//Todo : Remove else if as Pic never be null
leading: widget.userData["Pic"]!=null ? CircleAvatar(
leading: userData["Pic"]!=null ? CircleAvatar(
radius: 30,
backgroundImage: NetworkImage(widget.userData["Pic"]),
backgroundImage: NetworkImage(userData["Pic"]),
backgroundColor: Colors.white70,
) :
CircleAvatar(
Expand All @@ -56,19 +51,19 @@ class _ProfilePageState extends State<ProfilePage> {
)
,
title: Text(
widget.userData["Name"],
userData["Name"],
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
),
),
subtitle: Text(widget.userData["Email"]),
subtitle: Text(userData["Email"]),
trailing: IconButton(
disabledColor: Colors.blueGrey.shade600,
icon: widget.userData["isVerified"] == true ? Icon(Icons.verified_user) : Icon(Icons.add),
onPressed: widget.userData["isVerified"]==false ? (){
Navigator.push(context, MaterialPageRoute(builder: (context) =>PhoneAuthentication(userData: widget.userData,) ,));
icon: userData["isVerified"] == true ? Icon(Icons.verified_user) : Icon(Icons.add),
onPressed: userData["isVerified"]==false ? (){
Navigator.push(context, MaterialPageRoute(builder: (context) =>PhoneAuthentication(userData: userData,) ,));
} : null
,),
),
Expand Down
3 changes: 2 additions & 1 deletion pet_care/lib/TrackingPet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ class _trackingPetState extends State<trackingPet> {
title = values[dropdownvalue]!["Name"].toString();
pos = LatLng(values[dropdownvalue]!["Lat"] as double,
values[dropdownvalue]!["Long"] as double);
polylineCoordinates=[];
isRouting=false;
});

Expand All @@ -367,4 +368,4 @@ class _trackingPetState extends State<trackingPet> {
),
);
}
}
}
3 changes: 2 additions & 1 deletion pet_care/lib/addTaskContainer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class _addTaskContainerState extends State<addTaskContainer> {
@override
Widget build(BuildContext context) {
return Container(
height: 700,
height: 714,
decoration: BoxDecoration(
color: Colors.grey.shade300, borderRadius: BorderRadius.circular(4)),
child: Column(
Expand Down Expand Up @@ -74,6 +74,7 @@ class _addTaskContainerState extends State<addTaskContainer> {
),
),
TextFormField(
maxLength: 16,
controller: titleController,
autovalidateMode:
AutovalidateMode.onUserInteraction,
Expand Down
2 changes: 1 addition & 1 deletion pet_care/lib/apiKey.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

var APIKEY="AIzaSyCzaAl9_14o73H6wyYzx9o0X6Y-XediM0I";
var APIKEY="AIzaSyBSnFpHnup88if4QNvcgTPHfBKRkIhOym4";
8 changes: 8 additions & 0 deletions pet_care/lib/petDetails.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:pet_care/ColorsScheme.dart';
import 'package:pet_care/PetDetailsWidget.dart';
import 'package:pet_care/showTaskDetailsContainer.dart';

class petDetails extends StatefulWidget {
const petDetails({super.key});
Expand All @@ -17,6 +18,13 @@ class _petDetailsState extends State<petDetails> {
title: Text("Welcome Fuzail"),
backgroundColor: Colors.grey.shade500,
),

/// ToDO Remove Drawer Property
endDrawer: Drawer(
child: ListView(
children: [ showTaskDetailsContainer()]),
),
body: Container(
color: primaryColorBackground,
child: Padding(
Expand Down
147 changes: 82 additions & 65 deletions pet_care/lib/petReminderDetailsWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'package:awesome_snackbar_content/awesome_snackbar_content.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:pet_care/petReminderDeatilsData.dart';
import 'package:pet_care/showTaskDetailsContainer.dart';
import 'package:pet_care/uihelper.dart';

class petReminderDetails extends StatefulWidget {
const petReminderDetails({Key? key}) : super(key: key);
Expand All @@ -11,8 +13,13 @@ class petReminderDetails extends StatefulWidget {
}

class _petReminderDetailsState extends State<petReminderDetails> {



var data = perReminderDetailsData().ReminderData;

bool isTaskDetail=false;

@override
Widget build(BuildContext context) {
return Container(
Expand Down Expand Up @@ -84,79 +91,89 @@ class _petReminderDetailsState extends State<petReminderDetails> {
// color: Colors.greenAccent,
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
flex: 5,
child: Text(
data[index]["title"] as String,
style: TextStyle(
fontSize: 15, fontWeight: FontWeight.w500),
),
),
Expanded(
flex: 2,
child: Center(
child: InkWell(

///TODO fixe Remainder Details Contianer Rendering
onTap: (){
isTaskDetail=true;
Scaffold.of(context).openEndDrawer(
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
flex: 5,
child: Text(
data[index]["Time"] as String,
style: TextStyle(fontSize: 16),
data[index]["title"] as String,
style: TextStyle(
fontSize: 15, fontWeight: FontWeight.w500),
),
),
),
Expanded(
flex: 3,
child: Center(
child: Text(
data[index]["Date"] as String,
style: TextStyle(fontSize: 16),
Expanded(
flex: 2,
child: Center(
child: Text(
data[index]["Time"] as String,
style: TextStyle(fontSize: 16),
),
),
),
),
InkWell(
onTap: () {
setState(() {
data[index]["isSilent"] =
!(data[index]["isSilent"] as bool);
});

final snackBar = SnackBar(
elevation: 0,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
content: AwesomeSnackbarContent(
title: 'Ring!',
message: 'Notifications Turned ON!',
contentType: ContentType.success,
Expanded(
flex: 3,
child: Center(
child: Text(
data[index]["Date"] as String,
style: TextStyle(fontSize: 16),
),
);
),
),
InkWell(
onTap: () {
setState(() {
data[index]["isSilent"] =
!(data[index]["isSilent"] as bool);
});

final snackBarSilent = SnackBar(
elevation: 0,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
content: AwesomeSnackbarContent(
title: 'Silent!',
message: 'Notifications Turned OFF!',
contentType: ContentType.warning,
color: Colors.blueGrey,
),
);
final snackBar = SnackBar(
elevation: 0,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
content: AwesomeSnackbarContent(
title: 'Ring!',
message: 'Notifications Turned ON!',
contentType: ContentType.success,
),
);

final snackBarSilent = SnackBar(
elevation: 0,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
content: AwesomeSnackbarContent(
title: 'Silent!',
message: 'Notifications Turned OFF!',
contentType: ContentType.warning,
color: Colors.blueGrey,
),
);

data[index]["isSilent"] == true
? ScaffoldMessenger.of(context)
.showSnackBar(snackBarSilent)
: ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
},
child: data[index]["isSilent"] == true
? FaIcon(
FontAwesomeIcons.clock,
size: 20,
)
: FaIcon(FontAwesomeIcons.userClock,size: 20,),
),
],
data[index]["isSilent"] == true
? ScaffoldMessenger.of(context)
.showSnackBar(snackBarSilent)
: ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
},
child: data[index]["isSilent"] == true
? FaIcon(
FontAwesomeIcons.clock,
size: 20,
)
: FaIcon(FontAwesomeIcons.userClock,size: 20,),
),
],
),
),
);
},
Expand Down
Loading

0 comments on commit 4ad9c4c

Please sign in to comment.