Commit 2d144052 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

13-05-2025 By Sai Srinivas

Attendance, JKS file
parent 479f7f07
File added
...@@ -384,7 +384,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -384,7 +384,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_genID = scanData.code; _genID = scanData.code;
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Generatordetails()), MaterialPageRoute(builder: (context) => Generatordetails(generatorId: scanData.code,)),
); );
} else if (from == "Register Complaint") { } else if (from == "Register Complaint") {
_genID = scanData.code; _genID = scanData.code;
...@@ -420,7 +420,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -420,7 +420,7 @@ class Generatordetailsprovider extends ChangeNotifier {
if (data != null) { if (data != null) {
if (data.error == 0) { if (data.error == 0) {
_genID = genID; _genID = data.genId;
_aname = data.aname; _aname = data.aname;
_emodel = data.emodel; _emodel = data.emodel;
_spname = data.spname; _spname = data.spname;
...@@ -464,12 +464,11 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -464,12 +464,11 @@ class Generatordetailsprovider extends ChangeNotifier {
_selectedDescription = ""; _selectedDescription = "";
_selectedDescriptionId = ""; _selectedDescriptionId = "";
} }
notifyListeners();
if (from == "Generator Details") { if (from == "Generator Details") {
this._qrViewController!.pauseCamera(); this._qrViewController!.pauseCamera();
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Generatordetails()), MaterialPageRoute(builder: (context) => Generatordetails(generatorId: _genID,)),
); );
} else if (from == "Register Complaint") { } else if (from == "Register Complaint") {
this._qrViewController!.pauseCamera(); this._qrViewController!.pauseCamera();
...@@ -479,7 +478,6 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -479,7 +478,6 @@ class Generatordetailsprovider extends ChangeNotifier {
); );
} }
notifyListeners();
} else if (data.error == 1) { } else if (data.error == 1) {
toast(context, "Enter Correct ID"); toast(context, "Enter Correct ID");
} else {} } else {}
...@@ -491,6 +489,92 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -491,6 +489,92 @@ class Generatordetailsprovider extends ChangeNotifier {
} }
} }
Future<void> LoadTechniciangeneratorDetailsApifunction(
homeProvider,
BuildContext context,
from,
genID,
) async {
try {
final data = await ApiCalling.LoadTechnicianGeneratorDetailsAPI(
homeProvider.empId,
homeProvider.session,
genID,
);
if (data != null) {
if (data.error == 0) {
_genID = genID;
_aname = data.aname;
_emodel = data.emodel;
_spname = data.spname;
_mob1 = data.mob1;
_mob2 = data.mob2;
_mail = data.mail;
_cname = data.cname;
_engineNo = data.engineNo;
_dateOfEngineSale = data.dateOfEngineSale;
_altNo = data.altNo;
_btryNo = data.btryNo;
_dgSetNo = data.dgSetNo;
_state = data.state;
_district = data.district;
_address = data.address;
_dispDate = data.dispDate;
_cmsngDate = data.cmsngDate;
_status = data.status;
_complaintTypeDropdown = data.complaintTypeList!;
_complaintCategorydropdown = data.complaintCategoryList!;
_complaintDescriptionDropdown = data.complaintDescriptionList!;
if (_selectedComplaintType != null &&
!_complaintTypeDropdown.contains(_selectedComplaintType)) {
_selectedComplaintType = null;
_selectedType = "";
_selectedTypeId = "";
}
if (_selectedCategoryType != null &&
!_complaintCategorydropdown.contains(_selectedCategoryType)) {
_selectedCategoryType = null;
_selectedCategory = "";
_selectedCategoryId = "";
}
if (_selectedDescriptionType != null &&
!_complaintDescriptionDropdown.contains(
_selectedDescriptionType,
)) {
_selectedDescriptionType = null;
_selectedDescription = "";
_selectedDescriptionId = "";
}
if (from == "Generator Details") {
this._qrViewController!.pauseCamera();
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Generatordetails(generatorId: _genID,)),
);
} else if (from == "Register Complaint") {
this._qrViewController!.pauseCamera();
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Registercomplaint()),
);
}
}
else if (data.error == 1) {
toast(context, "Enter Correct ID");
} else {}
notifyListeners();
}
} on Error catch (e) {
print(e.toString());
}
}
Future<void> LoadgeneratorComplaintHistoryApifunction( Future<void> LoadgeneratorComplaintHistoryApifunction(
homeProvider, homeProvider,
BuildContext context, BuildContext context,
......
...@@ -43,7 +43,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -43,7 +43,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
bool _isLoading = true; bool _isLoading = true;
String _selectedItem = 'Active'; String _selectedItem = 'Active';
double _currentValue = 1.0; double _currentValue = 1.0;
Timer? _debounceTimer;
List<Nearbygenerators> get generatorsList => _generatorslist; List<Nearbygenerators> get generatorsList => _generatorslist;
...@@ -64,6 +64,19 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -64,6 +64,19 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
String get selectedItem => _selectedItem; String get selectedItem => _selectedItem;
double get currentValue => _currentValue; double get currentValue => _currentValue;
set currentValue(value){
_currentValue = value;
notifyListeners();
}
set selectedItem(String value){
_selectedItem = value;
notifyListeners();
}
set markers(List<Marker> value){
_markers = value;
notifyListeners();
}
set mapController(value){ set mapController(value){
_mapController = value; _mapController = value;
notifyListeners(); notifyListeners();
...@@ -120,9 +133,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -120,9 +133,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
getLocationPermission(context); getLocationPermission(context);
}); });
} }
void debounce(VoidCallback callback, Duration duration) {
_debounceTimer?.cancel();
_debounceTimer = Timer(duration, callback);
}
Future<void> LoadNearbyGeneratorsAPI(BuildContext context) async { Future<void> LoadNearbyGeneratorsAPI(BuildContext context) async {
if (_latlongs.isEmpty || _currentValue <= 0) {
print("Invalid parameters: latlongs=$_latlongs, currentValue=$_currentValue");
return;
}
try { try {
var provider = Provider.of<HomescreenNotifier>(context, listen: false); var provider = Provider.of<HomescreenNotifier>(context, listen: false);
final data = await ApiCalling.loadNearbyGeneratorsAPI( final data = await ApiCalling.loadNearbyGeneratorsAPI(
...@@ -138,7 +159,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -138,7 +159,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
if (data.error == 0) { if (data.error == 0) {
_generatorslist = data.list!; _generatorslist = data.list!;
updateMarkersFromApiResponse(context, data.list!); await updateMarkersFromApiResponse(context, data.list!);
_isLoading = false; _isLoading = false;
notifyListeners(); notifyListeners();
} else {} } else {}
...@@ -162,16 +183,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -162,16 +183,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
List<Nearbygenerators> generatorslist, List<Nearbygenerators> generatorslist,
) async { ) async {
_markers = await createMarkersFromApiResponse(context, generatorslist); _markers = await createMarkersFromApiResponse(context, generatorslist);
_addresses.clear();
await Future.forEach(generatorslist, (store) async { await Future.forEach(generatorslist, (store) async {
String address = await _getAddressFromLatLng(store.loc); String address = await _getAddressFromLatLng(store.loc);
_addresses.add(address); _addresses.add(address);
notifyListeners();
}); });
for (int i = 0; i < _addresses.length; i++) { notifyListeners();
//print('List of Addresses:' "${addresses[i]}"); // for (int i = 0; i < _addresses.length; i++) {
// print('List of Addresses:' "${addresses[1]}" ); // //print('List of Addresses:' "${addresses[i]}");
} // // print('List of Addresses:' "${addresses[1]}" );
// }
} }
Future<List<Marker>> createMarkersFromApiResponse( Future<List<Marker>> createMarkersFromApiResponse(
...@@ -217,9 +239,9 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -217,9 +239,9 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Generatordetails( (context) => Generatordetails(
// actName: "NearByGenerators", activityName: "NearByGenerators",
// location: generator.loc, genLocation: generator.loc,
// generatorId: generator.generatorId, generatorId: generator.generatorId,
), ),
), ),
); );
...@@ -273,171 +295,4 @@ class Nearbygeneratorsprovider extends ChangeNotifier { ...@@ -273,171 +295,4 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
return "Address not found"; return "Address not found";
} }
Future infoDialogue(BuildContext context) async {
return await showDialog(
context: context,
builder:
(context) => StatefulBuilder(
builder:
(context, setState) => AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
title: Column(
children: [
Row(
children: [
Expanded(
child: Align(
alignment: Alignment.topLeft,
child: Text(
'Filter',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
),
),
InkWell(
child: SvgPicture.asset(
"assets/ic_cancel.svg",
height: 35,
width: 35,
),
onTap: () {
setState(() {
_currentValue = 0.0;
_selectedItem = "Active";
});
Navigator.pop(context);
},
),
],
),
Divider(
color: Colors.grey,
thickness: 1.0,
height: 0.0,
),
],
),
content: Container(
height: 230,
child: Column(
children: [
Row(
children: [
Text(
"Radius",
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
Spacer(),
Text(
'${_currentValue.toStringAsFixed(2)} KM',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
],
),
Slider(
value: _currentValue,
max: 100,
divisions: 100,
label: _currentValue.toStringAsFixed(2),
inactiveColor: Colors.grey,
onChanged: (value) {
_currentValue = value;
notifyListeners();
},
),
Text(
'Status',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
Container(
width: 200, // Set the desired width here
child: DropdownButton<String>(
value: _selectedItem,
items:
<String>[
'Active',
'Inactive',
'Suspense',
].map<DropdownMenuItem<String>>((
String value,
) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (String? newValue) {
setState(() {
_selectedItem = newValue!;
});
},
icon: Icon(
CupertinoIcons.arrowtriangle_down_fill,
),
iconSize: 12,
iconEnabledColor:
Colors
.black, // Remove the default dropdown icon
),
),
SizedBox(height: 30.0),
Container(
child: InkWell(
onTap: () {
_markers = [];
LoadNearbyGeneratorsAPI(context);
Navigator.pop(context);
_currentValue = 0.0;
_selectedItem = "Active";
notifyListeners();
},
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(
left: 15.0,
right: 15.0,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
),
child: Text(
"Search",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Nexa',
fontWeight: FontWeight.w700,
),
),
),
),
),
],
),
),
),
),
barrierDismissible: true,
) ??
false;
}
} }
...@@ -33,3 +33,37 @@ PreferredSizeWidget appbar(BuildContext context, title) { ...@@ -33,3 +33,37 @@ PreferredSizeWidget appbar(BuildContext context, title) {
), ),
); );
} }
PreferredSizeWidget appbar2(BuildContext context, title,widget) {
return AppBar(
automaticallyImplyLeading: false,
elevation: 2.0,
title: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25),
),
Text(
title,
style: TextStyle(
fontSize: 16,
height: 1.1,
color: AppColors.semi_black,
),
),
Spacer(),
widget
],
),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30), // Adjust the radius as needed
),
),
);
}
This diff is collapsed.
This diff is collapsed.
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/GeneratorDetailsProvider.dart'; import 'package:generp/Notifiers/GeneratorDetailsProvider.dart';
import 'package:generp/screens/genTracker/ComplaintHistory.dart'; import 'package:generp/screens/genTracker/ComplaintHistory.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../Notifiers/HomeScreenNotifier.dart'; import '../../Notifiers/HomeScreenNotifier.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart'; import '../../Utils/commonWidgets.dart';
class Generatordetails extends StatefulWidget { class Generatordetails extends StatefulWidget {
const Generatordetails({super.key}); final activityName;
final genLocation;
final generatorId;
const Generatordetails({
super.key,
this.activityName,
this.genLocation,
required this.generatorId,
});
@override @override
State<Generatordetails> createState() => _GeneratordetailsState(); State<Generatordetails> createState() => _GeneratordetailsState();
...@@ -24,8 +37,25 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -24,8 +37,25 @@ class _GeneratordetailsState extends State<Generatordetails> {
context, context,
listen: false, listen: false,
); );
var homeProvider = Provider.of<HomescreenNotifier>(context,listen: false); var homeProvider = Provider.of<HomescreenNotifier>(
details.LoadgeneratorDetailsApifunction(homeProvider,context, "",details.genID); context,
listen: false,
);
if (widget.activityName == "NearByGenerators") {
details.LoadTechniciangeneratorDetailsApifunction(
homeProvider,
context,
"",
widget.generatorId,
);
} else {
details.LoadgeneratorDetailsApifunction(
homeProvider,
context,
"",
details.genID,
);
}
}); });
} }
...@@ -33,9 +63,37 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -33,9 +63,37 @@ class _GeneratordetailsState extends State<Generatordetails> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Generatordetailsprovider>( return Consumer<Generatordetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var sendwidget = Container(
padding: EdgeInsets.only(right: 10.0),
child: InkWell(
onTap: () async {
if (widget.genLocation != null) {
var loc = widget.genLocation?.split(",").toString();
var uri = Uri.parse(
"google.navigation:q=${loc![0]},${loc![1]}&mode=d",
);
if (Platform.isIOS) {
uri = Uri.parse(
"maps://?q=${loc![0]},${loc![1]}&z=10&daddr=${loc![0]},${loc![1]}&dirflg=d",
);
}
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
} else {
throw 'Could not launch ${uri.toString()}';
}
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uri))
}
},
child: Icon(Icons.directions),
),
);
return Scaffold( return Scaffold(
appBar: appbar(context, "Visit Details"), appBar:
widget.activityName == "NearByGenerators"
? appbar2(context, "Generator Details", sendwidget)
: appbar(context, "Generator Details"),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
...@@ -80,7 +138,7 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -80,7 +138,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
if (j == 0) ...[ if (j == 0) ...[
SvgPicture.asset( SvgPicture.asset(
...@@ -90,21 +148,29 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -90,21 +148,29 @@ class _GeneratordetailsState extends State<Generatordetails> {
], ],
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text(textheads[j].toString()),
SizedBox( SizedBox(
// height:45,
width: width:
MediaQuery.of( MediaQuery.of(
context, context,
).size.width * ).size.width *
0.75, 0.75,
child: Text(textheads[j].toString(),maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text( child: Text(
textSubheads[j], textSubheads[j],
maxLines: 2, maxLines: 2,
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF818181), color: Color(0xFF818181),
), ),
...@@ -164,7 +230,7 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -164,7 +230,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -173,21 +239,21 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -173,21 +239,21 @@ class _GeneratordetailsState extends State<Generatordetails> {
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text(textheads[j].toString()), Text(textheads[j].toString()),
SizedBox( SizedBox(
// height:45, // height:45,
width: width:
MediaQuery.of( MediaQuery.of(
context, context,
).size.width * ).size.width *
0.8, 0.8,
child: Text( child: Text(
textSubheads[j], textSubheads[j],
maxLines: 2, maxLines: 2,
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF818181), color: Color(0xFF818181),
), ),
...@@ -209,7 +275,6 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -209,7 +275,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
), ),
), ),
SizedBox(height: 75), SizedBox(height: 75),
], ],
), ),
...@@ -219,8 +284,10 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -219,8 +284,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => Complainthistory(),)); Navigator.push(
context,
MaterialPageRoute(builder: (context) => Complainthistory()),
);
}, },
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
...@@ -242,7 +309,7 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -242,7 +309,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
), ),
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
); );
}, },
); );
......
...@@ -23,28 +23,203 @@ class _NearbygeneratorsState extends State<Nearbygenerators> { ...@@ -23,28 +23,203 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
},); },);
} }
Future infoDialogue(BuildContext context) async {
return await showDialog(
context: context,
builder:
(context) => Consumer<Nearbygeneratorsprovider>(
builder: (context,provider,child) {
return StatefulBuilder(
builder:
(context, setState) =>
AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
title: Column(
children: [
Row(
children: [
Expanded(
child: Align(
alignment: Alignment.topLeft,
child: Text(
'Filter',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
),
),
InkWell(
child: Icon(Icons.close),
onTap: () {
setState(() {
provider.currentValue = 0.0;
provider.selectedItem = "Active";
});
Navigator.pop(context);
},
),
],
),
Divider(
color: Colors.grey,
thickness: 1.0,
height: 0.0,
),
],
),
content: Container(
height: 230,
child: Column(
children: [
Row(
children: [
Text(
"Radius",
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
Spacer(),
Text(
'${provider.currentValue.toStringAsFixed(2)} KM',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
],
),
Slider(
value: provider.currentValue,
max: 100,
divisions: 100,
label: provider.currentValue.toStringAsFixed(2),
inactiveColor: Colors.grey,
onChanged: (value) {
provider.currentValue = value;
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
}, Duration(milliseconds: 500));
},
),
Text(
'Status',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
Container(
width: 200, // Set the desired width here
child: DropdownButton<String>(
value: provider.selectedItem,
items:
<String>[
'Active',
'Inactive',
'Suspense',
].map<DropdownMenuItem<String>>((String value,) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (String? newValue) {
setState(() {
provider.selectedItem = newValue!;
});
},
icon: Icon(
Icons.keyboard_arrow_down,
),
iconSize: 12,
iconEnabledColor:
Colors
.black, // Remove the default dropdown icon
),
),
SizedBox(height: 30.0),
Container(
child: InkWell(
onTap: () {
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
Navigator.pop(context);
}, Duration(milliseconds: 500));
},
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(
left: 15.0,
right: 15.0,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
),
child: Text(
"Search",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Nexa',
fontWeight: FontWeight.w700,
),
),
),
),
),
],
),
),
),
);
}),
barrierDismissible: true,
) ??
false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
debugPrint("Nearbygenerators widget rebuilt");
return Consumer<Nearbygeneratorsprovider>(builder: (context, provider, child) { return Consumer<Nearbygeneratorsprovider>(builder: (context, provider, child) {
var sendWidget = GestureDetector(
onTap: () {
infoDialogue(context);
},
child: InkWell(
child: Icon(Icons.filter_alt_outlined),
));
return Scaffold( return Scaffold(
appBar: appbar(context, "Nearby Generators"), appBar: appbar2(context, "Nearby Generators",sendWidget),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child:Column( child:Column(
children: [ children: [
Expanded( ClipRRect(
child: ClipRRect( // Apply border radius using ClipRRect
// Apply border radius using ClipRRect borderRadius: BorderRadius.only(
borderRadius: BorderRadius.only( topLeft: Radius.circular(30.0),
topLeft: Radius.circular(30.0), topRight: Radius.circular(30.0),
topRight: Radius.circular(30.0), ),
), // padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20), child: Container(
height: MediaQuery.of(context).size.height,
child: Stack(children: [ child: Stack(children: [
GoogleMap( GoogleMap(
myLocationEnabled: true, myLocationEnabled: true,
zoomGesturesEnabled: true, zoomGesturesEnabled: true,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: provider.startLocation, target: provider.startLocation,
zoom: 14.0, zoom: 14.0,
......
...@@ -4,6 +4,7 @@ import 'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart'; ...@@ -4,6 +4,7 @@ import 'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/screens/serviceEngineer/MonthlyCollection.dart'; import 'package:generp/screens/serviceEngineer/MonthlyCollection.dart';
import 'package:generp/screens/serviceEngineer/NearbyGenerators.dart';
import 'package:generp/screens/serviceEngineer/PCWallet.dart'; import 'package:generp/screens/serviceEngineer/PCWallet.dart';
import 'package:generp/screens/serviceEngineer/PendingComplaints.dart'; import 'package:generp/screens/serviceEngineer/PendingComplaints.dart';
import 'package:generp/screens/serviceEngineer/TodayMontlyVisists.dart'; import 'package:generp/screens/serviceEngineer/TodayMontlyVisists.dart';
...@@ -261,27 +262,32 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -261,27 +262,32 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
}, },
), ),
), ),
Container( InkResponse(
height: 60, onTap: () {
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), Navigator.push(context, MaterialPageRoute(builder: (context) => Nearbygenerators(),));
decoration: BoxDecoration( },
color: Colors.white, child: Container(
borderRadius: BorderRadius.circular(20), height: 60,
), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/find_generator.svg", "assets/svg/find_generator.svg",
),
), ),
), Expanded(
Expanded( flex: 4,
flex: 4, child: Text("Find Nearby Generators"),
child: Text("Find Nearby Generators"), ),
), ],
], ),
), ),
), ),
], ],
......
...@@ -691,6 +691,7 @@ class ApiCalling { ...@@ -691,6 +691,7 @@ class ApiCalling {
}; };
final res = await post(data, technicianNearbyGeneratorsUrl, {}); final res = await post(data, technicianNearbyGeneratorsUrl, {});
if (res != null) { if (res != null) {
print(data);
debugPrint(res.body); debugPrint(res.body);
return NearbyGeneratorsResponse.fromJson(jsonDecode(res.body)); return NearbyGeneratorsResponse.fromJson(jsonDecode(res.body));
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment