elCaribe app - customization and branding

This commit is contained in:
2025-12-12 19:09:42 -04:00
parent 9e5d0d8ebf
commit ba7deac9f3
402 changed files with 31833 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:news/data/models/OtherPageModel.dart';
import 'package:news/data/repositories/OtherPages/otherPagesRepository.dart';
abstract class PrivacyTermsState {}
class PrivacyTermsInitial extends PrivacyTermsState {}
class PrivacyTermsFetchInProgress extends PrivacyTermsState {}
class PrivacyTermsFetchSuccess extends PrivacyTermsState {
final OtherPageModel termsPolicy;
final OtherPageModel privacyPolicy;
PrivacyTermsFetchSuccess({required this.termsPolicy, required this.privacyPolicy});
}
class PrivacyTermsFetchFailure extends PrivacyTermsState {
final String errorMessage;
PrivacyTermsFetchFailure(this.errorMessage);
}
class PrivacyTermsCubit extends Cubit<PrivacyTermsState> {
final OtherPageRepository _otherPageRepository;
PrivacyTermsCubit(this._otherPageRepository) : super(PrivacyTermsInitial());
void getPrivacyTerms({required String langId}) async {
emit(PrivacyTermsFetchInProgress());
try {
final Map<String, dynamic> result = await _otherPageRepository.getPrivacyTermsPage(langId: langId);
emit(PrivacyTermsFetchSuccess(privacyPolicy: OtherPageModel.fromPrivacyTermsJson(result['privacy_policy']), termsPolicy: OtherPageModel.fromPrivacyTermsJson(result['terms_policy'])));
} catch (e) {
emit(PrivacyTermsFetchFailure(e.toString()));
}
}
}