booleanbites / houzi-support

Support forum repo for issues & bugs reported for Houzi Flutter App.
4 stars 0 forks source link

price and icon issues #47

Closed avitor12 closed 1 year ago

avitor12 commented 1 year ago

hi. how i change the price format to show in my country money ₪ israeli shekel? Screenshot 2023-03-31 055547

another issue. the icon of the app is not showing Screenshot 2023-03-31 055759

thanks

avitor12 commented 1 year ago

have this code here

what need to change?

  @override
  PriceFormatterHook getPriceFormatterHook() {
    PriceFormatterHook priceFormatterHook = (String propertyPrice, String firstPrice) {
      // Define your own method here and return the formatted string
      return null;
    };

    return priceFormatterHook;
  }

  @override
  CompactPriceFormatterHook getCompactPriceFormatterHook() {
    /// If you want to format price on Property Card use this method.
    /// If you want to use Houzi pre define formatter than return null
    ///
    ///
    CompactPriceFormatterHook compactPriceFormatterHook = (String inputPrice) {
      // Define your own method here and return the formatted string
      return null;
    };

    return compactPriceFormatterHook;
  }

  @override
  TextFormFieldCustomizationHook getTextFormFieldCustomizationHook() {
    TextFormFieldCustomizationHook textFormFieldCustomizationHook = () {
      Map<String, dynamic> textFormFieldCustomizationMap = {
        'labelTextStyle' : null,
        'hintTextStyle' : null,
        'additionalHintTextStyle' : null,
        'backgroundColor' : null,
        'focusedBorderColor' : null,
        'hideBorder' : null,
        'borderRadius' : null,
      };

      return textFormFieldCustomizationMap;
    };

    return textFormFieldCustomizationHook;
  }
AdilSoomro commented 1 year ago

For showing custom text on the map pin, checkout the documentation for Custom Map Pin:

https://houzi-docs.booleanbites.com/hooks-widgets/set_custom_marker

It is returning text via MapMarkerData

MapMarkerData markerData = MapMarkerData(
          text: article.getCompactPriceForMap(),
          backgroundColor: Colors.red,
          textColor: Colors.white
      );

Return your desired pin text in text parameter, ie

text: '₪${article.getCompactPriceForMap()}'

This will show price as ₪100K

For icon, please follow the icon guide. Checkout the adaptive icon section too. https://houzi-docs.booleanbites.com/app-setup/change_app_icon.

avitor12 commented 1 year ago

where i insert this text? can you be more detiled bro?. im not so programmer thanks

avitor12 commented 1 year ago

and. i want show the price in my language Hebrew without $ or k i want it with my symbol only full price 1000₪

AdilSoomro commented 1 year ago

That $ isn't dollar symbol, instead it is a programming keyword to concatenate two strings.

You need to look for getCustomMarkerHook() in hooks_v2.dart method. At least try to read documentation please.

avitor12 commented 1 year ago

i read bro. all night spend for it. what can i do. im not so good . please help me. more detiled

AdilSoomro commented 1 year ago

Have you set the price symbol on your website theme options? We use the same price symbol and its place, that you've on your website.

Please confirm your website address as well.

avitor12 commented 1 year ago

hi. i'm sory bro but i can't find how to make the price to show like i asked for. i don't want share my site here but if tou like to help me by connecting me with anydesk i can show you my site and purchase cod of houzez and houzi. if not. i tank you anyway. all the best

avitor12 commented 1 year ago

get error on build

CustomMarkerHook markerIconHook = (BuildContext context, Article article) {
  /// If you want to set the default Pin Point marker return null
  /// else return the title, background, title-color and an optional text style
  ///
  MapMarkerData markerData = MapMarkerData(
      text: '₪${article.getCompactPriceForMap()}'
      backgroundColor: Colors.red,
      textColor: Colors.white
  );
  return markerData;
  //return null; //if you don't want to show custom map pin, and want to show default GoogleMaps map pin.
};

return markerIconHook;

}

@override

Building with sound null safety

Running Gradle task 'assembleRelease'...
lib/hooks_v2.dart:474:11: Error: Expected ',' before this. backgroundColor: Colors.red, ^^^^^^^^^^^^^^^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

BUILD FAILED in 36s Running Gradle task 'assembleRelease'... 37.4s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1

AdilSoomro commented 1 year ago

Please add comma after this line:

text: '₪${article.getCompactPriceForMap()}',

It is better to first learn dart and flutter before doing any programming in a pre built project.

avitor12 commented 1 year ago

great bro. works thank you for awesome support

only one question. what need to change to show the price full. without K I TRY SOMUCH but can't make it work

here is the code.

HooksV2.dart return markerIconHook; } @override PriceFormatterHook getPriceFormatterHook() { PriceFormatterHook priceFormatterHook = (String propertyPrice, String firstPrice) { // Define your own method here and return the formatted string return null; }; return priceFormatterHook; } @override CompactPriceFormatterHook getCompactPriceFormatterHook() { /// If you want to format price on Property Card use this method. /// If you want to use Houzi pre define formatter than return null /// /// CompactPriceFormatterHook compactPriceFormatterHook = (String inputPrice) { // Define your own method here and return the formatted string return null; }; return compactPriceFormatterHook;

thanks again

AdilSoomro commented 1 year ago

There're two steps to achieve this, first is to add a function to Article class, open the file here:

PROJECT_HOME/packages/houzi_package/lib/models/article.dart

and add following function to the end of the class:

  String? _formattedFullPrice;
  String getListingPrice() {
    if (_formattedFullPrice != null) {
      return _formattedFullPrice!;
    }
    String _firstPrice = "";
    String _propertyPrice = "";
    if(propertyDetailsMap!.containsKey(FIRST_PRICE)){
      _firstPrice = propertyDetailsMap![FIRST_PRICE]!;
    }
    if(propertyDetailsMap!.containsKey(PRICE)){
      _propertyPrice = propertyDetailsMap![PRICE]!;
    }
    String tempPrice = UtilityMethods.priceFormatter(_propertyPrice, _firstPrice);
    _formattedFullPrice = tempPrice;
    return tempPrice;
  }

Please keep in mind, you need to add this to the end of the class, not the end of file. End of class means, inside the closing } bracket of the class.

Now in your hooks_v2, return following line as title:

text: getListingPrice(),

Please please keep in mind this method appends your currency symbol automatically that you've added on website.

avitor12 commented 1 year ago

Running Gradle task 'assembleRelease'...
Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Errors limit exceeded. To receive all errors set com.sun.xml.bind logger to FINEST level. Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> lib/hooks_v2.dart:473:17: Error: The method 'getListingPrice' isn't defined for the class 'HooksV2'.

FAILURE: Build failed with an exception.

BUILD FAILED in 37s Running Gradle task 'assembleRelease'... 38.2s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1

avitor12 commented 1 year ago

i'm so bad bro sorrrry

} String getCompactFirstPrice() { if (_compactFirstPrice != null) { return _compactFirstPrice!; } String _propertyFirstPrice = ""; if (propertyDetailsMap!.containsKey(FIRST_PRICE)) { String tempPrice = propertyDetailsMap![FIRST_PRICE]!; if (tempPrice != null && tempPrice.isNotEmpty) { _propertyFirstPrice = UtilityMethods.makePriceCompact(tempPrice); } } _compactFirstPrice = _propertyFirstPrice; return _propertyFirstPrice; } String getCompactSecondPrice() { if (_compactSecondPrice != null) { return _compactSecondPrice!; } String _secondPrice = ""; if(propertyDetailsMap!.containsKey(SECOND_PRICE)){ String tempPrice = propertyDetailsMap![SECOND_PRICE]!; if(tempPrice != null && tempPrice.isNotEmpty){ _secondPrice = UtilityMethods.makePriceCompact(tempPrice); } } _compactSecondPrice = _secondPrice; return _secondPrice; } String getCompactPriceForMap() { if (_compactPriceForMap != null) { return _compactSecondPrice!; }

String _firstPrice = "";
String _propertyPrice = "";
if(propertyDetailsMap!.containsKey(FIRST_PRICE)){
  _firstPrice = propertyDetailsMap![FIRST_PRICE]!;
}
if(propertyDetailsMap!.containsKey(PRICE)){
  _propertyPrice = propertyDetailsMap![PRICE]!;
}

String tempPrice = (_firstPrice.isNotEmpty) ? _firstPrice : _propertyPrice;
if(tempPrice.isNotEmpty){
  tempPrice = UtilityMethods.makePriceCompact(tempPrice, priceOnly: true);
}
_compactSecondPrice = tempPrice;
return tempPrice;

}

String? _formattedFullPrice; String getListingPrice() { if (_formattedFullPrice != null) { return _formattedFullPrice!; } String _firstPrice = ""; String _propertyPrice = ""; if(propertyDetailsMap!.containsKey(FIRST_PRICE)){ _firstPrice = propertyDetailsMap![FIRST_PRICE]!; } if(propertyDetailsMap!.containsKey(PRICE)){ _propertyPrice = propertyDetailsMap![PRICE]!; } String tempPrice = UtilityMethods.priceFormatter(_propertyPrice, _firstPrice); _formattedFullPrice = tempPrice; return tempPrice; }

}

AdilSoomro commented 1 year ago

Try doing this way:

text: article.getListingPrice(),
avitor12 commented 1 year ago

coooooooolll this one do the trick thanks a loot bro. you are awesome.

AdilSoomro commented 1 year ago

Thanks for confirming.

Leave a nice review on CodeCanyon for us.

Marking this as closed.

avitor12 commented 1 year ago

Screenshot 2023-03-31 230320 and here ? in bottom

avitor12 commented 1 year ago

Screenshot 2023-03-31 230538

AdilSoomro commented 1 year ago

You seem to be testing on tablet mode, when it will show on mobile screens, the full price will overlap on next property type label. That's why it is suggested to keep it shorter and compact.

avitor12 commented 1 year ago

im on mobile

AdilSoomro commented 1 year ago

Keep in mind, android has lot of different screen mobile, each mobile has different screen settings. So keep the different screen sizes in mind as well.

avitor12 commented 1 year ago

so. can't be change ?

AdilSoomro commented 1 year ago

It can be changed, it is not suggested though.

Go to

Project_HOME > lib > hooks_v2.dart.

Look for the getCompactPriceFormatterHook() function.

And return full price as below:

static getCompactPriceFormatterHook() {
    CompactPriceFormatterHook compactPriceFormatterHook = (String inputPrice) {
      // Define your own method here and return the formatted string
      return UtilityMethods.priceFormatter(inputPrice, inputPrice);
    };

    return compactPriceFormatterHook;

}
avitor12 commented 1 year ago
return markerIconHook;

}

@override PriceFormatterHook getPriceFormatterHook() { PriceFormatterHook priceFormatterHook = (String propertyPrice, String firstPrice) { // Define your own method here and return the formatted string return null; };

return priceFormatterHook;

}

@override CompactPriceFormatterHook getCompactPriceFormatterHook() { /// If you want to format price on Property Card use this method. /// If you want to use Houzi pre define formatter than return null /// /// static getCompactPriceFormatterHook() { CompactPriceFormatterHook compactPriceFormatterHook = (String inputPrice) { // Define your own method here and return the formatted string return UtilityMethods.priceFormatter(inputPrice, inputPrice); };

  return compactPriceFormatterHook;

}

@override TextFormFieldCustomizationHook getTextFormFieldCustomizationHook() { TextFormFieldCustomizationHook textFormFieldCustomizationHook = () { Map<String, dynamic> textFormFieldCustomizationMap = { 'labelTextStyle' : null,


lib/hooks_v2.dart:40:42: Error: Can't find '}' to match '{'. class HooksV2 implements HooksV2Interface{ ^ lib/hooks_v2.dart:40:7: Error: The non-abstract class 'HooksV2' is missing implementations for these members:

class HooksV2 implements HooksV2Interface{ ^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:44:30: Context: 'HooksV2Interface.getCustomSegmentedControlHook' is defined here. CustomSegmentedControlHook getCustomSegmentedControlHook(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:45:20: Context: 'HooksV2Interface.getDrawerHeaderHook' is defined here. DrawerHeaderHook getDrawerHeaderHook(); ^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:46:17: Context: 'HooksV2Interface.getHidePriceHook' is defined here. HidePriceHook getHidePriceHook(); ^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:42:34: Context: 'HooksV2Interface.getTextFormFieldCustomizationHook' is defined here. TextFormFieldCustomizationHook getTextFormFieldCustomizationHook(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:43:27: Context: 'HooksV2Interface.getTextFormFieldWidgetHook' is defined here. TextFormFieldWidgetHook getTextFormFieldWidgetHook(); ^^^^^^^^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:47:17: Context: 'HooksV2Interface.hideEmptyTerm' is defined here. HideEmptyTerm hideEmptyTerm(); ^^^^^^^^^^^^^ lib/hooks_v2.dart:500:5: Error: Can't have modifier 'static' here. Try removing 'static'. static getCompactPriceFormatterHook() { ^^^^^^ lib/hooks_v2.dart:495:29: Error: A non-null value must be returned since the return type 'String? Function(String)' doesn't allow null. CompactPriceFormatterHook getCompactPriceFormatterHook() { ^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

BUILD FAILED in 50s Running Gradle task 'assembleRelease'... 51.3s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1

AdilSoomro commented 1 year ago

You are missing one closing bracket, carefully checkout your code.

avitor12 commented 1 year ago

HI bro i was on this all night and can't find whats wrong. this is all code

import 'package:flutter/material.dart'; import 'package:houzi_package/common/constants.dart'; import 'package:houzi_package/dataProvider/locale_provider.dart'; import 'package:houzi_package/files/app_preferences/app_preferences.dart'; import 'package:houzi_package/files/configurations/app_configurations.dart'; import 'package:houzi_package/files/generic_methods/utility_methods.dart'; import 'package:houzi_package/files/hive_storage_files/hive_storage_manager.dart'; import 'package:houzi_package/houzi_main.dart'; import 'package:houzi_package/interfaces/hooks_v2_interface.dart'; import 'package:houzi_package/l10n/l10n.dart'; import 'package:houzi_package/models/article.dart'; import 'package:houzi_package/models/drawer_menu_item.dart'; import 'package:houzi_package/models/realtor_model.dart'; import 'package:houzi_package/pages/crm_pages/crm_activities/activities_from_board.dart'; import 'package:houzi_package/pages/crm_pages/crm_deals/deals_from_board.dart'; import 'package:houzi_package/pages/crm_pages/crm_inquiry/inquiries_from_board.dart'; import 'package:houzi_package/pages/crm_pages/crm_leads/leads_from_board.dart'; import 'package:houzi_package/pages/home_page_screens/home_elegant_related/related_widgets/home_elegant_sliver_app_bar.dart'; import 'package:houzi_package/pages/home_page_screens/parent_home_related/home_screen_widgets/home_screen_drawer_widgets/home_screen_drawer_widget.dart'; import 'package:houzi_package/pages/home_page_screens/parent_home_related/home_screen_widgets/home_screen_realtors_related_widgets/home_screen_realtors_list_widget.dart'; import 'package:houzi_package/pages/home_page_screens/parent_home_related/home_screen_widgets/home_screen_sliver_app_bar_widgets/default_right_bar_widget.dart'; import 'package:houzi_package/pages/home_screen_drawer_menu_pages/all_agents.dart'; import 'package:houzi_package/pages/home_screen_drawer_menu_pages/settings_page.dart'; import 'package:houzi_package/pages/home_screen_drawer_menu_pages/user_related/phone_sign_in_widgets/user_get_phone_number.dart'; import 'package:houzi_package/pages/home_screen_drawer_menu_pages/user_related/user_profile.dart'; import 'package:houzi_package/pages/map_view.dart'; import 'package:houzi_package/pages/property_details_related_pages/pd_widgets_listing.dart'; import 'package:houzi_package/widgets/article_box_widgets/article_box_design.dart'; import 'package:houzi_package/widgets/explore_by_type_design_widgets/explore_by_type_design.dart'; import 'package:houzi_package/widgets/filter_page_widgets/term_picker_related/term_picker.dart'; import 'package:houzi_package/widgets/generic_text_field_widgets/text_field_widget.dart'; import 'package:houzi_package/pages/property_details_related_pages/bottom_buttons_action_bar.dart'; import 'package:houzi_package/pages/property_details_related_pages/pd_widgets_listing.dart'; import 'package:houzi_package/widgets/article_box_widgets/article_box_design.dart'; import 'package:houzi_package/widgets/custom_segment_widget.dart'; import 'package:houzi_package/widgets/explore_by_type_design_widgets/explore_by_type_design.dart'; import 'package:houzi_package/widgets/generic_text_field_widgets/text_field_widget.dart'; import 'package:material_segmented_control/material_segmented_control.dart';

class HooksV2 implements HooksV2Interface {

@override Map<String, dynamic> getHeaderMap() { Map<String, dynamic> map = { "app-secret": "89423f168754", // "secret_key": "", }; return map; }

@override Map<String, dynamic> getPropertyDetailPageIconsMap() { Map<String, dynamic> _iconMap = { // "Air Conditioning": Icons.ac_unit_outlined, };

return _iconMap;

}

@override Map<String, dynamic> getElegantHomeTermsIconMap() { Map<String, dynamic> _iconMap = { // "for-rent": Icons.vpn_key_outlined, };

return _iconMap;

}

@override DrawerHook getDrawerItems() { DrawerHook drawerHook = (BuildContext context) { DrawerItem drawerItem = DrawerItem( sectionType: "hook", title: "check", checkLogin: false, enable: true, icon: Icons.real_estate_agent_outlined, onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => AllAgents(), ), ); }, insertAt: 3, );

  DrawerItem crmExpandedDrawerItem = DrawerItem(
      sectionType: "hook",
      title: "CRM Dashboard",
      checkLogin: false,
      enable: true,
      icon: Icons.dashboard_outlined,
      insertAt: 14,
      expansionTileChildren: [
        DrawerItem(
          sectionType: "hook",
          title: "Activities",
          checkLogin: true,
          enable: true,
          icon: Icons.article_outlined,
          onTap: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => ActivitiesFromBoard(),
              ),
            );
          },
        ),
        DrawerItem(
          sectionType: "hook",
          title: "Inquiries",
          checkLogin: true,
          enable: true,
          icon: Icons.question_answer,
          onTap: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => InquiriesFromBoard(),
              ),
            );
          },
        ),
        DrawerItem(
          sectionType: "hook",
          title: "Deals",
          checkLogin: true,
          enable: true,
          icon: Icons.app_registration_rounded,
          onTap: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => DealsFromBoard(),
              ),
            );
          },
        ),
        DrawerItem(
          sectionType: "hook",
          title: "Leads",
          checkLogin: true,
          enable: true,
          icon: Icons.trending_up,
          onTap: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => LeadsFromBoard(),
              ),
            );
          },
        )
      ]
  );

  List<dynamic> drawerItemList = [];

  return drawerItemList;
};
return drawerHook;

}

@override FontsHook getFontHook() { FontsHook fontsHook = (Locale locale) { // return "Ubuntu"; // return "Qwitcher_Grypen"; return ""; };

return fontsHook;

}

@override PropertyItemHook getPropertyItemHook() { PropertyItemHook propertyItemHook = (BuildContext context, Article article) { // return Container( // child: Center(child: Text(article.title)), // );

  return null;
};

return propertyItemHook;

}

@override TermItemHook getTermItemHook() { TermItemHook termItemHook = (List metaDataList) { return null; };

return termItemHook;

}

@override AgentItemHook getAgentItemHook() { AgentItemHook agentItemHook = (BuildContext context, Agent item) { // return Container( // height: 100, // padding: EdgeInsets.only( // bottom: 10, // ), // child: Card( // // shape: AppThemePreferences.roundedCorners(AppThemePreferences.realtorPageRoundedCornersRadius), // // elevation: AppThemePreferences.horizontalListForAgentsElevation, // child: InkWell( // borderRadius: const BorderRadius.all(Radius.circular(10)), // onTap: () { // // navigateToRealtorInformationDisplayPage( // // context: context, // // heroId: heroId, // // realtorType: tag == AGENTS_TAG ? AGENT_INFO : AGENCY_INFO, // // realtorInfo: tag == AGENTS_TAG ? {AGENT_DATA : item} : {AGENCY_DATA : item}, // // ); // }, // child: Container( // // width: , // // height: 135, // height: 100, // padding: const EdgeInsets.symmetric(horizontal: 10), // child: Text( // item.title, // textAlign: TextAlign.left, // maxLines: 1, // strutStyle: const StrutStyle(forceStrutHeight: true), // overflow: TextOverflow.ellipsis, // // style: AppThemePreferences().appTheme.homeScreenRealtorTitleTextStyle, // ), // ), // ), // ), // ); return null; }; return agentItemHook; }

@override AgencyItemHook getAgencyItemHook() { AgencyItemHook agencyItemHook = (BuildContext context, Agency agency) { return null; };

return agencyItemHook;

}

@override PropertyPageWidgetsHook getWidgetHook() { PropertyPageWidgetsHook detailsHook = (BuildContext context, Article article, String hook) { if (hook == 'article_images') { return null; } else if (hook == 'article_title') { return null; } else if (hook == 'article_address') { return null; } else if (hook == 'article_status_price') { return null; } else if (hook == 'valued_features') { return null; } else if (hook == 'article_features_details') { return null; } else if (hook == 'article_features') { return null; } else if (hook == 'article_description') { return null; } else if (hook == 'article_address_info') { return null; } else if (hook == 'article_map') { return null; } else if (hook == 'article_floor_plans') { return null; } else if (hook == 'article_multi_units') { return null; } else if (hook == 'article_contact_information') { return null; } else if (hook == 'enquire_info') { return null; } else if (hook == 'setup_tour') { return null; } else if (hook == 'watch_video') { return null; } else if (hook == 'virtual_tour') { return null; } else if (hook == 'article_related_posts') { return null; } else if (hook == 'call_button') { return null; } else if (hook == 'email_button') { return null; } else if (hook == 'whatsapp_button') { return null; } return null; };

return detailsHook;

}

@override LanguageHook getLanguageCodeAndName() { LanguageHook languageHook = () { /// Steps to add Language /// Step 1: /// Make sure to add LANGUAGE-CODE_localization.json is added in asset and path /// must be define in project level pubspec.yaml /// assets/localization/LANGUAGE-CODE_localization.json /// Step 2: /// Make language map by defining language Name and Language code against the keys. /// Step 3: /// Add your language map in the languageList. /// Step 4: /// Run flutter pub get command. ///

  Map<String,dynamic> hebrewLanguageMap = {
    "languageName": "עברית", // Specify your language name
    "languageCode": "he"  // Specify your language code
  };

  Map<String,dynamic> englishLanguageMap = {
    "languageName": "English",
    "languageCode": "en"

}; List languageList = [ hebrewLanguageMap, englishLanguageMap, ];

  return languageList;
};

return languageHook;

}

@override DefaultLanguageCodeHook getDefaultLanguageHook() { DefaultLanguageCodeHook defaultLanguageCodeHook = () { /// Add here your default language code return "he"; };

return defaultLanguageCodeHook;

}

@override DefaultHomePageHook getDefaultHomePageHook() { DefaultHomePageHook defaultHomePageHook = () { /// You can choose your default home for the app /// /// You have four options /// 1: home_0 (Home Carousel) /// 2: home_1 (Home Elegant) /// 3: home_2 (Home Location) /// 4: home_3 (Home Tabbed) /// /// return name of the home you want to make it default return "";

  /// Make it empty if you want to set your default home from HOUZI-BUILDER
  /// e.g return "";
};

return defaultHomePageHook;

}

@override DefaultCountryCodeHook getDefaultCountryCodeHook() { DefaultCountryCodeHook defaultCountryCodeHook = () { /// return 2 Letter ISO Code to make it default country code for phone login return "IL"; };

return defaultCountryCodeHook;

}

@override SettingsHook getSettingsItemHook() { SettingsHook settingsHook = (BuildContext context){ /// /// /// For info about adding Setting item visit below link: /// https://houzi-docs.booleanbites.com/hooks-widgets/add_item_settings/

  List<dynamic> settingsItemHookList = [
    // Add menu item map here
  ];

  return settingsItemHookList;
};

return settingsHook;

}

@override ProfileHook getProfileItemHook() { ProfileHook profileHook = (BuildContext context){ /// /// /// For info about adding Profile item visit below link: /// https://houzi-docs.booleanbites.com/hooks-widgets/add_item_profile/

  List<Widget> profileItemHookList = [
    // Add menu item map here
  ];
  return profileItemHookList;
};
return profileHook;

}

@override HomeRightBarButtonWidgetHook getHomeRightBarButtonWidgetHook() { HomeRightBarButtonWidgetHook homeRightBarButtonWidgetHook = (BuildContext context) { /// /// /// For info about customizing Home Right Bar Button Id Widget visit below link: /// https://houzi-docs.booleanbites.com/hooks-widgets/customize_home_right_bar_button_widget/

  Widget? rightBarButtonHook;
  // Widget rightBarButtonHook = DefaultRightBarButtonIdWidget();

  return rightBarButtonHook;
};

return homeRightBarButtonWidgetHook;

}

@override MarkerTitleHook getMarkerTitleHook() { /// Set title to the marker in MapView /// Instance of Article/Property is provided. You can choose whatever the /// title you want to set, it can be property title, id, price or anything MarkerTitleHook markerTitleHook = (BuildContext context, Article article) { /// If you want to set price as a title, use this piece of code

  String markerTitle = article.title!;
  return markerTitle; // return title here (should be string type)
};

return markerTitleHook;

}

@override MarkerIconHook getMarkerIconHook() { /// For info about how to add custom marker icon go to /// https://houzi-docs.booleanbites.com/hooks-widgets/set_marker_icon/

MarkerIconHook markerIconHook = (BuildContext context, Article article) {
  /// If you want to set the default Pin Point marker return null
  /// else return the path of the image
  ///
  ///
  return null;
};

return markerIconHook;

}

@override CustomMarkerHook getCustomMarkerHook() { /// For info about how to add custom marker go to /// https://houzi-docs.booleanbites.com/hooks-widgets/set_custom_marker/

CustomMarkerHook markerIconHook = (BuildContext context, Article article) {
  /// If you want to set the default Pin Point marker return null
  /// else return the title, background, title-color and an optional text style
  ///
  MapMarkerData markerData = MapMarkerData(
      text: article.getListingPrice(),
      backgroundColor: Colors.blue,
      textColor: Colors.white
  );
  return markerData;
  //return null; //if you don't want to show custom map pin, and want to show default GoogleMaps map pin.
};

return markerIconHook;

}

@override PriceFormatterHook getPriceFormatterHook() { PriceFormatterHook priceFormatterHook = (String propertyPrice, String firstPrice) { // Define your own method here and return the formatted string return null; };

return priceFormatterHook;

}

@override CompactPriceFormatterHook getCompactPriceFormatterHook() { /// If you want to format price on Property Card use this method. /// If you want to use Houzi pre define formatter than return null /// /// static getCompactPriceFormatterHook() { CompactPriceFormatterHook compactPriceFormatterHook = (String inputPrice) { // Define your own method here and return the formatted string return UtilityMethods.priceFormatter(inputPrice, inputPrice); };

  return compactPriceFormatterHook;

}

@override TextFormFieldCustomizationHook getTextFormFieldCustomizationHook() { TextFormFieldCustomizationHook textFormFieldCustomizationHook = () { Map<String, dynamic> textFormFieldCustomizationMap = { 'labelTextStyle' : null, 'hintTextStyle' : null, 'additionalHintTextStyle' : null, 'backgroundColor' : null, 'focusedBorderColor' : null, 'hideBorder' : null, 'borderRadius' : null, };

  return textFormFieldCustomizationMap;
};

return textFormFieldCustomizationHook;

}

@override TextFormFieldWidgetHook getTextFormFieldWidgetHook() { TextFormFieldWidgetHook textFormFieldWidgetHook = ( context, labelText, hintText, additionalHintText, suffixIcon, initialValue, maxLines, readOnly, obscureText, controller, keyboardType, inputFormatters, validator, onSaved, onChanged, onFieldSubmitted, onTap, ) {

  Widget? textFormFieldWidget;
  return textFormFieldWidget;
};

return textFormFieldWidgetHook;

}

@override CustomSegmentedControlHook getCustomSegmentedControlHook() { CustomSegmentedControlHook customSegmentedControlHook = ( BuildContext context, List itemList, int selectionIndex, Function(int) onSegmentChosen, ) { return null; };

return customSegmentedControlHook;

}

@override DrawerHeaderHook getDrawerHeaderHook() { DrawerHeaderHook drawerHeaderHook = ( BuildContext context, String appName, String appIconPath, String? userProfileName, String? userProfileImageUrl, ) {

  Widget? drawerHeaderWidget;

  return drawerHeaderWidget;
};

return drawerHeaderHook;

}

@override HidePriceHook getHidePriceHook() { HidePriceHook hidePriceHook = () { /// Hook to hide price on property item and property details. /// /// Returns a boolean value indicating whether prices should be /// hidden on the property item and property details. /// /// If this function returns true, all prices displayed on the /// property item and property details will be hidden from view. /// ///

  ///
  bool hidePropertyPrice = false;

  // Use isLoggedIn, if you want to show price to logged in users.
  // bool isLoggedIn = HiveStorageManager.isUserLoggedIn();
  // hidePropertyPrice = isLoggedIn ? false : true;

  // Use roles, if you want to show price to certain roles for logged in user.
  // String userRole = HiveStorageManager.getUserRole() ?? "";
  // hidePropertyPrice = (userRole == ROLE_ADMINISTRATOR || userRole == USER_ROLE_HOUZEZ_AGENCY_VALUE) ? false : true;

  return hidePropertyPrice;
};

return hidePriceHook;

} HideEmptyTerm hideEmptyTerm() { /// Hook to decide if we should hide the empty enteries in Terms when showing them in filters. /// /// Terms are added on backend, and there can be lot of terms /// with empty data /// /// If this function returns true, for a Term, the empty enteries /// in that terms will be hidden. /// /// For example, for property_city, you've three cities [New York, Miami, Los Angeles] /// One of the city doesn't have any listing. Meaning you don't have any data in that /// city. So do you want to hide the cities that has zero listings? return true /// when it asks for term 'property_city' /// /// Specially useful for property_area, as it can be filtered out to show only non-empty areas. /// HideEmptyTerm shouldHide = (String termName) { if (termName == 'property_country') { return false; // return true to hide empty countries. } if (termName == 'property_state') { return false; // return true to hide empty states. } if (termName == 'property_city') { return false; //return true to hide empty cities. } if (termName == 'property_area') { return false; //return true to hide empty areas. } if (termName == 'property_type') { return false; //return true to hide empty types, like apartments, villas, shops. } if (termName == 'property_features') { return false; //return true to hide empty features, oven, garden, garage etc.. } if (termName == 'property_label') { return false; //return true to hide empty labels in filters, like hot offer, new. } if (termName == 'property_status') { return false; //return true to hide empty statuses like for-sale, for-rent. } return false; //false shows all. }; return shouldHide; } }

avitor12 commented 1 year ago

this is the error

Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Errors limit exceeded. To receive all errors set com.sun.xml.bind logger to FINEST level. Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> lib/hooks_v2.dart:40:43: Error: Can't find '}' to match '{'. class HooksV2 implements HooksV2Interface { ^ lib/hooks_v2.dart:40:7: Error: The non-abstract class 'HooksV2' is missing implementations for these members:

class HooksV2 implements HooksV2Interface { ^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:44:30: Context: 'HooksV2Interface.getCustomSegmentedControlHook' is defined here. CustomSegmentedControlHook getCustomSegmentedControlHook(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:45:20: Context: 'HooksV2Interface.getDrawerHeaderHook' is defined here. DrawerHeaderHook getDrawerHeaderHook(); ^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:46:17: Context: 'HooksV2Interface.getHidePriceHook' is defined here. HidePriceHook getHidePriceHook(); ^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:42:34: Context: 'HooksV2Interface.getTextFormFieldCustomizationHook' is defined here. TextFormFieldCustomizationHook getTextFormFieldCustomizationHook(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:43:27: Context: 'HooksV2Interface.getTextFormFieldWidgetHook' is defined here. TextFormFieldWidgetHook getTextFormFieldWidgetHook(); ^^^^^^^^^^^^^^^^^^^^^^^^^^ packages/houzi_package/lib/interfaces/hooks_v2_interface.dart:47:17: Context: 'HooksV2Interface.hideEmptyTerm' is defined here. HideEmptyTerm hideEmptyTerm(); ^^^^^^^^^^^^^ lib/hooks_v2.dart:500:5: Error: Can't have modifier 'static' here. Try removing 'static'. static getCompactPriceFormatterHook() { ^^^^^^ lib/hooks_v2.dart:495:29: Error: A non-null value must be returned since the return type 'String? Function(String)' doesn't allow null. CompactPriceFormatterHook getCompactPriceFormatterHook() { ^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

BUILD FAILED in 34s Running Gradle task 'assembleRelease'... 35.6s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1

Screenshot 2023-04-01 103944

AdilSoomro commented 1 year ago

Please learn basic programming. We're not going to teach you basic programming. This is so unfair that we've to tell you small little syntax mistakes.

You've added the solution to file at wrong place. Please check the attached screenshot. This is how your hook should look like.

correct-placement
avitor12 commented 1 year ago

bro. you give me in previews reply code with static that make all the problem. i removed and is works now perfectly thanks for your support