I am using Getx package in flutter and using Firestore to store my data. here is my main.dart
GetPage(
name: '/ApartmentDetailedPage/:propertyName/:reraId',
page: () => ApartmentAdviserDetailedPage(),
transition: Transition.cupertino,
transitionDuration: const Duration(seconds: 1)),
while i was giving the parameters as above and in the next page accessing the data then on clicking the property i was getting null operator used on a null value, below is the code of my other file.
final properties = snapshot.data!.docs
.map((doc) {
final data = doc.data() as Map<String, dynamic>;
final propertyType = data['Property Type'] ?? '';
final propertyName = data['Property Title'] ?? '';
final reraId = data['Rera Id'] ?? '';
if (propertyType == 'Apartment') {
return GestureDetector(
onTap: () {
Get.toNamed('/ApartmentDetailedPage/$propertyName/$reraId',
arguments: {
'propertyName': data['Property Title'] ?? '',
'propertyAddress': data['Property Address'] ?? '',
'propertyType': data['Property Type'] ?? '',
I think before i was getting the data into my propertyName and reraId i am using it.But while i was making the changes as follows, my main.dart
GetPage(
name: '/ApartmentDetailedPage',
page: () => ApartmentAdviserDetailedPage(),
transition: Transition.cupertino,
transitionDuration: const Duration(seconds: 1)),
and the other page as
final properties = snapshot.data!.docs
.map((doc) {
final data = doc.data() as Map<String, dynamic>;
final propertyType = data['Property Type'] ?? '';
final propertyName = data['Property Title'] ?? '';
final reraId = data['Rera Id'] ?? '';
if (propertyType == 'Apartment') {
return GestureDetector(
onTap: () {
Get.toNamed('/ApartmentDetailedPage',
arguments: {
'propertyName': data['Property Title'] ?? '',
'propertyAddress': data['Property Address'] ?? '',
then there is no issue arising, and the url is domain.Name/ApartmentDetailedPage