Logic Module for util functions like cross-platform downloaders and functions to retrieve remote info.
Add it to your package's pubspec.yaml file
dependencies :
xapptor_logic : ^0.0.3
Install packages from the command line
3 - Learn it like a charm
File Downloader (Call Share in Mobile)
FileDownloader .save (
base64_string: pdf_bytes,
file_name: file_name,
);
Check if payments are enabled (Firestore)
Check: for each platform inside "enabled" (android/ios/web)
bool payments_are_enabled = await check_if_payments_are_enabled ();
Check if user is admin (Firestore)
bool user_is_admin = await check_if_user_is_admin (user_id);
create_coupons (times, base_id);
Field Value in Collection
update_field_value_in_collection (field, value, collection);
update_field_name_in_collection (collection, old_field, new_field);
update_field_name_in_document (collection, document, document_id, old_field, new_field);
update_item_value_in_array (document_id, collection_id, field_key, field_value, index);
duplicate_document (document_id, collection_id, times, base_id, apply_random_number);
duplicate_item_in_array (document_id, collection_id, field_key, index, times, callback);
delete_field_in_collection (field, collection);
Delete accounts that don't have gender, birthday, and country field
delete_corrupted_accounts ();
Delete certificates that don't have a user_id registered
delete_corrupted_certificates ();
check_if_coupon_is_valid (
coupon_id,
context,
valid_message,
invalid_message,
);
get_html_certificate (
course_name,
user_name,
date,
id,
);
Check if exist certificate
check_if_exist_certificate (
course_id,
context,
show_has_certificate,
);
save_certificate (
user,
user_info,
course_id,
has_certificate,
show_has_certificate,
context,
);
Check if course was completed
check_if_course_was_completed (
course_id,
user_info,
context,
);
Get main color from image
get_main_color_from_image (image);
Get main color from remote image
get_main_color_from_remote_image (url);
Get main color from remote SVG
get_main_color_from_remote_svg (url);
Check if is portrait mode
Random number between a range
random_number_with_range (min, max);
Get address from position
get_address_from_position ();
send_email (
to,
subject,
text,
html,
);
Convert timestamp to date
timestamp_to_date (time_stamp);
4 - Check Abeinstitute Repo for more examples
Abeinstitute Repo
Abeinstitute