From d1c7ddfec0ca24de09240cdfff2dbe878342a4b4 Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Mon, 17 Jun 2024 11:08:33 +0530 Subject: [PATCH 1/7] Change gender other option --- khelo/assets/locales/app_en.arb | 1 + khelo/lib/domain/extensions/enum_extensions.dart | 2 +- .../ui/flow/settings/edit_profile/edit_profile_screen.dart | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/khelo/assets/locales/app_en.arb b/khelo/assets/locales/app_en.arb index 7c3fce07..c0fcac03 100644 --- a/khelo/assets/locales/app_en.arb +++ b/khelo/assets/locales/app_en.arb @@ -639,6 +639,7 @@ "edit_profile_bowling_style_placeholder": "Bowling style", "edit_profile_gender_male_title": "Male", "edit_profile_gender_female_title": "Female", + "edit_profile_gender_prefer_not_to_say_title": "Prefer not to say", "profile_complete_profile_btn_title": "Complete Profile", "profile_complete_your_profile_title": "Complete your profile", diff --git a/khelo/lib/domain/extensions/enum_extensions.dart b/khelo/lib/domain/extensions/enum_extensions.dart index d280c8e2..e98e3932 100644 --- a/khelo/lib/domain/extensions/enum_extensions.dart +++ b/khelo/lib/domain/extensions/enum_extensions.dart @@ -121,7 +121,7 @@ extension UserGenderString on UserGender { case UserGender.female: return context.l10n.edit_profile_gender_female_title; case UserGender.other: - return context.l10n.common_other_title; + return context.l10n.edit_profile_gender_prefer_not_to_say_title; case UserGender.unknown: return ""; } diff --git a/khelo/lib/ui/flow/settings/edit_profile/edit_profile_screen.dart b/khelo/lib/ui/flow/settings/edit_profile/edit_profile_screen.dart index eb28515d..40138104 100644 --- a/khelo/lib/ui/flow/settings/edit_profile/edit_profile_screen.dart +++ b/khelo/lib/ui/flow/settings/edit_profile/edit_profile_screen.dart @@ -118,7 +118,8 @@ class EditProfileScreen extends ConsumerWidget { const SizedBox(height: 8), _textInputField(context, notifier, placeholderText: context.l10n.edit_profile_email_placeholder, - controller: state.emailController), + controller: state.emailController, + keyboardType: TextInputType.emailAddress), const SizedBox(height: 8), _textInputField(context, notifier, placeholderText: context.l10n.common_location_title, @@ -132,10 +133,12 @@ class EditProfileScreen extends ConsumerWidget { EditProfileViewNotifier notifier, { required String placeholderText, required TextEditingController controller, + TextInputType? keyboardType, }) { return AppTextField( controller: controller, onChanged: (value) => notifier.onValueChange(), + keyboardType: keyboardType, style: AppTextStyle.subtitle3 .copyWith(color: context.colorScheme.textPrimary), borderRadius: BorderRadius.circular(12), From 6e1a00dd53132ba5b796f8b831befb167249586d Mon Sep 17 00:00:00 2001 From: Mayank Variya <140152611+cp-mayank@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:10:48 +0530 Subject: [PATCH 2/7] Create inde.md --- docs/inde.md | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 docs/inde.md diff --git a/docs/inde.md b/docs/inde.md new file mode 100644 index 00000000..f0036996 --- /dev/null +++ b/docs/inde.md @@ -0,0 +1,157 @@ +

Privacy Policy

+

Last updated: June 17, 2024

+

This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You.

+

We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy. This Privacy Policy has been created with the help of the Privacy Policy Generator.

+

Interpretation and Definitions

+

Interpretation

+

The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural.

+

Definitions

+

For the purposes of this Privacy Policy:

+ +

Collecting and Using Your Personal Data

+

Types of Data Collected

+

Personal Data

+

While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You. Personally identifiable information may include, but is not limited to:

+ +

Usage Data

+

Usage Data is collected automatically when using the Service.

+

Usage Data may include information such as Your Device's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, unique device identifiers and other diagnostic data.

+

When You access the Service by or through a mobile device, We may collect certain information automatically, including, but not limited to, the type of mobile device You use, Your mobile device unique ID, the IP address of Your mobile device, Your mobile operating system, the type of mobile Internet browser You use, unique device identifiers and other diagnostic data.

+

We may also collect information that Your browser sends whenever You visit our Service or when You access the Service by or through a mobile device.

+

Information Collected while Using the Application

+

While using Our Application, in order to provide features of Our Application, We may collect, with Your prior permission:

+ +

We use this information to provide features of Our Service, to improve and customize Our Service. The information may be uploaded to the Company's servers and/or a Service Provider's server or it may be simply stored on Your device.

+

You can enable or disable access to this information at any time, through Your Device settings.

+

Use of Your Personal Data

+

The Company may use Personal Data for the following purposes:

+ +

We may share Your personal information in the following situations:

+ +

Retention of Your Personal Data

+

The Company will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies.

+

The Company will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period of time, except when this data is used to strengthen the security or to improve the functionality of Our Service, or We are legally obligated to retain this data for longer time periods.

+

Transfer of Your Personal Data

+

Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction.

+

Your consent to this Privacy Policy followed by Your submission of such information represents Your agreement to that transfer.

+

The Company will take all steps reasonably necessary to ensure that Your data is treated securely and in accordance with this Privacy Policy and no transfer of Your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of Your data and other personal information.

+

Delete Your Personal Data

+

You have the right to delete or request that We assist in deleting the Personal Data that We have collected about You.

+

Our Service may give You the ability to delete certain information about You from within the Service.

+

You may update, amend, or delete Your information at any time by signing in to Your Account, if you have one, and visiting the account settings section that allows you to manage Your personal information. You may also contact Us to request access to, correct, or delete any personal information that You have provided to Us.

+

Please note, however, that We may need to retain certain information when we have a legal obligation or lawful basis to do so.

+

Disclosure of Your Personal Data

+

Business Transactions

+

If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy.

+

Law enforcement

+

Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency).

+

Other legal requirements

+

The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:

+ +

Security of Your Personal Data

+

The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security.

+

Children's Privacy

+

Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We take steps to remove that information from Our servers.

+

If We need to rely on consent as a legal basis for processing Your information and Your country requires consent from a parent, We may require Your parent's consent before We collect and use that information.

+

Links to Other Websites

+

Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You visit.

+

We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.

+

Changes to this Privacy Policy

+

We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page.

+

We will let You know via email and/or a prominent notice on Our Service, prior to the change becoming effective and update the "Last updated" date at the top of this Privacy Policy.

+

You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.

+

Contact Us

+

If you have any questions about this Privacy Policy, You can contact us:

+ From d21469427261e67b2d8486bd808c439f74d8f6d3 Mon Sep 17 00:00:00 2001 From: Mayank Variya <140152611+cp-mayank@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:36:25 +0530 Subject: [PATCH 3/7] Rename inde.md to index.md --- docs/{inde.md => index.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{inde.md => index.md} (100%) diff --git a/docs/inde.md b/docs/index.md similarity index 100% rename from docs/inde.md rename to docs/index.md From 49aa039eb6e1344fbe71a0ce046bca994493405a Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Mon, 17 Jun 2024 16:00:39 +0530 Subject: [PATCH 4/7] Add contact support --- .../api/ball_score/ball_score_model.g.dart | 18 +- data/lib/api/innings/inning_model.g.dart | 4 +- data/lib/api/match/match_model.g.dart | 32 +-- khelo/assets/images/ic_about_us.svg | 3 + khelo/assets/images/ic_contact_support.svg | 4 + khelo/assets/images/ic_privacy_policy.svg | 5 + khelo/assets/images/ic_sign_out.svg | 7 + khelo/assets/locales/app_en.arb | 11 + khelo/lib/gen/assets.gen.dart | 16 ++ khelo/lib/ui/app_route.dart | 13 + khelo/lib/ui/flow/profile/profile_screen.dart | 100 ++++++-- .../ui/flow/profile/profile_view_model.dart | 10 + .../support/contact_support_screen.dart | 119 +++++++++ .../support/contact_support_view_model.dart | 38 +++ .../contact_support_view_model.freezed.dart | 230 ++++++++++++++++++ .../flutter/generated_plugin_registrant.cc | 4 + khelo/linux/flutter/generated_plugins.cmake | 1 + .../Flutter/GeneratedPluginRegistrant.swift | 2 + khelo/pubspec.lock | 64 +++++ khelo/pubspec.yaml | 1 + .../flutter/generated_plugin_registrant.cc | 3 + khelo/windows/flutter/generated_plugins.cmake | 1 + 22 files changed, 645 insertions(+), 41 deletions(-) create mode 100644 khelo/assets/images/ic_about_us.svg create mode 100644 khelo/assets/images/ic_contact_support.svg create mode 100644 khelo/assets/images/ic_privacy_policy.svg create mode 100644 khelo/assets/images/ic_sign_out.svg create mode 100644 khelo/lib/ui/flow/settings/support/contact_support_screen.dart create mode 100644 khelo/lib/ui/flow/settings/support/contact_support_view_model.dart create mode 100644 khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart diff --git a/data/lib/api/ball_score/ball_score_model.g.dart b/data/lib/api/ball_score/ball_score_model.g.dart index 4a6540ac..584ec7ab 100644 --- a/data/lib/api/ball_score/ball_score_model.g.dart +++ b/data/lib/api/ball_score/ball_score_model.g.dart @@ -10,15 +10,15 @@ _$BallScoreModelImpl _$$BallScoreModelImplFromJson(Map json) => _$BallScoreModelImpl( id: json['id'] as String?, inning_id: json['inning_id'] as String, - over_number: json['over_number'] as int, - ball_number: json['ball_number'] as int, + over_number: (json['over_number'] as num).toInt(), + ball_number: (json['ball_number'] as num).toInt(), bowler_id: json['bowler_id'] as String, batsman_id: json['batsman_id'] as String, non_striker_id: json['non_striker_id'] as String, - runs_scored: json['runs_scored'] as int, + runs_scored: (json['runs_scored'] as num).toInt(), extras_type: $enumDecodeNullable(_$ExtrasTypeEnumMap, json['extras_type']), - extras_awarded: json['extras_awarded'] as int?, + extras_awarded: (json['extras_awarded'] as num?)?.toInt(), wicket_type: $enumDecodeNullable(_$WicketTypeEnumMap, json['wicket_type']), player_out_id: json['player_out_id'] as String?, @@ -76,9 +76,9 @@ const _$WicketTypeEnumMap = { _$OverStatModelImpl _$$OverStatModelImplFromJson(Map json) => _$OverStatModelImpl( - run: json['run'] as int? ?? 0, - wicket: json['wicket'] as int? ?? 0, - extra: json['extra'] as int? ?? 0, + run: (json['run'] as num?)?.toInt() ?? 0, + wicket: (json['wicket'] as num?)?.toInt() ?? 0, + extra: (json['extra'] as num?)?.toInt() ?? 0, ); Map _$$OverStatModelImplToJson(_$OverStatModelImpl instance) => @@ -91,8 +91,8 @@ Map _$$OverStatModelImplToJson(_$OverStatModelImpl instance) => _$TeamRunStatImpl _$$TeamRunStatImplFromJson(Map json) => _$TeamRunStatImpl( teamName: json['teamName'] as String? ?? "", - run: json['run'] as int? ?? 0, - wicket: json['wicket'] as int? ?? 0, + run: (json['run'] as num?)?.toInt() ?? 0, + wicket: (json['wicket'] as num?)?.toInt() ?? 0, over: (json['over'] as num?)?.toDouble() ?? 0, ); diff --git a/data/lib/api/innings/inning_model.g.dart b/data/lib/api/innings/inning_model.g.dart index 7048effc..174bc158 100644 --- a/data/lib/api/innings/inning_model.g.dart +++ b/data/lib/api/innings/inning_model.g.dart @@ -12,8 +12,8 @@ _$InningModelImpl _$$InningModelImplFromJson(Map json) => match_id: json['match_id'] as String, team_id: json['team_id'] as String, overs: (json['overs'] as num?)?.toDouble() ?? 0, - total_runs: json['total_runs'] as int? ?? 0, - total_wickets: json['total_wickets'] as int? ?? 0, + total_runs: (json['total_runs'] as num?)?.toInt() ?? 0, + total_wickets: (json['total_wickets'] as num?)?.toInt() ?? 0, innings_status: $enumDecodeNullable(_$InningStatusEnumMap, json['innings_status']), ); diff --git a/data/lib/api/match/match_model.g.dart b/data/lib/api/match/match_model.g.dart index 881039d0..1012c665 100644 --- a/data/lib/api/match/match_model.g.dart +++ b/data/lib/api/match/match_model.g.dart @@ -13,18 +13,18 @@ _$MatchModelImpl _$$MatchModelImplFromJson(Map json) => .map((e) => MatchTeamModel.fromJson(e as Map)) .toList(), match_type: $enumDecode(_$MatchTypeEnumMap, json['match_type']), - number_of_over: json['number_of_over'] as int, - over_per_bowler: json['over_per_bowler'] as int, + number_of_over: (json['number_of_over'] as num).toInt(), + over_per_bowler: (json['over_per_bowler'] as num).toInt(), power_play_overs1: (json['power_play_overs1'] as List?) - ?.map((e) => e as int) + ?.map((e) => (e as num).toInt()) .toList() ?? const [], power_play_overs2: (json['power_play_overs2'] as List?) - ?.map((e) => e as int) + ?.map((e) => (e as num).toInt()) .toList() ?? const [], power_play_overs3: (json['power_play_overs3'] as List?) - ?.map((e) => e as int) + ?.map((e) => (e as num).toInt()) .toList() ?? const [], city: json['city'] as String, @@ -118,8 +118,8 @@ _$MatchTeamModelImpl _$$MatchTeamModelImplFromJson(Map json) => captain_id: json['captain_id'] as String?, admin_id: json['admin_id'] as String?, over: (json['over'] as num?)?.toDouble() ?? 0, - run: json['run'] as int? ?? 0, - wicket: json['wicket'] as int? ?? 0, + run: (json['run'] as num?)?.toInt() ?? 0, + wicket: (json['wicket'] as num?)?.toInt() ?? 0, squad: (json['squad'] as List?) ?.map((e) => MatchPlayer.fromJson(e as Map)) .toList() ?? @@ -142,7 +142,7 @@ _$MatchPlayerImpl _$$MatchPlayerImplFromJson(Map json) => _$MatchPlayerImpl( player: UserModel.fromJson(json['player'] as Map), status: $enumDecodeNullable(_$PlayerStatusEnumMap, json['status']), - index: json['index'] as int?, + index: (json['index'] as num?)?.toInt(), ); Map _$$MatchPlayerImplToJson(_$MatchPlayerImpl instance) => @@ -170,16 +170,16 @@ _$AddEditMatchRequestImpl _$$AddEditMatchRequestImplFromJson( .map((e) => AddMatchTeamRequest.fromJson(e as Map)) .toList(), match_type: $enumDecode(_$MatchTypeEnumMap, json['match_type']), - number_of_over: json['number_of_over'] as int, - over_per_bowler: json['over_per_bowler'] as int, + number_of_over: (json['number_of_over'] as num).toInt(), + over_per_bowler: (json['over_per_bowler'] as num).toInt(), power_play_overs1: (json['power_play_overs1'] as List?) - ?.map((e) => e as int) + ?.map((e) => (e as num).toInt()) .toList(), power_play_overs2: (json['power_play_overs2'] as List?) - ?.map((e) => e as int) + ?.map((e) => (e as num).toInt()) .toList(), power_play_overs3: (json['power_play_overs3'] as List?) - ?.map((e) => e as int) + ?.map((e) => (e as num).toInt()) .toList(), city: json['city'] as String, ground: json['ground'] as String, @@ -238,8 +238,8 @@ _$AddMatchTeamRequestImpl _$$AddMatchTeamRequestImplFromJson( captain_id: json['captain_id'] as String?, admin_id: json['admin_id'] as String?, over: (json['over'] as num?)?.toDouble() ?? 0, - run: json['run'] as int? ?? 0, - wicket: json['wicket'] as int? ?? 0, + run: (json['run'] as num?)?.toInt() ?? 0, + wicket: (json['wicket'] as num?)?.toInt() ?? 0, squad: (json['squad'] as List?) ?.map( (e) => MatchPlayerRequest.fromJson(e as Map)) @@ -264,7 +264,7 @@ _$MatchPlayerRequestImpl _$$MatchPlayerRequestImplFromJson( _$MatchPlayerRequestImpl( id: json['id'] as String, status: $enumDecode(_$PlayerStatusEnumMap, json['status']), - index: json['index'] as int?, + index: (json['index'] as num?)?.toInt(), ); Map _$$MatchPlayerRequestImplToJson( diff --git a/khelo/assets/images/ic_about_us.svg b/khelo/assets/images/ic_about_us.svg new file mode 100644 index 00000000..b7bfd23c --- /dev/null +++ b/khelo/assets/images/ic_about_us.svg @@ -0,0 +1,3 @@ + + + diff --git a/khelo/assets/images/ic_contact_support.svg b/khelo/assets/images/ic_contact_support.svg new file mode 100644 index 00000000..2f0b976c --- /dev/null +++ b/khelo/assets/images/ic_contact_support.svg @@ -0,0 +1,4 @@ + + + + diff --git a/khelo/assets/images/ic_privacy_policy.svg b/khelo/assets/images/ic_privacy_policy.svg new file mode 100644 index 00000000..ca0dc588 --- /dev/null +++ b/khelo/assets/images/ic_privacy_policy.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/khelo/assets/images/ic_sign_out.svg b/khelo/assets/images/ic_sign_out.svg new file mode 100644 index 00000000..5a167a63 --- /dev/null +++ b/khelo/assets/images/ic_sign_out.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/khelo/assets/locales/app_en.arb b/khelo/assets/locales/app_en.arb index c0fcac03..3ca0ef3d 100644 --- a/khelo/assets/locales/app_en.arb +++ b/khelo/assets/locales/app_en.arb @@ -16,6 +16,7 @@ "common_yes_title": "Yes", "common_no_title": "No", "common_retry_title": "Retry", + "common_submit_title": "Submit", "common_not_specified_title": "Not Specified", "common_runs_title": "{count, plural, =0{{count} runs} =1{{count} run} other{{count} runs}}", "@common_runs_title": { @@ -641,6 +642,16 @@ "edit_profile_gender_female_title": "Female", "edit_profile_gender_prefer_not_to_say_title": "Prefer not to say", + "profile_settings_title": "Settings", + "profile_setting_privacy_policy_title": "Privacy policy", + + "@_CONTACT_SUPPORT": { + }, + "contact_support_title": "Contact support", + "contact_support_title_text": "Title", + "contact_support_description_title": "Description...", + "contact_support_attachment": "Attachment (if any)", + "profile_complete_profile_btn_title": "Complete Profile", "profile_complete_your_profile_title": "Complete your profile", "profile_complete_profile_description": "Enhance your profile by filling in the remaining details. Let's make it more comprehensive and appealing.", diff --git a/khelo/lib/gen/assets.gen.dart b/khelo/lib/gen/assets.gen.dart index a9992f68..7eb68206 100644 --- a/khelo/lib/gen/assets.gen.dart +++ b/khelo/lib/gen/assets.gen.dart @@ -16,6 +16,9 @@ class $AssetsImagesGen { /// File path: assets/images/bowler.svg String get bowler => 'assets/images/bowler.svg'; + /// File path: assets/images/ic_about_us.svg + String get icAboutUs => 'assets/images/ic_about_us.svg'; + /// File path: assets/images/ic_arrow_down.svg String get icArrowDown => 'assets/images/ic_arrow_down.svg'; @@ -37,6 +40,9 @@ class $AssetsImagesGen { /// File path: assets/images/ic_commentator.svg String get icCommentator => 'assets/images/ic_commentator.svg'; + /// File path: assets/images/ic_contact_support.svg + String get icContactSupport => 'assets/images/ic_contact_support.svg'; + /// File path: assets/images/ic_cricket.svg String get icCricket => 'assets/images/ic_cricket.svg'; @@ -55,6 +61,9 @@ class $AssetsImagesGen { /// File path: assets/images/ic_location.svg String get icLocation => 'assets/images/ic_location.svg'; + /// File path: assets/images/ic_privacy_policy.svg + String get icPrivacyPolicy => 'assets/images/ic_privacy_policy.svg'; + /// File path: assets/images/ic_profile.svg String get icProfile => 'assets/images/ic_profile.svg'; @@ -73,6 +82,9 @@ class $AssetsImagesGen { /// File path: assets/images/ic_search.svg String get icSearch => 'assets/images/ic_search.svg'; + /// File path: assets/images/ic_sign_out.svg + String get icSignOut => 'assets/images/ic_sign_out.svg'; + /// File path: assets/images/ic_stats.svg String get icStats => 'assets/images/ic_stats.svg'; @@ -101,6 +113,7 @@ class $AssetsImagesGen { List get values => [ batsman, bowler, + icAboutUs, icArrowDown, icBatSelected, icBin, @@ -108,18 +121,21 @@ class $AssetsImagesGen { icCamera, icCheck, icCommentator, + icContactSupport, icCricket, icEdit, icGallery, icGroup, icHome, icLocation, + icPrivacyPolicy, icProfile, icProfileThin, icReferee, icRoundedCheck, icScorer, icSearch, + icSignOut, icStats, icTime, icUmpire, diff --git a/khelo/lib/ui/app_route.dart b/khelo/lib/ui/app_route.dart index 79924b36..78135d74 100644 --- a/khelo/lib/ui/app_route.dart +++ b/khelo/lib/ui/app_route.dart @@ -14,6 +14,7 @@ import 'package:khelo/ui/flow/matches/match_detail/match_detail_tab_screen.dart' import 'package:khelo/ui/flow/score_board/add_toss_detail/add_toss_detail_screen.dart'; import 'package:khelo/ui/flow/score_board/score_board_screen.dart'; import 'package:khelo/ui/flow/settings/edit_profile/edit_profile_screen.dart'; +import 'package:khelo/ui/flow/settings/support/contact_support_screen.dart'; import 'package:khelo/ui/flow/sign_in/phone_verification/phone_verification_screen.dart'; import 'package:khelo/ui/flow/team/add_team/add_team_screen.dart'; import 'package:khelo/ui/flow/team/add_team_member/add_team_member_screen.dart'; @@ -25,6 +26,7 @@ import 'flow/sign_in/sign_in_with_phone/sign_in_with_phone_screen.dart'; class AppRoute { static const pathPhoneNumberVerification = '/phone-number-verification'; static const pathEditProfile = '/edit-profile'; + static const pathContactSupport = "/contact-support"; static const pathAddTeamMember = '/add-team-member'; static const pathAddTeam = '/add-team'; static const pathPowerPlay = '/power-play'; @@ -214,6 +216,9 @@ class AppRoute { pathEditProfile, builder: (_) => EditProfileScreen(isToCreateAccount: isToCreateAccount)); + static AppRoute contactSupport() => AppRoute(pathContactSupport, + builder: (_) => const ContactSupportScreen()); + static AppRoute teamDetail({required String teamId}) => AppRoute(pathTeamDetail, builder: (_) => TeamDetailScreen(teamId: teamId)); @@ -241,6 +246,14 @@ class AppRoute { : state.widget(context); }, ), + GoRoute( + path: pathContactSupport, + builder: (context, state) { + return state.extra == null + ? const ContactSupportScreen() + : state.widget(context); + }, + ), phoneLogin.goRoute(), GoRoute( path: pathScoreBoard, diff --git a/khelo/lib/ui/flow/profile/profile_screen.dart b/khelo/lib/ui/flow/profile/profile_screen.dart index bcce154f..643580f0 100644 --- a/khelo/lib/ui/flow/profile/profile_screen.dart +++ b/khelo/lib/ui/flow/profile/profile_screen.dart @@ -1,7 +1,9 @@ import 'package:data/api/user/user_models.dart'; import 'package:data/storage/app_preferences.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:khelo/components/app_page.dart'; import 'package:khelo/components/confirmation_dialog.dart'; import 'package:khelo/components/error_snackbar.dart'; @@ -14,6 +16,8 @@ import 'package:style/button/primary_button.dart'; import 'package:style/extensions/context_extensions.dart'; import 'package:style/text/app_text_style.dart'; +import '../../../gen/assets.gen.dart'; + class ProfileScreen extends ConsumerWidget { const ProfileScreen({super.key}); @@ -26,20 +30,6 @@ class ProfileScreen extends ConsumerWidget { _observeUserSession(context, ref); return AppPage( title: context.l10n.tab_profile_title, - actions: [ - TextButton( - onPressed: () => showConfirmationDialog(context, - title: context.l10n.common_sign_out_title, - message: context.l10n.alert_confirm_default_message( - context.l10n.common_sign_out_title.toLowerCase()), - confirmBtnText: context.l10n.common_sign_out_title, - onConfirm: notifier.onSignOutTap), - child: Text( - context.l10n.common_sign_out_title, - style: AppTextStyle.button - .copyWith(color: context.colorScheme.alert), - )) - ], body: Builder( builder: (context) { return ListView( @@ -51,6 +41,14 @@ class ProfileScreen extends ConsumerWidget { const SizedBox(height: 24), _inCompleteProfileView(context, state.currentUser!) ], + const SizedBox(height: 24), + Text( + context.l10n.profile_settings_title, + style: AppTextStyle.header4 + .copyWith(color: context.colorScheme.textPrimary), + ), + const SizedBox(height: 16), + _settingsView(context, notifier), ], ); }, @@ -123,6 +121,80 @@ class ProfileScreen extends ConsumerWidget { } } + Widget _settingsView( + BuildContext context, + ProfileViewNotifier notifier, + ) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all(color: context.colorScheme.outline), + ), + child: Column( + children: [ + _settingItem( + context, + icon: Assets.images.icContactSupport, + title: context.l10n.contact_support_title, + onTap: () => AppRoute.contactSupport().push(context), + ), + _settingItem( + context, + icon: Assets.images.icPrivacyPolicy, + title: context.l10n.profile_setting_privacy_policy_title, + onTap: () => notifier.onPrivacyPolicy( + "https://github.com/canopas/khelo/docs/index.md"), + ), + _settingItem( + context, + icon: Assets.images.icSignOut, + color: context.colorScheme.alert, + title: context.l10n.common_sign_out_title, + onTap: () { + showConfirmationDialog(context, + title: context.l10n.common_sign_out_title, + message: context.l10n.alert_confirm_default_message( + context.l10n.common_sign_out_title.toLowerCase()), + confirmBtnText: context.l10n.common_sign_out_title, + onConfirm: notifier.onSignOutTap); + }, + ), + ], + ), + ); + } + + Widget _settingItem( + BuildContext context, { + required String icon, + Color? color, + required String title, + required Function() onTap, + }) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 16.0), + child: OnTapScale( + onTap: onTap, + child: Row( + children: [ + SvgPicture.asset( + icon, + colorFilter: ColorFilter.mode( + color ?? context.colorScheme.textPrimary, BlendMode.srcATop), + ), + const SizedBox(width: 16), + Text( + title, + style: AppTextStyle.subtitle2 + .copyWith(color: color ?? context.colorScheme.textPrimary), + ), + ], + ), + ), + ); + } + void _observeActionError(BuildContext context, WidgetRef ref) { ref.listen(profileStateProvider.select((value) => value.actionError), (previous, next) { diff --git a/khelo/lib/ui/flow/profile/profile_view_model.dart b/khelo/lib/ui/flow/profile/profile_view_model.dart index af45fe9b..94f9b277 100644 --- a/khelo/lib/ui/flow/profile/profile_view_model.dart +++ b/khelo/lib/ui/flow/profile/profile_view_model.dart @@ -4,6 +4,7 @@ import 'package:data/storage/app_preferences.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:url_launcher/url_launcher.dart'; part 'profile_view_model.freezed.dart'; @@ -37,6 +38,15 @@ class ProfileViewNotifier extends StateNotifier { debugPrint("ProfileViewNotifier: error while sign Out -> $e"); } } + + void onPrivacyPolicy(String path) async { + try { + final targetUrl = Uri.parse(path); + await launchUrl(targetUrl, mode: LaunchMode.externalApplication); + } catch (error) { + state = state.copyWith(actionError: error); + } + } } @freezed diff --git a/khelo/lib/ui/flow/settings/support/contact_support_screen.dart b/khelo/lib/ui/flow/settings/support/contact_support_screen.dart new file mode 100644 index 00000000..f003ee3c --- /dev/null +++ b/khelo/lib/ui/flow/settings/support/contact_support_screen.dart @@ -0,0 +1,119 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:khelo/components/app_page.dart'; +import 'package:khelo/domain/extensions/context_extensions.dart'; +import 'package:khelo/ui/flow/settings/support/contact_support_view_model.dart'; +import 'package:style/animations/on_tap_scale.dart'; +import 'package:style/button/primary_button.dart'; +import 'package:style/extensions/context_extensions.dart'; +import 'package:style/text/app_text_field.dart'; +import 'package:style/text/app_text_style.dart'; + +class ContactSupportScreen extends ConsumerStatefulWidget { + const ContactSupportScreen({super.key}); + + @override + ConsumerState createState() => + _ContactSupportScreenState(); +} + +class _ContactSupportScreenState extends ConsumerState { + late ContactSupportViewStateNotifier notifier; + + @override + void initState() { + super.initState(); + notifier = ref.read(contactSupportStateNotifierProvider.notifier); + } + + @override + Widget build(BuildContext context) { + return AppPage( + title: context.l10n.contact_support_title, + body: Builder(builder: (context) { + return _body(context); + }), + ); + } + + Widget _body(BuildContext context) { + final state = ref.watch(contactSupportStateNotifierProvider); + return ListView( + padding: context.mediaQueryPadding + const EdgeInsets.all(16), + children: [ + _textInputField( + context, + placeholderText: context.l10n.contact_support_title_text, + controller: state.titleController, + ), + const SizedBox(height: 16), + _textInputField( + context, + placeholderText: context.l10n.contact_support_description_title, + controller: state.descriptionController, + maxLines: 8, + ), + const SizedBox(height: 16), + _attachmentButton( + context: context, + onAttachmentTap: () {}, + ), + const SizedBox(height: 16), + PrimaryButton( + context.l10n.common_submit_title, + enabled: !state.submitting && state.enableSubmit, + progress: state.submitting, + onPressed: () {}, + ) + ], + ); + } + + Widget _textInputField( + BuildContext context, { + required String placeholderText, + required TextEditingController controller, + int? maxLines, + }) { + return AppTextField( + controller: controller, + maxLines: maxLines, + onChanged: (value) => notifier.onValueChange(), + style: AppTextStyle.subtitle3 + .copyWith(color: context.colorScheme.textPrimary), + borderRadius: BorderRadius.circular(12), + borderType: AppTextFieldBorderType.outline, + backgroundColor: context.colorScheme.containerLow, + borderColor: BorderColor( + focusColor: Colors.transparent, unFocusColor: Colors.transparent), + hintText: placeholderText, + hintStyle: AppTextStyle.subtitle3 + .copyWith(color: context.colorScheme.textDisabled), + ); + } + + Widget _attachmentButton({ + required BuildContext context, + required VoidCallback onAttachmentTap, + }) { + return OnTapScale( + onTap: onAttachmentTap, + child: Row( + children: [ + Icon( + CupertinoIcons.paperclip, + color: context.colorScheme.textPrimary, + size: 16, + ), + Text( + context.l10n.contact_support_attachment, + style: AppTextStyle.caption.copyWith( + color: context.colorScheme.textSecondary, + ), + ), + ], + ), + ); + } +} diff --git a/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart b/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart new file mode 100644 index 00000000..91f81b1d --- /dev/null +++ b/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart @@ -0,0 +1,38 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'contact_support_view_model.freezed.dart'; + +final contactSupportStateNotifierProvider = StateNotifierProvider.autoDispose< + ContactSupportViewStateNotifier, ContactSupportViewStat>((ref) { + return ContactSupportViewStateNotifier(); +}); + +class ContactSupportViewStateNotifier + extends StateNotifier { + ContactSupportViewStateNotifier() + : super( + ContactSupportViewStat( + titleController: TextEditingController(), + descriptionController: TextEditingController()), + ); + + void onValueChange() { + state = state.copyWith( + actionError: null, + enableSubmit: state.titleController.text.trim().isNotEmpty); + } +} + +@freezed +class ContactSupportViewStat with _$ContactSupportViewStat { + const factory ContactSupportViewStat({ + @Default(false) bool submitting, + @Default(false) bool enableSubmit, + required TextEditingController titleController, + required TextEditingController descriptionController, + Object? actionError, + }) = _ContactSupportViewStat; +} diff --git a/khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart b/khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart new file mode 100644 index 00000000..be1a2f9c --- /dev/null +++ b/khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart @@ -0,0 +1,230 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'contact_support_view_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$ContactSupportViewStat { + bool get submitting => throw _privateConstructorUsedError; + bool get enableSubmit => throw _privateConstructorUsedError; + TextEditingController get titleController => + throw _privateConstructorUsedError; + TextEditingController get descriptionController => + throw _privateConstructorUsedError; + Object? get actionError => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $ContactSupportViewStatCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ContactSupportViewStatCopyWith<$Res> { + factory $ContactSupportViewStatCopyWith(ContactSupportViewStat value, + $Res Function(ContactSupportViewStat) then) = + _$ContactSupportViewStatCopyWithImpl<$Res, ContactSupportViewStat>; + @useResult + $Res call( + {bool submitting, + bool enableSubmit, + TextEditingController titleController, + TextEditingController descriptionController, + Object? actionError}); +} + +/// @nodoc +class _$ContactSupportViewStatCopyWithImpl<$Res, + $Val extends ContactSupportViewStat> + implements $ContactSupportViewStatCopyWith<$Res> { + _$ContactSupportViewStatCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? submitting = null, + Object? enableSubmit = null, + Object? titleController = null, + Object? descriptionController = null, + Object? actionError = freezed, + }) { + return _then(_value.copyWith( + submitting: null == submitting + ? _value.submitting + : submitting // ignore: cast_nullable_to_non_nullable + as bool, + enableSubmit: null == enableSubmit + ? _value.enableSubmit + : enableSubmit // ignore: cast_nullable_to_non_nullable + as bool, + titleController: null == titleController + ? _value.titleController + : titleController // ignore: cast_nullable_to_non_nullable + as TextEditingController, + descriptionController: null == descriptionController + ? _value.descriptionController + : descriptionController // ignore: cast_nullable_to_non_nullable + as TextEditingController, + actionError: freezed == actionError ? _value.actionError : actionError, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$ContactSupportViewStatImplCopyWith<$Res> + implements $ContactSupportViewStatCopyWith<$Res> { + factory _$$ContactSupportViewStatImplCopyWith( + _$ContactSupportViewStatImpl value, + $Res Function(_$ContactSupportViewStatImpl) then) = + __$$ContactSupportViewStatImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool submitting, + bool enableSubmit, + TextEditingController titleController, + TextEditingController descriptionController, + Object? actionError}); +} + +/// @nodoc +class __$$ContactSupportViewStatImplCopyWithImpl<$Res> + extends _$ContactSupportViewStatCopyWithImpl<$Res, + _$ContactSupportViewStatImpl> + implements _$$ContactSupportViewStatImplCopyWith<$Res> { + __$$ContactSupportViewStatImplCopyWithImpl( + _$ContactSupportViewStatImpl _value, + $Res Function(_$ContactSupportViewStatImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? submitting = null, + Object? enableSubmit = null, + Object? titleController = null, + Object? descriptionController = null, + Object? actionError = freezed, + }) { + return _then(_$ContactSupportViewStatImpl( + submitting: null == submitting + ? _value.submitting + : submitting // ignore: cast_nullable_to_non_nullable + as bool, + enableSubmit: null == enableSubmit + ? _value.enableSubmit + : enableSubmit // ignore: cast_nullable_to_non_nullable + as bool, + titleController: null == titleController + ? _value.titleController + : titleController // ignore: cast_nullable_to_non_nullable + as TextEditingController, + descriptionController: null == descriptionController + ? _value.descriptionController + : descriptionController // ignore: cast_nullable_to_non_nullable + as TextEditingController, + actionError: freezed == actionError ? _value.actionError : actionError, + )); + } +} + +/// @nodoc + +class _$ContactSupportViewStatImpl implements _ContactSupportViewStat { + const _$ContactSupportViewStatImpl( + {this.submitting = false, + this.enableSubmit = false, + required this.titleController, + required this.descriptionController, + this.actionError}); + + @override + @JsonKey() + final bool submitting; + @override + @JsonKey() + final bool enableSubmit; + @override + final TextEditingController titleController; + @override + final TextEditingController descriptionController; + @override + final Object? actionError; + + @override + String toString() { + return 'ContactSupportViewStat(submitting: $submitting, enableSubmit: $enableSubmit, titleController: $titleController, descriptionController: $descriptionController, actionError: $actionError)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ContactSupportViewStatImpl && + (identical(other.submitting, submitting) || + other.submitting == submitting) && + (identical(other.enableSubmit, enableSubmit) || + other.enableSubmit == enableSubmit) && + (identical(other.titleController, titleController) || + other.titleController == titleController) && + (identical(other.descriptionController, descriptionController) || + other.descriptionController == descriptionController) && + const DeepCollectionEquality() + .equals(other.actionError, actionError)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + submitting, + enableSubmit, + titleController, + descriptionController, + const DeepCollectionEquality().hash(actionError)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ContactSupportViewStatImplCopyWith<_$ContactSupportViewStatImpl> + get copyWith => __$$ContactSupportViewStatImplCopyWithImpl< + _$ContactSupportViewStatImpl>(this, _$identity); +} + +abstract class _ContactSupportViewStat implements ContactSupportViewStat { + const factory _ContactSupportViewStat( + {final bool submitting, + final bool enableSubmit, + required final TextEditingController titleController, + required final TextEditingController descriptionController, + final Object? actionError}) = _$ContactSupportViewStatImpl; + + @override + bool get submitting; + @override + bool get enableSubmit; + @override + TextEditingController get titleController; + @override + TextEditingController get descriptionController; + @override + Object? get actionError; + @override + @JsonKey(ignore: true) + _$$ContactSupportViewStatImplCopyWith<_$ContactSupportViewStatImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/khelo/linux/flutter/generated_plugin_registrant.cc b/khelo/linux/flutter/generated_plugin_registrant.cc index 64a0ecea..7299b5cf 100644 --- a/khelo/linux/flutter/generated_plugin_registrant.cc +++ b/khelo/linux/flutter/generated_plugin_registrant.cc @@ -7,9 +7,13 @@ #include "generated_plugin_registrant.h" #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/khelo/linux/flutter/generated_plugins.cmake b/khelo/linux/flutter/generated_plugins.cmake index 2db3c22a..786ff5c2 100644 --- a/khelo/linux/flutter/generated_plugins.cmake +++ b/khelo/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/khelo/macos/Flutter/GeneratedPluginRegistrant.swift b/khelo/macos/Flutter/GeneratedPluginRegistrant.swift index ae3d9887..457b72ea 100644 --- a/khelo/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/khelo/macos/Flutter/GeneratedPluginRegistrant.swift @@ -17,6 +17,7 @@ import package_info_plus import path_provider_foundation import shared_preferences_foundation import sqflite +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) @@ -31,4 +32,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/khelo/pubspec.lock b/khelo/pubspec.lock index 587abcfc..adc66fe6 100644 --- a/khelo/pubspec.lock +++ b/khelo/pubspec.lock @@ -1384,6 +1384,70 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: ceb2625f0c24ade6ef6778d1de0b2e44f2db71fded235eb52295247feba8c5cf + url: "https://pub.dev" + source: hosted + version: "6.3.3" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "7068716403343f6ba4969b4173cbf3b84fc768042124bc2c011e5d782b24fe89" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.dev" + source: hosted + version: "3.1.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + url: "https://pub.dev" + source: hosted + version: "3.1.1" uuid: dependency: transitive description: diff --git a/khelo/pubspec.yaml b/khelo/pubspec.yaml index 2138ec67..7a4f47fd 100644 --- a/khelo/pubspec.yaml +++ b/khelo/pubspec.yaml @@ -49,6 +49,7 @@ dependencies: fluttertoast: ^8.2.4 smooth_page_indicator: ^1.1.0 flutter_svg: ^2.0.10+1 + url_launcher: ^6.3.0 # picker canopas_country_picker: ^0.0.4 diff --git a/khelo/windows/flutter/generated_plugin_registrant.cc b/khelo/windows/flutter/generated_plugin_registrant.cc index ec1e463e..3e6795ed 100644 --- a/khelo/windows/flutter/generated_plugin_registrant.cc +++ b/khelo/windows/flutter/generated_plugin_registrant.cc @@ -11,6 +11,7 @@ #include #include #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { CloudFirestorePluginCApiRegisterWithRegistrar( @@ -23,4 +24,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); FirebaseStoragePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/khelo/windows/flutter/generated_plugins.cmake b/khelo/windows/flutter/generated_plugins.cmake index 767b5286..9615bc97 100644 --- a/khelo/windows/flutter/generated_plugins.cmake +++ b/khelo/windows/flutter/generated_plugins.cmake @@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST firebase_auth firebase_core firebase_storage + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST From 2f04c98ee1a7d43006cfae21dda0a0b29b9e787f Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Mon, 17 Jun 2024 17:46:38 +0530 Subject: [PATCH 5/7] Minor changes --- khelo/assets/locales/app_en.arb | 3 - khelo/lib/ui/app_route.dart | 12 - khelo/lib/ui/flow/profile/profile_screen.dart | 2 +- .../support/contact_support_screen.dart | 119 --------- .../support/contact_support_view_model.dart | 38 --- .../contact_support_view_model.freezed.dart | 230 ------------------ 6 files changed, 1 insertion(+), 403 deletions(-) delete mode 100644 khelo/lib/ui/flow/settings/support/contact_support_screen.dart delete mode 100644 khelo/lib/ui/flow/settings/support/contact_support_view_model.dart delete mode 100644 khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart diff --git a/khelo/assets/locales/app_en.arb b/khelo/assets/locales/app_en.arb index 3ca0ef3d..cfd9adc0 100644 --- a/khelo/assets/locales/app_en.arb +++ b/khelo/assets/locales/app_en.arb @@ -648,9 +648,6 @@ "@_CONTACT_SUPPORT": { }, "contact_support_title": "Contact support", - "contact_support_title_text": "Title", - "contact_support_description_title": "Description...", - "contact_support_attachment": "Attachment (if any)", "profile_complete_profile_btn_title": "Complete Profile", "profile_complete_your_profile_title": "Complete your profile", diff --git a/khelo/lib/ui/app_route.dart b/khelo/lib/ui/app_route.dart index 78135d74..2048e8d5 100644 --- a/khelo/lib/ui/app_route.dart +++ b/khelo/lib/ui/app_route.dart @@ -14,7 +14,6 @@ import 'package:khelo/ui/flow/matches/match_detail/match_detail_tab_screen.dart' import 'package:khelo/ui/flow/score_board/add_toss_detail/add_toss_detail_screen.dart'; import 'package:khelo/ui/flow/score_board/score_board_screen.dart'; import 'package:khelo/ui/flow/settings/edit_profile/edit_profile_screen.dart'; -import 'package:khelo/ui/flow/settings/support/contact_support_screen.dart'; import 'package:khelo/ui/flow/sign_in/phone_verification/phone_verification_screen.dart'; import 'package:khelo/ui/flow/team/add_team/add_team_screen.dart'; import 'package:khelo/ui/flow/team/add_team_member/add_team_member_screen.dart'; @@ -216,9 +215,6 @@ class AppRoute { pathEditProfile, builder: (_) => EditProfileScreen(isToCreateAccount: isToCreateAccount)); - static AppRoute contactSupport() => AppRoute(pathContactSupport, - builder: (_) => const ContactSupportScreen()); - static AppRoute teamDetail({required String teamId}) => AppRoute(pathTeamDetail, builder: (_) => TeamDetailScreen(teamId: teamId)); @@ -246,14 +242,6 @@ class AppRoute { : state.widget(context); }, ), - GoRoute( - path: pathContactSupport, - builder: (context, state) { - return state.extra == null - ? const ContactSupportScreen() - : state.widget(context); - }, - ), phoneLogin.goRoute(), GoRoute( path: pathScoreBoard, diff --git a/khelo/lib/ui/flow/profile/profile_screen.dart b/khelo/lib/ui/flow/profile/profile_screen.dart index 643580f0..f243818f 100644 --- a/khelo/lib/ui/flow/profile/profile_screen.dart +++ b/khelo/lib/ui/flow/profile/profile_screen.dart @@ -137,7 +137,7 @@ class ProfileScreen extends ConsumerWidget { context, icon: Assets.images.icContactSupport, title: context.l10n.contact_support_title, - onTap: () => AppRoute.contactSupport().push(context), + onTap: () {}, ), _settingItem( context, diff --git a/khelo/lib/ui/flow/settings/support/contact_support_screen.dart b/khelo/lib/ui/flow/settings/support/contact_support_screen.dart deleted file mode 100644 index f003ee3c..00000000 --- a/khelo/lib/ui/flow/settings/support/contact_support_screen.dart +++ /dev/null @@ -1,119 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:khelo/components/app_page.dart'; -import 'package:khelo/domain/extensions/context_extensions.dart'; -import 'package:khelo/ui/flow/settings/support/contact_support_view_model.dart'; -import 'package:style/animations/on_tap_scale.dart'; -import 'package:style/button/primary_button.dart'; -import 'package:style/extensions/context_extensions.dart'; -import 'package:style/text/app_text_field.dart'; -import 'package:style/text/app_text_style.dart'; - -class ContactSupportScreen extends ConsumerStatefulWidget { - const ContactSupportScreen({super.key}); - - @override - ConsumerState createState() => - _ContactSupportScreenState(); -} - -class _ContactSupportScreenState extends ConsumerState { - late ContactSupportViewStateNotifier notifier; - - @override - void initState() { - super.initState(); - notifier = ref.read(contactSupportStateNotifierProvider.notifier); - } - - @override - Widget build(BuildContext context) { - return AppPage( - title: context.l10n.contact_support_title, - body: Builder(builder: (context) { - return _body(context); - }), - ); - } - - Widget _body(BuildContext context) { - final state = ref.watch(contactSupportStateNotifierProvider); - return ListView( - padding: context.mediaQueryPadding + const EdgeInsets.all(16), - children: [ - _textInputField( - context, - placeholderText: context.l10n.contact_support_title_text, - controller: state.titleController, - ), - const SizedBox(height: 16), - _textInputField( - context, - placeholderText: context.l10n.contact_support_description_title, - controller: state.descriptionController, - maxLines: 8, - ), - const SizedBox(height: 16), - _attachmentButton( - context: context, - onAttachmentTap: () {}, - ), - const SizedBox(height: 16), - PrimaryButton( - context.l10n.common_submit_title, - enabled: !state.submitting && state.enableSubmit, - progress: state.submitting, - onPressed: () {}, - ) - ], - ); - } - - Widget _textInputField( - BuildContext context, { - required String placeholderText, - required TextEditingController controller, - int? maxLines, - }) { - return AppTextField( - controller: controller, - maxLines: maxLines, - onChanged: (value) => notifier.onValueChange(), - style: AppTextStyle.subtitle3 - .copyWith(color: context.colorScheme.textPrimary), - borderRadius: BorderRadius.circular(12), - borderType: AppTextFieldBorderType.outline, - backgroundColor: context.colorScheme.containerLow, - borderColor: BorderColor( - focusColor: Colors.transparent, unFocusColor: Colors.transparent), - hintText: placeholderText, - hintStyle: AppTextStyle.subtitle3 - .copyWith(color: context.colorScheme.textDisabled), - ); - } - - Widget _attachmentButton({ - required BuildContext context, - required VoidCallback onAttachmentTap, - }) { - return OnTapScale( - onTap: onAttachmentTap, - child: Row( - children: [ - Icon( - CupertinoIcons.paperclip, - color: context.colorScheme.textPrimary, - size: 16, - ), - Text( - context.l10n.contact_support_attachment, - style: AppTextStyle.caption.copyWith( - color: context.colorScheme.textSecondary, - ), - ), - ], - ), - ); - } -} diff --git a/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart b/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart deleted file mode 100644 index 91f81b1d..00000000 --- a/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'contact_support_view_model.freezed.dart'; - -final contactSupportStateNotifierProvider = StateNotifierProvider.autoDispose< - ContactSupportViewStateNotifier, ContactSupportViewStat>((ref) { - return ContactSupportViewStateNotifier(); -}); - -class ContactSupportViewStateNotifier - extends StateNotifier { - ContactSupportViewStateNotifier() - : super( - ContactSupportViewStat( - titleController: TextEditingController(), - descriptionController: TextEditingController()), - ); - - void onValueChange() { - state = state.copyWith( - actionError: null, - enableSubmit: state.titleController.text.trim().isNotEmpty); - } -} - -@freezed -class ContactSupportViewStat with _$ContactSupportViewStat { - const factory ContactSupportViewStat({ - @Default(false) bool submitting, - @Default(false) bool enableSubmit, - required TextEditingController titleController, - required TextEditingController descriptionController, - Object? actionError, - }) = _ContactSupportViewStat; -} diff --git a/khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart b/khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart deleted file mode 100644 index be1a2f9c..00000000 --- a/khelo/lib/ui/flow/settings/support/contact_support_view_model.freezed.dart +++ /dev/null @@ -1,230 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'contact_support_view_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$ContactSupportViewStat { - bool get submitting => throw _privateConstructorUsedError; - bool get enableSubmit => throw _privateConstructorUsedError; - TextEditingController get titleController => - throw _privateConstructorUsedError; - TextEditingController get descriptionController => - throw _privateConstructorUsedError; - Object? get actionError => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $ContactSupportViewStatCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ContactSupportViewStatCopyWith<$Res> { - factory $ContactSupportViewStatCopyWith(ContactSupportViewStat value, - $Res Function(ContactSupportViewStat) then) = - _$ContactSupportViewStatCopyWithImpl<$Res, ContactSupportViewStat>; - @useResult - $Res call( - {bool submitting, - bool enableSubmit, - TextEditingController titleController, - TextEditingController descriptionController, - Object? actionError}); -} - -/// @nodoc -class _$ContactSupportViewStatCopyWithImpl<$Res, - $Val extends ContactSupportViewStat> - implements $ContactSupportViewStatCopyWith<$Res> { - _$ContactSupportViewStatCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? submitting = null, - Object? enableSubmit = null, - Object? titleController = null, - Object? descriptionController = null, - Object? actionError = freezed, - }) { - return _then(_value.copyWith( - submitting: null == submitting - ? _value.submitting - : submitting // ignore: cast_nullable_to_non_nullable - as bool, - enableSubmit: null == enableSubmit - ? _value.enableSubmit - : enableSubmit // ignore: cast_nullable_to_non_nullable - as bool, - titleController: null == titleController - ? _value.titleController - : titleController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - descriptionController: null == descriptionController - ? _value.descriptionController - : descriptionController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - actionError: freezed == actionError ? _value.actionError : actionError, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$ContactSupportViewStatImplCopyWith<$Res> - implements $ContactSupportViewStatCopyWith<$Res> { - factory _$$ContactSupportViewStatImplCopyWith( - _$ContactSupportViewStatImpl value, - $Res Function(_$ContactSupportViewStatImpl) then) = - __$$ContactSupportViewStatImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool submitting, - bool enableSubmit, - TextEditingController titleController, - TextEditingController descriptionController, - Object? actionError}); -} - -/// @nodoc -class __$$ContactSupportViewStatImplCopyWithImpl<$Res> - extends _$ContactSupportViewStatCopyWithImpl<$Res, - _$ContactSupportViewStatImpl> - implements _$$ContactSupportViewStatImplCopyWith<$Res> { - __$$ContactSupportViewStatImplCopyWithImpl( - _$ContactSupportViewStatImpl _value, - $Res Function(_$ContactSupportViewStatImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? submitting = null, - Object? enableSubmit = null, - Object? titleController = null, - Object? descriptionController = null, - Object? actionError = freezed, - }) { - return _then(_$ContactSupportViewStatImpl( - submitting: null == submitting - ? _value.submitting - : submitting // ignore: cast_nullable_to_non_nullable - as bool, - enableSubmit: null == enableSubmit - ? _value.enableSubmit - : enableSubmit // ignore: cast_nullable_to_non_nullable - as bool, - titleController: null == titleController - ? _value.titleController - : titleController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - descriptionController: null == descriptionController - ? _value.descriptionController - : descriptionController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - actionError: freezed == actionError ? _value.actionError : actionError, - )); - } -} - -/// @nodoc - -class _$ContactSupportViewStatImpl implements _ContactSupportViewStat { - const _$ContactSupportViewStatImpl( - {this.submitting = false, - this.enableSubmit = false, - required this.titleController, - required this.descriptionController, - this.actionError}); - - @override - @JsonKey() - final bool submitting; - @override - @JsonKey() - final bool enableSubmit; - @override - final TextEditingController titleController; - @override - final TextEditingController descriptionController; - @override - final Object? actionError; - - @override - String toString() { - return 'ContactSupportViewStat(submitting: $submitting, enableSubmit: $enableSubmit, titleController: $titleController, descriptionController: $descriptionController, actionError: $actionError)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ContactSupportViewStatImpl && - (identical(other.submitting, submitting) || - other.submitting == submitting) && - (identical(other.enableSubmit, enableSubmit) || - other.enableSubmit == enableSubmit) && - (identical(other.titleController, titleController) || - other.titleController == titleController) && - (identical(other.descriptionController, descriptionController) || - other.descriptionController == descriptionController) && - const DeepCollectionEquality() - .equals(other.actionError, actionError)); - } - - @override - int get hashCode => Object.hash( - runtimeType, - submitting, - enableSubmit, - titleController, - descriptionController, - const DeepCollectionEquality().hash(actionError)); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$ContactSupportViewStatImplCopyWith<_$ContactSupportViewStatImpl> - get copyWith => __$$ContactSupportViewStatImplCopyWithImpl< - _$ContactSupportViewStatImpl>(this, _$identity); -} - -abstract class _ContactSupportViewStat implements ContactSupportViewStat { - const factory _ContactSupportViewStat( - {final bool submitting, - final bool enableSubmit, - required final TextEditingController titleController, - required final TextEditingController descriptionController, - final Object? actionError}) = _$ContactSupportViewStatImpl; - - @override - bool get submitting; - @override - bool get enableSubmit; - @override - TextEditingController get titleController; - @override - TextEditingController get descriptionController; - @override - Object? get actionError; - @override - @JsonKey(ignore: true) - _$$ContactSupportViewStatImplCopyWith<_$ContactSupportViewStatImpl> - get copyWith => throw _privateConstructorUsedError; -} From d6987b32bfaacb45951479038d4a18687fe5664d Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Mon, 17 Jun 2024 17:48:57 +0530 Subject: [PATCH 6/7] Minor changes --- khelo/lib/ui/app_route.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/khelo/lib/ui/app_route.dart b/khelo/lib/ui/app_route.dart index 2048e8d5..79924b36 100644 --- a/khelo/lib/ui/app_route.dart +++ b/khelo/lib/ui/app_route.dart @@ -25,7 +25,6 @@ import 'flow/sign_in/sign_in_with_phone/sign_in_with_phone_screen.dart'; class AppRoute { static const pathPhoneNumberVerification = '/phone-number-verification'; static const pathEditProfile = '/edit-profile'; - static const pathContactSupport = "/contact-support"; static const pathAddTeamMember = '/add-team-member'; static const pathAddTeam = '/add-team'; static const pathPowerPlay = '/power-play'; From 976443b98b2ad902662732d6e3d7ab825a225dcc Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Mon, 17 Jun 2024 18:00:32 +0530 Subject: [PATCH 7/7] Add App Version --- khelo/assets/locales/app_en.arb | 1 + khelo/lib/ui/flow/profile/profile_screen.dart | 12 ++++++ .../ui/flow/profile/profile_view_model.dart | 15 +++++++- .../profile/profile_view_model.freezed.dart | 38 +++++++++++++++---- 4 files changed, 56 insertions(+), 10 deletions(-) diff --git a/khelo/assets/locales/app_en.arb b/khelo/assets/locales/app_en.arb index cfd9adc0..b8e99cdc 100644 --- a/khelo/assets/locales/app_en.arb +++ b/khelo/assets/locales/app_en.arb @@ -644,6 +644,7 @@ "profile_settings_title": "Settings", "profile_setting_privacy_policy_title": "Privacy policy", + "profile_setting_app_version_text": "App Version: {version}", "@_CONTACT_SUPPORT": { }, diff --git a/khelo/lib/ui/flow/profile/profile_screen.dart b/khelo/lib/ui/flow/profile/profile_screen.dart index f243818f..f01e8d72 100644 --- a/khelo/lib/ui/flow/profile/profile_screen.dart +++ b/khelo/lib/ui/flow/profile/profile_screen.dart @@ -49,6 +49,18 @@ class ProfileScreen extends ConsumerWidget { ), const SizedBox(height: 16), _settingsView(context, notifier), + const SizedBox(height: 24), + Visibility( + visible: state.appVersion != null, + child: Text( + context.l10n.profile_setting_app_version_text( + state.appVersion.toString()), + textAlign: TextAlign.center, + style: AppTextStyle.body2.copyWith( + color: context.colorScheme.textDisabled, + ), + ), + ) ], ); }, diff --git a/khelo/lib/ui/flow/profile/profile_view_model.dart b/khelo/lib/ui/flow/profile/profile_view_model.dart index 94f9b277..b5cc8b88 100644 --- a/khelo/lib/ui/flow/profile/profile_view_model.dart +++ b/khelo/lib/ui/flow/profile/profile_view_model.dart @@ -1,5 +1,6 @@ import 'package:data/api/user/user_models.dart'; import 'package:data/service/auth/auth_service.dart'; +import 'package:data/service/device/device_service.dart'; import 'package:data/storage/app_preferences.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -12,6 +13,7 @@ final profileStateProvider = StateNotifierProvider.autoDispose((ref) { final notifier = ProfileViewNotifier( ref.read(authServiceProvider), + ref.read(deviceServiceProvider), ref.read(currentUserPod), ); @@ -21,14 +23,22 @@ final profileStateProvider = class ProfileViewNotifier extends StateNotifier { final AuthService _authService; + final DeviceService _deviceService; - ProfileViewNotifier(this._authService, UserModel? user) - : super(ProfileState(currentUser: user)); + ProfileViewNotifier(this._authService, this._deviceService, UserModel? user) + : super(ProfileState(currentUser: user)) { + getAppVersion(); + } void _updateUser(UserModel? user) { state = state.copyWith(currentUser: user); } + void getAppVersion() async { + final appVersion = await _deviceService.version; + state = state.copyWith(appVersion: appVersion); + } + void onSignOutTap() { state = state.copyWith(actionError: null); try { @@ -54,5 +64,6 @@ class ProfileState with _$ProfileState { const factory ProfileState({ Object? actionError, UserModel? currentUser, + String? appVersion, }) = _ProfileState; } diff --git a/khelo/lib/ui/flow/profile/profile_view_model.freezed.dart b/khelo/lib/ui/flow/profile/profile_view_model.freezed.dart index 4b6ceb8b..deff8bb3 100644 --- a/khelo/lib/ui/flow/profile/profile_view_model.freezed.dart +++ b/khelo/lib/ui/flow/profile/profile_view_model.freezed.dart @@ -18,6 +18,7 @@ final _privateConstructorUsedError = UnsupportedError( mixin _$ProfileState { Object? get actionError => throw _privateConstructorUsedError; UserModel? get currentUser => throw _privateConstructorUsedError; + String? get appVersion => throw _privateConstructorUsedError; @JsonKey(ignore: true) $ProfileStateCopyWith get copyWith => @@ -30,7 +31,7 @@ abstract class $ProfileStateCopyWith<$Res> { ProfileState value, $Res Function(ProfileState) then) = _$ProfileStateCopyWithImpl<$Res, ProfileState>; @useResult - $Res call({Object? actionError, UserModel? currentUser}); + $Res call({Object? actionError, UserModel? currentUser, String? appVersion}); $UserModelCopyWith<$Res>? get currentUser; } @@ -50,6 +51,7 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> $Res call({ Object? actionError = freezed, Object? currentUser = freezed, + Object? appVersion = freezed, }) { return _then(_value.copyWith( actionError: freezed == actionError ? _value.actionError : actionError, @@ -57,6 +59,10 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> ? _value.currentUser : currentUser // ignore: cast_nullable_to_non_nullable as UserModel?, + appVersion: freezed == appVersion + ? _value.appVersion + : appVersion // ignore: cast_nullable_to_non_nullable + as String?, ) as $Val); } @@ -81,7 +87,7 @@ abstract class _$$ProfileStateImplCopyWith<$Res> __$$ProfileStateImplCopyWithImpl<$Res>; @override @useResult - $Res call({Object? actionError, UserModel? currentUser}); + $Res call({Object? actionError, UserModel? currentUser, String? appVersion}); @override $UserModelCopyWith<$Res>? get currentUser; @@ -100,6 +106,7 @@ class __$$ProfileStateImplCopyWithImpl<$Res> $Res call({ Object? actionError = freezed, Object? currentUser = freezed, + Object? appVersion = freezed, }) { return _then(_$ProfileStateImpl( actionError: freezed == actionError ? _value.actionError : actionError, @@ -107,6 +114,10 @@ class __$$ProfileStateImplCopyWithImpl<$Res> ? _value.currentUser : currentUser // ignore: cast_nullable_to_non_nullable as UserModel?, + appVersion: freezed == appVersion + ? _value.appVersion + : appVersion // ignore: cast_nullable_to_non_nullable + as String?, )); } } @@ -114,16 +125,19 @@ class __$$ProfileStateImplCopyWithImpl<$Res> /// @nodoc class _$ProfileStateImpl implements _ProfileState { - const _$ProfileStateImpl({this.actionError, this.currentUser}); + const _$ProfileStateImpl( + {this.actionError, this.currentUser, this.appVersion}); @override final Object? actionError; @override final UserModel? currentUser; + @override + final String? appVersion; @override String toString() { - return 'ProfileState(actionError: $actionError, currentUser: $currentUser)'; + return 'ProfileState(actionError: $actionError, currentUser: $currentUser, appVersion: $appVersion)'; } @override @@ -134,12 +148,17 @@ class _$ProfileStateImpl implements _ProfileState { const DeepCollectionEquality() .equals(other.actionError, actionError) && (identical(other.currentUser, currentUser) || - other.currentUser == currentUser)); + other.currentUser == currentUser) && + (identical(other.appVersion, appVersion) || + other.appVersion == appVersion)); } @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(actionError), currentUser); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(actionError), + currentUser, + appVersion); @JsonKey(ignore: true) @override @@ -151,13 +170,16 @@ class _$ProfileStateImpl implements _ProfileState { abstract class _ProfileState implements ProfileState { const factory _ProfileState( {final Object? actionError, - final UserModel? currentUser}) = _$ProfileStateImpl; + final UserModel? currentUser, + final String? appVersion}) = _$ProfileStateImpl; @override Object? get actionError; @override UserModel? get currentUser; @override + String? get appVersion; + @override @JsonKey(ignore: true) _$$ProfileStateImplCopyWith<_$ProfileStateImpl> get copyWith => throw _privateConstructorUsedError;