From 85e789c01c1038193cfb79b1e80a7995fd054713 Mon Sep 17 00:00:00 2001 From: Aidaiym Date: Tue, 1 Oct 2024 10:58:01 +0600 Subject: [PATCH] add sign in with apple and delete account --- app/lib/app/data/models/token_response.g.dart | 6 ++-- .../app/data/models/user_data_response.g.dart | 6 ++-- app/lib/app/data/models/user_model.g.dart | 6 ++-- .../data/model/hatim_base_response.g.dart | 6 ++-- .../hatim/data/model/hatim_page.g.dart | 3 +- .../hatim/data/model/hatim_read_model.g.dart | 6 ++-- .../data/model/home_model_response.g.dart | 6 ++-- .../login/presentation/view/sign_in_view.dart | 30 ++++++++++--------- .../modules/quran/data/model/juz_model.g.dart | 12 +++----- .../quran/data/model/juz_surah_model.g.dart | 10 ++----- .../quran/data/model/surah_model.g.dart | 10 ++----- .../read/data/model/filters_response.g.dart | 6 ++-- .../read/data/model/meta_response.g.dart | 6 ++-- .../data/model/quran_page_response.g.dart | 10 ++----- .../read/data/model/verse_response.g.dart | 6 ++-- 15 files changed, 48 insertions(+), 81 deletions(-) diff --git a/app/lib/app/data/models/token_response.g.dart b/app/lib/app/data/models/token_response.g.dart index 14ad414f..8392e0a7 100644 --- a/app/lib/app/data/models/token_response.g.dart +++ b/app/lib/app/data/models/token_response.g.dart @@ -6,12 +6,10 @@ part of 'token_response.dart'; // JsonSerializableGenerator // ************************************************************************** -TokenResponse _$TokenResponseFromJson(Map json) => - TokenResponse( +TokenResponse _$TokenResponseFromJson(Map json) => TokenResponse( json['key'] as String, ); -Map _$TokenResponseToJson(TokenResponse instance) => - { +Map _$TokenResponseToJson(TokenResponse instance) => { 'key': instance.key, }; diff --git a/app/lib/app/data/models/user_data_response.g.dart b/app/lib/app/data/models/user_data_response.g.dart index 727e1434..9479b056 100644 --- a/app/lib/app/data/models/user_data_response.g.dart +++ b/app/lib/app/data/models/user_data_response.g.dart @@ -6,14 +6,12 @@ part of 'user_data_response.dart'; // JsonSerializableGenerator // ************************************************************************** -UserDataResponse _$UserDataResponseFromJson(Map json) => - UserDataResponse( +UserDataResponse _$UserDataResponseFromJson(Map json) => UserDataResponse( gender: json['gender'] as String, language: json['language'] as String, ); -Map _$UserDataResponseToJson(UserDataResponse instance) => - { +Map _$UserDataResponseToJson(UserDataResponse instance) => { 'gender': instance.gender, 'language': instance.language, }; diff --git a/app/lib/app/data/models/user_model.g.dart b/app/lib/app/data/models/user_model.g.dart index 4dffaa40..71ef7885 100644 --- a/app/lib/app/data/models/user_model.g.dart +++ b/app/lib/app/data/models/user_model.g.dart @@ -6,16 +6,14 @@ part of 'user_model.dart'; // JsonSerializableGenerator // ************************************************************************** -UserModelResponse _$UserModelResponseFromJson(Map json) => - UserModelResponse( +UserModelResponse _$UserModelResponseFromJson(Map json) => UserModelResponse( accessToken: json['accessToken'] as String, username: json['username'] as String, gender: $enumDecode(_$GenderEnumMap, json['gender']), localeCode: json['localeCode'] as String, ); -Map _$UserModelResponseToJson(UserModelResponse instance) => - { +Map _$UserModelResponseToJson(UserModelResponse instance) => { 'accessToken': instance.accessToken, 'username': instance.username, 'gender': _$GenderEnumMap[instance.gender]!, diff --git a/app/lib/modules/hatim/data/model/hatim_base_response.g.dart b/app/lib/modules/hatim/data/model/hatim_base_response.g.dart index 00d27da2..96139dbf 100644 --- a/app/lib/modules/hatim/data/model/hatim_base_response.g.dart +++ b/app/lib/modules/hatim/data/model/hatim_base_response.g.dart @@ -6,14 +6,12 @@ part of 'hatim_base_response.dart'; // JsonSerializableGenerator // ************************************************************************** -HatimBaseResponse _$HatimBaseResponseFromJson(Map json) => - HatimBaseResponse( +HatimBaseResponse _$HatimBaseResponseFromJson(Map json) => HatimBaseResponse( type: $enumDecode(_$HatimResponseTypeEnumMap, json['type']), data: json['data'], ); -Map _$HatimBaseResponseToJson(HatimBaseResponse instance) => - { +Map _$HatimBaseResponseToJson(HatimBaseResponse instance) => { 'type': _$HatimResponseTypeEnumMap[instance.type]!, 'data': instance.data, }; diff --git a/app/lib/modules/hatim/data/model/hatim_page.g.dart b/app/lib/modules/hatim/data/model/hatim_page.g.dart index 3a218cec..91213a87 100644 --- a/app/lib/modules/hatim/data/model/hatim_page.g.dart +++ b/app/lib/modules/hatim/data/model/hatim_page.g.dart @@ -13,8 +13,7 @@ HatimPages _$HatimPagesFromJson(Map json) => HatimPages( mine: json['mine'] as bool, ); -Map _$HatimPagesToJson(HatimPages instance) => - { +Map _$HatimPagesToJson(HatimPages instance) => { 'id': instance.id, 'number': instance.number, 'status': _$HatimPageStatusEnumMap[instance.status]!, diff --git a/app/lib/modules/hatim/data/model/hatim_read_model.g.dart b/app/lib/modules/hatim/data/model/hatim_read_model.g.dart index 94e90971..4a956233 100644 --- a/app/lib/modules/hatim/data/model/hatim_read_model.g.dart +++ b/app/lib/modules/hatim/data/model/hatim_read_model.g.dart @@ -6,15 +6,13 @@ part of 'hatim_read_model.dart'; // JsonSerializableGenerator // ************************************************************************** -HatimReadModel _$HatimReadModelFromJson(Map json) => - HatimReadModel( +HatimReadModel _$HatimReadModelFromJson(Map json) => HatimReadModel( id: json['id'] as String, status: json['status'] as String, type: json['type'] as String, ); -Map _$HatimReadModelToJson(HatimReadModel instance) => - { +Map _$HatimReadModelToJson(HatimReadModel instance) => { 'id': instance.id, 'status': instance.status, 'type': instance.type, diff --git a/app/lib/modules/home/data/model/home_model_response.g.dart b/app/lib/modules/home/data/model/home_model_response.g.dart index 4387e59b..b6251496 100644 --- a/app/lib/modules/home/data/model/home_model_response.g.dart +++ b/app/lib/modules/home/data/model/home_model_response.g.dart @@ -6,15 +6,13 @@ part of 'home_model_response.dart'; // JsonSerializableGenerator // ************************************************************************** -HomeModelResponse _$HomeModelResponseFromJson(Map json) => - HomeModelResponse( +HomeModelResponse _$HomeModelResponseFromJson(Map json) => HomeModelResponse( allDoneHatims: (json['allDoneHatims'] as num).toInt(), allDonePages: (json['allDonePages'] as num).toInt(), donePages: (json['donePages'] as num).toInt(), ); -Map _$HomeModelResponseToJson(HomeModelResponse instance) => - { +Map _$HomeModelResponseToJson(HomeModelResponse instance) => { 'allDoneHatims': instance.allDoneHatims, 'allDonePages': instance.allDonePages, 'donePages': instance.donePages, diff --git a/app/lib/modules/login/presentation/view/sign_in_view.dart b/app/lib/modules/login/presentation/view/sign_in_view.dart index eaffea2b..fd36eb13 100644 --- a/app/lib/modules/login/presentation/view/sign_in_view.dart +++ b/app/lib/modules/login/presentation/view/sign_in_view.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:developer'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -153,20 +154,21 @@ class _SignInViewState extends State { ), ), const SizedBox(height: 16), - SignInWithAppleButton( - key: Key(MqKeys.loginTypeName('apple')), - text: 'Apple', - height: 50, - onPressed: () async { - MqAnalytic.track( - AnalyticKey.tapLogin, - params: {'soccial': 'apple'}, - ); - unawaited(AppAlert.showLoading(context)); - await context.read().signInWithApple(); - if (context.mounted) context.loaderOverlay.hide(); - }, - ), + if (Platform.isIOS) + SignInWithAppleButton( + key: Key(MqKeys.loginTypeName('apple')), + text: 'Apple', + height: 50, + onPressed: () async { + MqAnalytic.track( + AnalyticKey.tapLogin, + params: {'soccial': 'apple'}, + ); + unawaited(AppAlert.showLoading(context)); + await context.read().signInWithApple(); + if (context.mounted) context.loaderOverlay.hide(); + }, + ), const SizedBox(height: 40), TextButton( onPressed: () { diff --git a/app/lib/modules/quran/data/model/juz_model.g.dart b/app/lib/modules/quran/data/model/juz_model.g.dart index 912f83f3..8b86f0a5 100644 --- a/app/lib/modules/quran/data/model/juz_model.g.dart +++ b/app/lib/modules/quran/data/model/juz_model.g.dart @@ -9,16 +9,12 @@ part of 'juz_model.dart'; JuzResponse _$JuzResponseFromJson(Map json) => JuzResponse( id: (json['id'] as num).toInt(), name: json['name'] as String, - pages: (json['pages'] as List) - .map((e) => (e as num).toInt()) - .toList(), - surahs: (json['surahs'] as List) - .map((e) => JuzSurahResponse.fromJson(e as Map)) - .toList(), + pages: (json['pages'] as List).map((e) => (e as num).toInt()).toList(), + surahs: + (json['surahs'] as List).map((e) => JuzSurahResponse.fromJson(e as Map)).toList(), ); -Map _$JuzResponseToJson(JuzResponse instance) => - { +Map _$JuzResponseToJson(JuzResponse instance) => { 'id': instance.id, 'name': instance.name, 'pages': instance.pages, diff --git a/app/lib/modules/quran/data/model/juz_surah_model.g.dart b/app/lib/modules/quran/data/model/juz_surah_model.g.dart index 57f2ec89..2b066416 100644 --- a/app/lib/modules/quran/data/model/juz_surah_model.g.dart +++ b/app/lib/modules/quran/data/model/juz_surah_model.g.dart @@ -6,17 +6,13 @@ part of 'juz_surah_model.dart'; // JsonSerializableGenerator // ************************************************************************** -JuzSurahResponse _$JuzSurahResponseFromJson(Map json) => - JuzSurahResponse( +JuzSurahResponse _$JuzSurahResponseFromJson(Map json) => JuzSurahResponse( name: json['name'] as String, arName: json['arName'] as String, - pages: (json['pages'] as List) - .map((e) => (e as num).toInt()) - .toList(), + pages: (json['pages'] as List).map((e) => (e as num).toInt()).toList(), ); -Map _$JuzSurahResponseToJson(JuzSurahResponse instance) => - { +Map _$JuzSurahResponseToJson(JuzSurahResponse instance) => { 'name': instance.name, 'arName': instance.arName, 'pages': instance.pages, diff --git a/app/lib/modules/quran/data/model/surah_model.g.dart b/app/lib/modules/quran/data/model/surah_model.g.dart index d6610405..e9a37885 100644 --- a/app/lib/modules/quran/data/model/surah_model.g.dart +++ b/app/lib/modules/quran/data/model/surah_model.g.dart @@ -6,19 +6,15 @@ part of 'surah_model.dart'; // JsonSerializableGenerator // ************************************************************************** -SurahResponse _$SurahResponseFromJson(Map json) => - SurahResponse( +SurahResponse _$SurahResponseFromJson(Map json) => SurahResponse( id: (json['id'] as num).toInt(), name: json['name'] as String, aya: (json['aya'] as num).toInt(), - pages: (json['pages'] as List) - .map((e) => (e as num).toInt()) - .toList(), + pages: (json['pages'] as List).map((e) => (e as num).toInt()).toList(), arabic: json['arabic'] as String, ); -Map _$SurahResponseToJson(SurahResponse instance) => - { +Map _$SurahResponseToJson(SurahResponse instance) => { 'id': instance.id, 'name': instance.name, 'aya': instance.aya, diff --git a/app/lib/modules/read/data/model/filters_response.g.dart b/app/lib/modules/read/data/model/filters_response.g.dart index db9297ae..b72780ff 100644 --- a/app/lib/modules/read/data/model/filters_response.g.dart +++ b/app/lib/modules/read/data/model/filters_response.g.dart @@ -6,12 +6,10 @@ part of 'filters_response.dart'; // JsonSerializableGenerator // ************************************************************************** -FiltersResponse _$FiltersResponseFromJson(Map json) => - FiltersResponse( +FiltersResponse _$FiltersResponseFromJson(Map json) => FiltersResponse( pageNumber: json['page_number'] as String, ); -Map _$FiltersResponseToJson(FiltersResponse instance) => - { +Map _$FiltersResponseToJson(FiltersResponse instance) => { 'page_number': instance.pageNumber, }; diff --git a/app/lib/modules/read/data/model/meta_response.g.dart b/app/lib/modules/read/data/model/meta_response.g.dart index 7fc5b55e..a0e90b45 100644 --- a/app/lib/modules/read/data/model/meta_response.g.dart +++ b/app/lib/modules/read/data/model/meta_response.g.dart @@ -7,11 +7,9 @@ part of 'meta_response.dart'; // ************************************************************************** MetaResponse _$MetaResponseFromJson(Map json) => MetaResponse( - filters: - FiltersResponse.fromJson(json['filters'] as Map), + filters: FiltersResponse.fromJson(json['filters'] as Map), ); -Map _$MetaResponseToJson(MetaResponse instance) => - { +Map _$MetaResponseToJson(MetaResponse instance) => { 'filters': instance.filters, }; diff --git a/app/lib/modules/read/data/model/quran_page_response.g.dart b/app/lib/modules/read/data/model/quran_page_response.g.dart index 1888b6bc..76391f60 100644 --- a/app/lib/modules/read/data/model/quran_page_response.g.dart +++ b/app/lib/modules/read/data/model/quran_page_response.g.dart @@ -6,16 +6,12 @@ part of 'quran_page_response.dart'; // JsonSerializableGenerator // ************************************************************************** -QuranPageResponse _$QuranPageResponseFromJson(Map json) => - QuranPageResponse( - verses: (json['verses'] as List) - .map((e) => VerseResponse.fromJson(e as Map)) - .toList(), +QuranPageResponse _$QuranPageResponseFromJson(Map json) => QuranPageResponse( + verses: (json['verses'] as List).map((e) => VerseResponse.fromJson(e as Map)).toList(), meta: MetaResponse.fromJson(json['meta'] as Map), ); -Map _$QuranPageResponseToJson(QuranPageResponse instance) => - { +Map _$QuranPageResponseToJson(QuranPageResponse instance) => { 'verses': instance.verses, 'meta': instance.meta, }; diff --git a/app/lib/modules/read/data/model/verse_response.g.dart b/app/lib/modules/read/data/model/verse_response.g.dart index 20ba1fd8..36620bf7 100644 --- a/app/lib/modules/read/data/model/verse_response.g.dart +++ b/app/lib/modules/read/data/model/verse_response.g.dart @@ -6,15 +6,13 @@ part of 'verse_response.dart'; // JsonSerializableGenerator // ************************************************************************** -VerseResponse _$VerseResponseFromJson(Map json) => - VerseResponse( +VerseResponse _$VerseResponseFromJson(Map json) => VerseResponse( id: (json['id'] as num).toInt(), verseKey: json['verse_key'] as String, textUthmani: json['text_imlaei'] as String, ); -Map _$VerseResponseToJson(VerseResponse instance) => - { +Map _$VerseResponseToJson(VerseResponse instance) => { 'id': instance.id, 'verse_key': instance.verseKey, 'text_imlaei': instance.textUthmani,