Skip to content

An open-source cross-platform alternative to AirDrop

feat: add donation options (#910)

Tien Do Nama08b88da949d
diff --git a/app/assets/CHANGELOG.md b/app/assets/CHANGELOG.md
index 7b60cf66..9e433fe5 100644
--- a/app/assets/CHANGELOG.md
+++ b/app/assets/CHANGELOG.md
@@ -1,6 +1,7 @@
## 1.13.0 (unreleased)
- feat: ignore duplicate files when selected from file picker (@programmermager)
+- feat: add donation options (@Tienisto)
- i18n: add Greek (@multipetros)
## 1.12.0 (2023-10-25)
diff --git a/app/assets/i18n/_missing_translations_ar.json b/app/assets/i18n/_missing_translations_ar.json
index 69291e3d..163785c4 100644
--- a/app/assets/i18n/_missing_translations_ar.json
+++ b/app/assets/i18n/_missing_translations_ar.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <ar>.",
"After editing this file, you can run 'dart run slang apply --locale=ar' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_bn.json b/app/assets/i18n/_missing_translations_bn.json
index 3df1d548..645fa477 100644
--- a/app/assets/i18n/_missing_translations_bn.json
+++ b/app/assets/i18n/_missing_translations_bn.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <bn>.",
"After editing this file, you can run 'dart run slang apply --locale=bn' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_ca.json b/app/assets/i18n/_missing_translations_ca.json
index 0f620873..3aa994d8 100644
--- a/app/assets/i18n/_missing_translations_ca.json
+++ b/app/assets/i18n/_missing_translations_ca.json
@@ -17,8 +17,23 @@
"colorOptions": {
"oled": "OLED"
}
+ },
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
}
},
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"favoriteDialog": {
"title": "Favorites",
diff --git a/app/assets/i18n/_missing_translations_cs.json b/app/assets/i18n/_missing_translations_cs.json
index 4baf9cdd..0219bd47 100644
--- a/app/assets/i18n/_missing_translations_cs.json
+++ b/app/assets/i18n/_missing_translations_cs.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <cs>.",
"After editing this file, you can run 'dart run slang apply --locale=cs' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_el.json b/app/assets/i18n/_missing_translations_el.json
index dcd86656..d2f26572 100644
--- a/app/assets/i18n/_missing_translations_el.json
+++ b/app/assets/i18n/_missing_translations_el.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <el>.",
"After editing this file, you can run 'dart run slang apply --locale=el' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_es_ES.json b/app/assets/i18n/_missing_translations_es_ES.json
index b72625b9..72c0c0a8 100644
--- a/app/assets/i18n/_missing_translations_es_ES.json
+++ b/app/assets/i18n/_missing_translations_es_ES.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <es-ES>.",
"After editing this file, you can run 'dart run slang apply --locale=es-ES' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_eu.json b/app/assets/i18n/_missing_translations_eu.json
index 332335ec..99ba663a 100644
--- a/app/assets/i18n/_missing_translations_eu.json
+++ b/app/assets/i18n/_missing_translations_eu.json
@@ -3,6 +3,23 @@
"Here are translations that exist in <en> but not in <eu>.",
"After editing this file, you can run 'dart run slang apply --locale=eu' to quickly apply the newly added translations."
],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"historyClearDialog": {
"title": "Clear history",
diff --git a/app/assets/i18n/_missing_translations_fa.json b/app/assets/i18n/_missing_translations_fa.json
index 68c22596..8789913c 100644
--- a/app/assets/i18n/_missing_translations_fa.json
+++ b/app/assets/i18n/_missing_translations_fa.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <fa>.",
"After editing this file, you can run 'dart run slang apply --locale=fa' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_fil_PH.json b/app/assets/i18n/_missing_translations_fil_PH.json
index b1fc33ef..e6174e5f 100644
--- a/app/assets/i18n/_missing_translations_fil_PH.json
+++ b/app/assets/i18n/_missing_translations_fil_PH.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <fil-PH>.",
"After editing this file, you can run 'dart run slang apply --locale=fil-PH' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_fr_FR.json b/app/assets/i18n/_missing_translations_fr_FR.json
index e631b362..8f849314 100644
--- a/app/assets/i18n/_missing_translations_fr_FR.json
+++ b/app/assets/i18n/_missing_translations_fr_FR.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <fr-FR>.",
"After editing this file, you can run 'dart run slang apply --locale=fr-FR' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_he.json b/app/assets/i18n/_missing_translations_he.json
index acb0d4ee..edb887a5 100644
--- a/app/assets/i18n/_missing_translations_he.json
+++ b/app/assets/i18n/_missing_translations_he.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <he>.",
"After editing this file, you can run 'dart run slang apply --locale=he' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_hu.json b/app/assets/i18n/_missing_translations_hu.json
index 1cb8814a..60185510 100644
--- a/app/assets/i18n/_missing_translations_hu.json
+++ b/app/assets/i18n/_missing_translations_hu.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <hu>.",
"After editing this file, you can run 'dart run slang apply --locale=hu' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_id.json b/app/assets/i18n/_missing_translations_id.json
index 5117770f..aff018b9 100644
--- a/app/assets/i18n/_missing_translations_id.json
+++ b/app/assets/i18n/_missing_translations_id.json
@@ -17,8 +17,23 @@
"colorOptions": {
"oled": "OLED"
}
+ },
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
}
},
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"favoriteDialog": {
"title": "Favorites",
diff --git a/app/assets/i18n/_missing_translations_it.json b/app/assets/i18n/_missing_translations_it.json
index ba21f191..0702cd1d 100644
--- a/app/assets/i18n/_missing_translations_it.json
+++ b/app/assets/i18n/_missing_translations_it.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <it>.",
"After editing this file, you can run 'dart run slang apply --locale=it' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_ja.json b/app/assets/i18n/_missing_translations_ja.json
index 907db9a4..a9d88d1d 100644
--- a/app/assets/i18n/_missing_translations_ja.json
+++ b/app/assets/i18n/_missing_translations_ja.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <ja>.",
"After editing this file, you can run 'dart run slang apply --locale=ja' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_km.json b/app/assets/i18n/_missing_translations_km.json
index e0980f2b..a6bb8d9c 100644
--- a/app/assets/i18n/_missing_translations_km.json
+++ b/app/assets/i18n/_missing_translations_km.json
@@ -12,6 +12,23 @@
"clipboard": "Paste"
}
},
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"favoriteDialog": {
"title": "Favorites",
diff --git a/app/assets/i18n/_missing_translations_ko.json b/app/assets/i18n/_missing_translations_ko.json
index 5d6de783..29776cf4 100644
--- a/app/assets/i18n/_missing_translations_ko.json
+++ b/app/assets/i18n/_missing_translations_ko.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <ko>.",
"After editing this file, you can run 'dart run slang apply --locale=ko' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_ne.json b/app/assets/i18n/_missing_translations_ne.json
index 3fec6223..e030c8c2 100644
--- a/app/assets/i18n/_missing_translations_ne.json
+++ b/app/assets/i18n/_missing_translations_ne.json
@@ -17,8 +17,23 @@
"colorOptions": {
"oled": "OLED"
}
+ },
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
}
},
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"favoriteDialog": {
"title": "Favorites",
diff --git a/app/assets/i18n/_missing_translations_nl.json b/app/assets/i18n/_missing_translations_nl.json
index 92901284..8be292e7 100644
--- a/app/assets/i18n/_missing_translations_nl.json
+++ b/app/assets/i18n/_missing_translations_nl.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <nl>.",
"After editing this file, you can run 'dart run slang apply --locale=nl' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_pl.json b/app/assets/i18n/_missing_translations_pl.json
index 0da0da9a..b7982586 100644
--- a/app/assets/i18n/_missing_translations_pl.json
+++ b/app/assets/i18n/_missing_translations_pl.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <pl>.",
"After editing this file, you can run 'dart run slang apply --locale=pl' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_pt_BR.json b/app/assets/i18n/_missing_translations_pt_BR.json
index a65b7c1e..e09a8fcb 100644
--- a/app/assets/i18n/_missing_translations_pt_BR.json
+++ b/app/assets/i18n/_missing_translations_pt_BR.json
@@ -3,6 +3,23 @@
"Here are translations that exist in <en> but not in <pt-BR>.",
"After editing this file, you can run 'dart run slang apply --locale=pt-BR' to quickly apply the newly added translations."
],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"historyClearDialog": {
"title": "Clear history",
diff --git a/app/assets/i18n/_missing_translations_ru.json b/app/assets/i18n/_missing_translations_ru.json
index d69f5f8c..6f53b5bc 100644
--- a/app/assets/i18n/_missing_translations_ru.json
+++ b/app/assets/i18n/_missing_translations_ru.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <ru>.",
"After editing this file, you can run 'dart run slang apply --locale=ru' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_sv.json b/app/assets/i18n/_missing_translations_sv.json
index 9b3cc314..6d3f9a58 100644
--- a/app/assets/i18n/_missing_translations_sv.json
+++ b/app/assets/i18n/_missing_translations_sv.json
@@ -17,8 +17,23 @@
"colorOptions": {
"oled": "OLED"
}
+ },
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
}
},
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"favoriteDialog": {
"title": "Favorites",
diff --git a/app/assets/i18n/_missing_translations_th.json b/app/assets/i18n/_missing_translations_th.json
index ab20ca6f..5f63ac86 100644
--- a/app/assets/i18n/_missing_translations_th.json
+++ b/app/assets/i18n/_missing_translations_th.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <th>.",
"After editing this file, you can run 'dart run slang apply --locale=th' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_tr.json b/app/assets/i18n/_missing_translations_tr.json
index 98fbaeb1..5bb50bcb 100644
--- a/app/assets/i18n/_missing_translations_tr.json
+++ b/app/assets/i18n/_missing_translations_tr.json
@@ -3,6 +3,23 @@
"Here are translations that exist in <en> but not in <tr>.",
"After editing this file, you can run 'dart run slang apply --locale=tr' to quickly apply the newly added translations."
],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"historyClearDialog": {
"title": "Clear history",
diff --git a/app/assets/i18n/_missing_translations_uk.json b/app/assets/i18n/_missing_translations_uk.json
index 4eb0fee1..e2fb4a19 100644
--- a/app/assets/i18n/_missing_translations_uk.json
+++ b/app/assets/i18n/_missing_translations_uk.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <uk>.",
"After editing this file, you can run 'dart run slang apply --locale=uk' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_ur.json b/app/assets/i18n/_missing_translations_ur.json
index e46c296f..55997045 100644
--- a/app/assets/i18n/_missing_translations_ur.json
+++ b/app/assets/i18n/_missing_translations_ur.json
@@ -17,8 +17,23 @@
"colorOptions": {
"oled": "OLED"
}
+ },
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
}
},
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"dialogs": {
"favoriteDialog": {
"title": "Favorites",
diff --git a/app/assets/i18n/_missing_translations_vi.json b/app/assets/i18n/_missing_translations_vi.json
index 23aabe21..118698ef 100644
--- a/app/assets/i18n/_missing_translations_vi.json
+++ b/app/assets/i18n/_missing_translations_vi.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <vi>.",
"After editing this file, you can run 'dart run slang apply --locale=vi' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_zh_CN.json b/app/assets/i18n/_missing_translations_zh_CN.json
index babbeb2b..a30d5ceb 100644
--- a/app/assets/i18n/_missing_translations_zh_CN.json
+++ b/app/assets/i18n/_missing_translations_zh_CN.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <zh-CN>.",
"After editing this file, you can run 'dart run slang apply --locale=zh-CN' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_zh_HK.json b/app/assets/i18n/_missing_translations_zh_HK.json
index 00c8a7ff..fc6fcdbb 100644
--- a/app/assets/i18n/_missing_translations_zh_HK.json
+++ b/app/assets/i18n/_missing_translations_zh_HK.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <zh-HK>.",
"After editing this file, you can run 'dart run slang apply --locale=zh-HK' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/_missing_translations_zh_TW.json b/app/assets/i18n/_missing_translations_zh_TW.json
index 2989e35b..05e1acd3 100644
--- a/app/assets/i18n/_missing_translations_zh_TW.json
+++ b/app/assets/i18n/_missing_translations_zh_TW.json
@@ -2,5 +2,22 @@
"@@info": [
"Here are translations that exist in <en> but not in <zh-TW>.",
"After editing this file, you can run 'dart run slang apply --locale=zh-TW' to quickly apply the newly added translations."
- ]
+ ],
+ "settingsTab": {
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ }
+ },
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ }
}
diff --git a/app/assets/i18n/strings.i18n.json b/app/assets/i18n/strings.i18n.json
index ca004e4c..d5295599 100644
--- a/app/assets/i18n/strings.i18n.json
+++ b/app/assets/i18n/strings.i18n.json
@@ -123,6 +123,14 @@
"multicastGroup": "Multicast",
"multicastGroupWarning": "You might not be detected by other devices because you are using a custom multicast address. (default: {defaultMulticast})"
},
+ "other": {
+ "title": "Other",
+ "about": "About",
+ "support": "Support LocalSend",
+ "donate": "Donate",
+ "privacyPolicy": "Privacy Policy",
+ "termsOfUse": "Terms of Use"
+ },
"advancedSettings": "Advanced settings"
},
"troubleshootPage": {
@@ -215,6 +223,13 @@
"aboutPage": {
"title": "About LocalSend"
},
+ "donationPage": {
+ "title": "Donate",
+ "info": "LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.",
+ "donate": "Donate {amount}",
+ "thanks": "Thank you very much!",
+ "restore": "Restore purchase"
+ },
"changelogPage": {
"title": "Changelog"
},
diff --git a/app/assets/i18n/strings_de.i18n.json b/app/assets/i18n/strings_de.i18n.json
index e4ff586f..d5ff2249 100644
--- a/app/assets/i18n/strings_de.i18n.json
+++ b/app/assets/i18n/strings_de.i18n.json
@@ -123,6 +123,14 @@
"multicastGroup": "Multicast",
"multicastGroupWarning": "Möglicherweise wirst du von anderen Geräten nicht erkannt, weil du eine benutzerdefinierte Multicast-Adresse verwendest. (Standard: {defaultMulticast})"
},
+ "other": {
+ "title": "Weitere",
+ "about": "Über",
+ "support": "LocalSend unterstützen",
+ "donate": "Spenden",
+ "privacyPolicy": "Datenschutzerklärung",
+ "termsOfUse": "Nutzungsbedingungen"
+ },
"advancedSettings": "Erweiterte Einstellungen"
},
"troubleshootPage": {
@@ -215,6 +223,13 @@
"aboutPage": {
"title": "Über LocalSend"
},
+ "donationPage": {
+ "title": "Spenden",
+ "info": "LocalSend ist kostenlos, open-source und frei von Werbung. Wenn dir diese App gefällt, kannst du die Entwicklung mit einer Spende unterstützen.",
+ "donate": "Spende {amount}",
+ "thanks": "Vielen Dank für deine Unterstützung!",
+ "restore": "Käufe Wiederherstellen"
+ },
"changelogPage": {
"title": "Changelog"
},
diff --git a/app/ios/MyLocalSendStoreKit.storekit b/app/ios/MyLocalSendStoreKit.storekit
new file mode 100644
index 00000000..ea71637c
--- /dev/null
+++ b/app/ios/MyLocalSendStoreKit.storekit
@@ -0,0 +1,130 @@
+{
+ "identifier" : "D8FDEAE9",
+ "nonRenewingSubscriptions" : [
+
+ ],
+ "products" : [
+ {
+ "displayPrice" : "4.0",
+ "familyShareable" : false,
+ "internalID" : "6472594578",
+ "localizations" : [
+ {
+ "description" : "LocalSend Donation",
+ "displayName" : "LocalSend Donation",
+ "locale" : "en_US"
+ }
+ ],
+ "productID" : "localsend_ios_donate_5",
+ "referenceName" : "LocalSend Donation (05)",
+ "type" : "NonConsumable"
+ },
+ {
+ "displayPrice" : "9.0",
+ "familyShareable" : false,
+ "internalID" : "6472594779",
+ "localizations" : [
+ {
+ "description" : "LocalSend Donation",
+ "displayName" : "LocalSend Donation",
+ "locale" : "en_US"
+ }
+ ],
+ "productID" : "localsend_ios_donate_10",
+ "referenceName" : "LocalSend Donation (10)",
+ "type" : "NonConsumable"
+ },
+ {
+ "displayPrice" : "18.0",
+ "familyShareable" : false,
+ "internalID" : "6472594819",
+ "localizations" : [
+ {
+ "description" : "LocalSend Donation",
+ "displayName" : "LocalSend Donation",
+ "locale" : "en_US"
+ }
+ ],
+ "productID" : "localsend_ios_donate_20",
+ "referenceName" : "LocalSend Donation (20)",
+ "type" : "NonConsumable"
+ },
+ {
+ "displayPrice" : "45.0",
+ "familyShareable" : false,
+ "internalID" : "6472595571",
+ "localizations" : [
+ {
+ "description" : "LocalSend Donation",
+ "displayName" : "LocalSend Donation",
+ "locale" : "en_US"
+ }
+ ],
+ "productID" : "localsend_ios_donate_50",
+ "referenceName" : "LocalSend Donation (50)",
+ "type" : "NonConsumable"
+ }
+ ],
+ "settings" : {
+ "_applicationInternalID" : "1661733229",
+ "_developerTeamID" : "3W7H4PYMCV",
+ "_failTransactionsEnabled" : false,
+ "_lastSynchronizedDate" : 722014387.19710302,
+ "_locale" : "en_US",
+ "_storefront" : "USA",
+ "_storeKitErrors" : [
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Load Products"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Purchase"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Verification"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "App Store Sync"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Subscription Status"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "App Transaction"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Manage Subscriptions Sheet"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Refund Request Sheet"
+ },
+ {
+ "current" : null,
+ "enabled" : false,
+ "name" : "Offer Code Redeem Sheet"
+ }
+ ]
+ },
+ "subscriptionGroups" : [
+
+ ],
+ "version" : {
+ "major" : 3,
+ "minor" : 0
+ }
+}
diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock
index c8f09f0d..3e0d98a5 100644
--- a/app/ios/Podfile.lock
+++ b/app/ios/Podfile.lock
@@ -46,6 +46,9 @@ PODS:
- FlutterMacOS
- image_picker_ios (0.0.1):
- Flutter
+ - in_app_purchase_storekit (0.0.1):
+ - Flutter
+ - FlutterMacOS
- network_info_plus (0.0.1):
- Flutter
- open_filex (0.0.2):
@@ -96,6 +99,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- gal (from `.symlinks/plugins/gal/darwin`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
+ - in_app_purchase_storekit (from `.symlinks/plugins/in_app_purchase_storekit/darwin`)
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
@@ -134,6 +138,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/gal/darwin"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
+ in_app_purchase_storekit:
+ :path: ".symlinks/plugins/in_app_purchase_storekit/darwin"
network_info_plus:
:path: ".symlinks/plugins/network_info_plus/ios"
open_filex:
@@ -173,6 +179,7 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
+ in_app_purchase_storekit: 4fb7ee9e824b1f09107fbfbbce8c4b276366dc43
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj
index ecb13555..5ed02d42 100644
--- a/app/ios/Runner.xcodeproj/project.pbxproj
+++ b/app/ios/Runner.xcodeproj/project.pbxproj
@@ -14,6 +14,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
7DA3203436DA0EAD484C6129 /* Pods_ShareExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 052009B9C8E63670A6F30787 /* Pods_ShareExtension.framework */; };
+ 840EA3FC2B0910B000C0FED7 /* MyLocalSendStoreKit.storekit in Resources */ = {isa = PBXBuildFile; fileRef = 840EA3FB2B0910B000C0FED7 /* MyLocalSendStoreKit.storekit */; };
841A12B929EC22BD00B99343 /* LocalNetworkAuthorization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841A12B829EC22BD00B99343 /* LocalNetworkAuthorization.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -73,6 +74,7 @@
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
+ 840EA3FB2B0910B000C0FED7 /* MyLocalSendStoreKit.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = MyLocalSendStoreKit.storekit; sourceTree = "<group>"; };
841A12B829EC22BD00B99343 /* LocalNetworkAuthorization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNetworkAuthorization.swift; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -144,6 +146,7 @@
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
+ 840EA3FB2B0910B000C0FED7 /* MyLocalSendStoreKit.storekit */,
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
28D9F9A329638D5E0028B96E /* ShareExtension */,
@@ -288,6 +291,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
+ 840EA3FC2B0910B000C0FED7 /* MyLocalSendStoreKit.storekit in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a6b826db..d029eb5c 100644
--- a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -59,6 +59,9 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
+ <StoreKitConfigurationFileReference
+ identifier = "../MyLocalSendStoreKit.storekit">
+ </StoreKitConfigurationFileReference>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
diff --git a/app/lib/gen/strings.g.dart b/app/lib/gen/strings.g.dart
index f4ae03b3..5bf842bf 100644
--- a/app/lib/gen/strings.g.dart
+++ b/app/lib/gen/strings.g.dart
@@ -4,7 +4,7 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 33
-/// Strings: 8912 (270 per locale)
+/// Strings: 8934 (270 per locale)
// coverage:ignore-file
diff --git a/app/lib/gen/strings_de.g.dart b/app/lib/gen/strings_de.g.dart
index c77f68ce..627d0e02 100644
--- a/app/lib/gen/strings_de.g.dart
+++ b/app/lib/gen/strings_de.g.dart
@@ -37,6 +37,7 @@ class _StringsDe extends _StringsEn {
@override late final _StringsProgressPageDe progressPage = _StringsProgressPageDe._(_root);
@override late final _StringsWebSharePageDe webSharePage = _StringsWebSharePageDe._(_root);
@override late final _StringsAboutPageDe aboutPage = _StringsAboutPageDe._(_root);
+ @override late final _StringsDonationPageDe donationPage = _StringsDonationPageDe._(_root);
@override late final _StringsChangelogPageDe changelogPage = _StringsChangelogPageDe._(_root);
@override late final _StringsAliasGeneratorDe aliasGenerator = _StringsAliasGeneratorDe._(_root);
@override late final _StringsDialogsDe dialogs = _StringsDialogsDe._(_root);
@@ -134,6 +135,7 @@ class _StringsSettingsTabDe extends _StringsSettingsTabEn {
@override late final _StringsSettingsTabGeneralDe general = _StringsSettingsTabGeneralDe._(_root);
@override late final _StringsSettingsTabReceiveDe receive = _StringsSettingsTabReceiveDe._(_root);
@override late final _StringsSettingsTabNetworkDe network = _StringsSettingsTabNetworkDe._(_root);
+ @override late final _StringsSettingsTabOtherDe other = _StringsSettingsTabOtherDe._(_root);
@override String get advancedSettings => 'Erweiterte Einstellungen';
}
@@ -276,6 +278,20 @@ class _StringsAboutPageDe extends _StringsAboutPageEn {
@override String get title => 'Über LocalSend';
}
+// Path: donationPage
+class _StringsDonationPageDe extends _StringsDonationPageEn {
+ _StringsDonationPageDe._(_StringsDe root) : this._root = root, super._(root);
+
+ @override final _StringsDe _root; // ignore: unused_field
+
+ // Translations
+ @override String get title => 'Spenden';
+ @override String get info => 'LocalSend ist kostenlos, open-source und frei von Werbung. Wenn dir diese App gefällt, kannst du die Entwicklung mit einer Spende unterstützen.';
+ @override String donate({required Object amount}) => 'Spende ${amount}';
+ @override String get thanks => 'Vielen Dank für deine Unterstützung!';
+ @override String get restore => 'Käufe Wiederherstellen';
+}
+
// Path: changelogPage
class _StringsChangelogPageDe extends _StringsChangelogPageEn {
_StringsChangelogPageDe._(_StringsDe root) : this._root = root, super._(root);
@@ -494,6 +510,21 @@ class _StringsSettingsTabNetworkDe extends _StringsSettingsTabNetworkEn {
@override String multicastGroupWarning({required Object defaultMulticast}) => 'Möglicherweise wirst du von anderen Geräten nicht erkannt, weil du eine benutzerdefinierte Multicast-Adresse verwendest. (Standard: ${defaultMulticast})';
}
+// Path: settingsTab.other
+class _StringsSettingsTabOtherDe extends _StringsSettingsTabOtherEn {
+ _StringsSettingsTabOtherDe._(_StringsDe root) : this._root = root, super._(root);
+
+ @override final _StringsDe _root; // ignore: unused_field
+
+ // Translations
+ @override String get title => 'Weitere';
+ @override String get about => 'Über';
+ @override String get support => 'LocalSend unterstützen';
+ @override String get donate => 'Spenden';
+ @override String get privacyPolicy => 'Datenschutzerklärung';
+ @override String get termsOfUse => 'Nutzungsbedingungen';
+}
+
// Path: troubleshootPage.firewall
class _StringsTroubleshootPageFirewallDe extends _StringsTroubleshootPageFirewallEn {
_StringsTroubleshootPageFirewallDe._(_StringsDe root) : this._root = root, super._(root);
diff --git a/app/lib/gen/strings_en.g.dart b/app/lib/gen/strings_en.g.dart
index 2ed479e9..02ded6f7 100644
--- a/app/lib/gen/strings_en.g.dart
+++ b/app/lib/gen/strings_en.g.dart
@@ -36,6 +36,7 @@ class _StringsEn implements BaseTranslations<AppLocale, _StringsEn> {
late final _StringsProgressPageEn progressPage = _StringsProgressPageEn._(_root);
late final _StringsWebSharePageEn webSharePage = _StringsWebSharePageEn._(_root);
late final _StringsAboutPageEn aboutPage = _StringsAboutPageEn._(_root);
+ late final _StringsDonationPageEn donationPage = _StringsDonationPageEn._(_root);
late final _StringsChangelogPageEn changelogPage = _StringsChangelogPageEn._(_root);
late final _StringsAliasGeneratorEn aliasGenerator = _StringsAliasGeneratorEn._(_root);
late final _StringsDialogsEn dialogs = _StringsDialogsEn._(_root);
@@ -133,6 +134,7 @@ class _StringsSettingsTabEn {
late final _StringsSettingsTabGeneralEn general = _StringsSettingsTabGeneralEn._(_root);
late final _StringsSettingsTabReceiveEn receive = _StringsSettingsTabReceiveEn._(_root);
late final _StringsSettingsTabNetworkEn network = _StringsSettingsTabNetworkEn._(_root);
+ late final _StringsSettingsTabOtherEn other = _StringsSettingsTabOtherEn._(_root);
String get advancedSettings => 'Advanced settings';
}
@@ -275,6 +277,20 @@ class _StringsAboutPageEn {
String get title => 'About LocalSend';
}
+// Path: donationPage
+class _StringsDonationPageEn {
+ _StringsDonationPageEn._(this._root);
+
+ final _StringsEn _root; // ignore: unused_field
+
+ // Translations
+ String get title => 'Donate';
+ String get info => 'LocalSend is free, open source and without any ads. If you like the app, you can support the development with a donation.';
+ String donate({required Object amount}) => 'Donate ${amount}';
+ String get thanks => 'Thank you very much!';
+ String get restore => 'Restore purchase';
+}
+
// Path: changelogPage
class _StringsChangelogPageEn {
_StringsChangelogPageEn._(this._root);
@@ -564,6 +580,21 @@ class _StringsSettingsTabNetworkEn {
String multicastGroupWarning({required Object defaultMulticast}) => 'You might not be detected by other devices because you are using a custom multicast address. (default: ${defaultMulticast})';
}
+// Path: settingsTab.other
+class _StringsSettingsTabOtherEn {
+ _StringsSettingsTabOtherEn._(this._root);
+
+ final _StringsEn _root; // ignore: unused_field
+
+ // Translations
+ String get title => 'Other';
+ String get about => 'About';
+ String get support => 'Support LocalSend';
+ String get donate => 'Donate';
+ String get privacyPolicy => 'Privacy Policy';
+ String get termsOfUse => 'Terms of Use';
+}
+
// Path: troubleshootPage.firewall
class _StringsTroubleshootPageFirewallEn {
_StringsTroubleshootPageFirewallEn._(this._root);
diff --git a/app/lib/init.dart b/app/lib/init.dart
index 555dd615..b37998e2 100644
--- a/app/lib/init.dart
+++ b/app/lib/init.dart
@@ -15,6 +15,7 @@ import 'package:localsend_app/provider/dio_provider.dart';
import 'package:localsend_app/provider/network/nearby_devices_provider.dart';
import 'package:localsend_app/provider/network/server/server_provider.dart';
import 'package:localsend_app/provider/persistence_provider.dart';
+import 'package:localsend_app/provider/purchase_provider.dart';
import 'package:localsend_app/provider/selection/selected_sending_files_provider.dart';
import 'package:localsend_app/provider/tv_provider.dart';
import 'package:localsend_app/provider/window_dimensions_provider.dart';
@@ -171,6 +172,12 @@ Future<void> postInit(BuildContext context, Ref ref, bool appStart, void Functio
// If we received a share intent, then don't clear it, otherwise the shared file will be lost.
ref.dispatch(ClearCacheAction());
}
+
+
+ if (checkPlatformSupportPayment()) {
+ // ignore: unawaited_futures
+ ref.redux(purchaseProvider).dispatchAsync(InitPurchaseStream());
+ }
}
class _HandleShareIntentAction extends AsyncGlobalAction {
diff --git a/app/lib/model/state/purchase_state.dart b/app/lib/model/state/purchase_state.dart
new file mode 100644
index 00000000..37ae5723
--- /dev/null
+++ b/app/lib/model/state/purchase_state.dart
@@ -0,0 +1,47 @@
+import 'package:dart_mappable/dart_mappable.dart';
+import 'package:flutter/foundation.dart';
+import 'package:in_app_purchase/in_app_purchase.dart';
+
+part 'purchase_state.mapper.dart';
+
+enum PurchaseItem {
+ donate5(
+ androidId: 'localsend_android_donate_5',
+ iosId: 'localsend_ios_donate_5',
+ ),
+ donate10(
+ androidId: 'localsend_android_donate_10',
+ iosId: 'localsend_ios_donate_10',
+ ),
+ donate20(
+ androidId: 'localsend_android_donate_20',
+ iosId: 'localsend_ios_donate_20',
+ ),
+ donate50(
+ androidId: 'localsend_android_donate_50',
+ iosId: 'localsend_ios_donate_50',
+ );
+
+ const PurchaseItem({
+ required this.androidId,
+ required this.iosId,
+ });
+
+ final String androidId;
+ final String iosId;
+
+ String get platformProductId => defaultTargetPlatform == TargetPlatform.android ? androidId : iosId;
+}
+
+@MappableClass()
+class PurchaseState with PurchaseStateMappable {
+ final Map<PurchaseItem, String> prices;
+ final Map<PurchaseItem, PurchaseDetails> purchases;
+ final bool pending;
+
+ const PurchaseState({
+ required this.prices,
+ required this.purchases,
+ required this.pending,
+ });
+}
diff --git a/app/lib/model/state/purchase_state.mapper.dart b/app/lib/model/state/purchase_state.mapper.dart
new file mode 100644
index 00000000..75b46280
--- /dev/null
+++ b/app/lib/model/state/purchase_state.mapper.dart
@@ -0,0 +1,150 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element
+
+part of 'purchase_state.dart';
+
+class PurchaseStateMapper extends ClassMapperBase<PurchaseState> {
+ PurchaseStateMapper._();
+
+ static PurchaseStateMapper? _instance;
+ static PurchaseStateMapper ensureInitialized() {
+ if (_instance == null) {
+ MapperContainer.globals.use(_instance = PurchaseStateMapper._());
+ }
+ return _instance!;
+ }
+
+ static T _guard<T>(T Function(MapperContainer) fn) {
+ ensureInitialized();
+ return fn(MapperContainer.globals);
+ }
+
+ @override
+ final String id = 'PurchaseState';
+
+ static Map<PurchaseItem, String> _$prices(PurchaseState v) => v.prices;
+ static const Field<PurchaseState, Map<PurchaseItem, String>> _f$prices =
+ Field('prices', _$prices);
+ static Map<PurchaseItem, PurchaseDetails> _$purchases(PurchaseState v) =>
+ v.purchases;
+ static const Field<PurchaseState, Map<PurchaseItem, PurchaseDetails>>
+ _f$purchases = Field('purchases', _$purchases);
+ static bool _$pending(PurchaseState v) => v.pending;
+ static const Field<PurchaseState, bool> _f$pending =
+ Field('pending', _$pending);
+
+ @override
+ final Map<Symbol, Field<PurchaseState, dynamic>> fields = const {
+ #prices: _f$prices,
+ #purchases: _f$purchases,
+ #pending: _f$pending,
+ };
+
+ static PurchaseState _instantiate(DecodingData data) {
+ return PurchaseState(
+ prices: data.dec(_f$prices),
+ purchases: data.dec(_f$purchases),
+ pending: data.dec(_f$pending));
+ }
+
+ @override
+ final Function instantiate = _instantiate;
+
+ static PurchaseState fromJson(Map<String, dynamic> map) {
+ return _guard((c) => c.fromMap<PurchaseState>(map));
+ }
+
+ static PurchaseState deserialize(String json) {
+ return _guard((c) => c.fromJson<PurchaseState>(json));
+ }
+}
+
+mixin PurchaseStateMappable {
+ String serialize() {
+ return PurchaseStateMapper._guard((c) => c.toJson(this as PurchaseState));
+ }
+
+ Map<String, dynamic> toJson() {
+ return PurchaseStateMapper._guard((c) => c.toMap(this as PurchaseState));
+ }
+
+ PurchaseStateCopyWith<PurchaseState, PurchaseState, PurchaseState>
+ get copyWith => _PurchaseStateCopyWithImpl(
+ this as PurchaseState, $identity, $identity);
+ @override
+ String toString() {
+ return PurchaseStateMapper._guard((c) => c.asString(this));
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (runtimeType == other.runtimeType &&
+ PurchaseStateMapper._guard((c) => c.isEqual(this, other)));
+ }
+
+ @override
+ int get hashCode {
+ return PurchaseStateMapper._guard((c) => c.hash(this));
+ }
+}
+
+extension PurchaseStateValueCopy<$R, $Out>
+ on ObjectCopyWith<$R, PurchaseState, $Out> {
+ PurchaseStateCopyWith<$R, PurchaseState, $Out> get $asPurchaseState =>
+ $base.as((v, t, t2) => _PurchaseStateCopyWithImpl(v, t, t2));
+}
+
+abstract class PurchaseStateCopyWith<$R, $In extends PurchaseState, $Out>
+ implements ClassCopyWith<$R, $In, $Out> {
+ MapCopyWith<$R, PurchaseItem, String, ObjectCopyWith<$R, String, String>>
+ get prices;
+ MapCopyWith<$R, PurchaseItem, PurchaseDetails,
+ ObjectCopyWith<$R, PurchaseDetails, PurchaseDetails>> get purchases;
+ $R call(
+ {Map<PurchaseItem, String>? prices,
+ Map<PurchaseItem, PurchaseDetails>? purchases,
+ bool? pending});
+ PurchaseStateCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
+}
+
+class _PurchaseStateCopyWithImpl<$R, $Out>
+ extends ClassCopyWithBase<$R, PurchaseState, $Out>
+ implements PurchaseStateCopyWith<$R, PurchaseState, $Out> {
+ _PurchaseStateCopyWithImpl(super.value, super.then, super.then2);
+
+ @override
+ late final ClassMapperBase<PurchaseState> $mapper =
+ PurchaseStateMapper.ensureInitialized();
+ @override
+ MapCopyWith<$R, PurchaseItem, String, ObjectCopyWith<$R, String, String>>
+ get prices => MapCopyWith($value.prices,
+ (v, t) => ObjectCopyWith(v, $identity, t), (v) => call(prices: v));
+ @override
+ MapCopyWith<$R, PurchaseItem, PurchaseDetails,
+ ObjectCopyWith<$R, PurchaseDetails, PurchaseDetails>>
+ get purchases => MapCopyWith($value.purchases,
+ (v, t) => ObjectCopyWith(v, $identity, t), (v) => call(purchases: v));
+ @override
+ $R call(
+ {Map<PurchaseItem, String>? prices,
+ Map<PurchaseItem, PurchaseDetails>? purchases,
+ bool? pending}) =>
+ $apply(FieldCopyWithData({
+ if (prices != null) #prices: prices,
+ if (purchases != null) #purchases: purchases,
+ if (pending != null) #pending: pending
+ }));
+ @override
+ PurchaseState $make(CopyWithData data) => PurchaseState(
+ prices: data.get(#prices, or: $value.prices),
+ purchases: data.get(#purchases, or: $value.purchases),
+ pending: data.get(#pending, or: $value.pending));
+
+ @override
+ PurchaseStateCopyWith<$R2, PurchaseState, $Out2> $chain<$R2, $Out2>(
+ Then<$Out2, $R2> t) =>
+ _PurchaseStateCopyWithImpl($value, $cast, t);
+}
diff --git a/app/lib/pages/donation/donation_page.dart b/app/lib/pages/donation/donation_page.dart
new file mode 100644
index 00000000..d3ffe344
--- /dev/null
+++ b/app/lib/pages/donation/donation_page.dart
@@ -0,0 +1,110 @@
+import 'package:flutter/material.dart';
+import 'package:localsend_app/gen/strings.g.dart';
+import 'package:localsend_app/model/state/purchase_state.dart';
+import 'package:localsend_app/pages/donation/donation_page_vm.dart';
+import 'package:localsend_app/provider/purchase_provider.dart';
+import 'package:localsend_app/util/native/platform_check.dart';
+import 'package:localsend_app/widget/responsive_list_view.dart';
+import 'package:refena_flutter/refena_flutter.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class DonationPage extends StatelessWidget {
+ const DonationPage({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return ViewModelBuilder(
+ provider: donationPageVmProvider,
+ init: (context, ref) => ref.redux(purchaseProvider).dispatchAsync(FetchPricesAndPurchasesAction()), // ignore: discarded_futures
+ builder: (context, vm) {
+ return Scaffold(
+ appBar: AppBar(
+ title: Text(t.donationPage.title),
+ ),
+ body: ResponsiveListView(
+ padding: const EdgeInsets.symmetric(horizontal: 20),
+ children: [
+ const SizedBox(height: 50),
+ Center(
+ child: Text(
+ t.donationPage.info,
+ textAlign: TextAlign.center,
+ ),
+ ),
+ const SizedBox(height: 50),
+ if (vm.purchased.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.only(bottom: 20),
+ child: Center(
+ child: Text(
+ t.donationPage.thanks,
+ textAlign: TextAlign.center,
+ style: TextStyle(color: Theme.of(context).colorScheme.primary),
+ ),
+ ),
+ ),
+ if (checkPlatformSupportPayment()) _StoreDonation(vm) else const _LinkDonation(),
+ ],
+ ),
+ );
+ },
+ );
+ }
+}
+
+class _StoreDonation extends StatelessWidget {
+ final DonationPageVm vm;
+
+ const _StoreDonation(this.vm);
+
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ children: [
+ ...PurchaseItem.values.map((item) {
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 10),
+ child: FilledButton.icon(
+ onPressed: vm.purchased.contains(item) ? null : () => vm.purchase(item),
+ icon: const Icon(Icons.favorite),
+ label: Text(t.donationPage.donate(amount: vm.prices[item] ?? '...')),
+ ),
+ );
+ }),
+ const SizedBox(height: 20),
+ TextButton.icon(
+ onPressed: vm.restore,
+ icon: const Icon(Icons.restore),
+ label: Text(t.donationPage.restore),
+ ),
+ ],
+ );
+ }
+}
+
+class _LinkDonation extends StatelessWidget {
+ const _LinkDonation();
+
+ @override
+ Widget build(BuildContext context) {
+ return Wrap(
+ alignment: WrapAlignment.center,
+ children: [
+ TextButton.icon(
+ onPressed: () async {
+ await launchUrl(Uri.parse('https://github.com/sponsors/Tienisto'), mode: LaunchMode.externalApplication);
+ },
+ icon: const Icon(Icons.open_in_new),
+ label: const Text('Github'),
+ ),
+ TextButton.icon(
+ onPressed: () async {
+ await launchUrl(Uri.parse('https://ko-fi.com/tienisto'), mode: LaunchMode.externalApplication);
+ },
+ icon: const Icon(Icons.open_in_new),
+ label: const Text('Ko-fi'),
+ ),
+ ],
+ );
+ }
+}
diff --git a/app/lib/pages/donation/donation_page_vm.dart b/app/lib/pages/donation/donation_page_vm.dart
new file mode 100644
index 00000000..b60e2232
--- /dev/null
+++ b/app/lib/pages/donation/donation_page_vm.dart
@@ -0,0 +1,30 @@
+import 'package:localsend_app/model/state/purchase_state.dart';
+import 'package:localsend_app/provider/purchase_provider.dart';
+import 'package:refena_flutter/refena_flutter.dart';
+
+class DonationPageVm {
+ final Map<PurchaseItem, String> prices;
+ final Set<PurchaseItem> purchased;
+ final bool pending;
+ final void Function(PurchaseItem item) purchase;
+ final void Function() restore;
+
+ DonationPageVm({
+ required this.prices,
+ required this.purchased,
+ required this.pending,
+ required this.purchase,
+ required this.restore,
+ });
+}
+
+final donationPageVmProvider = ViewProvider<DonationPageVm>((ref) {
+ final state = ref.watch(purchaseProvider);
+ return DonationPageVm(
+ prices: state.prices,
+ purchased: state.purchases.keys.toSet(),
+ pending: state.pending,
+ purchase: (item) => ref.redux(purchaseProvider).dispatchAsync(PurchaseAction(item)),
+ restore: () => ref.redux(purchaseProvider).dispatchAsync(PurchaseRestoreAction()),
+ );
+});
diff --git a/app/lib/pages/tabs/settings_tab.dart b/app/lib/pages/tabs/settings_tab.dart
index b8aedef5..42d96c21 100644
--- a/app/lib/pages/tabs/settings_tab.dart
+++ b/app/lib/pages/tabs/settings_tab.dart
@@ -5,6 +5,7 @@ import 'package:localsend_app/model/device.dart';
import 'package:localsend_app/model/persistence/color_mode.dart';
import 'package:localsend_app/pages/about_page.dart';
import 'package:localsend_app/pages/changelog_page.dart';
+import 'package:localsend_app/pages/donation/donation_page.dart';
import 'package:localsend_app/pages/language_page.dart';
import 'package:localsend_app/pages/tabs/settings_tab_controller.dart';
import 'package:localsend_app/provider/settings_provider.dart';
@@ -22,6 +23,7 @@ import 'package:localsend_app/widget/local_send_logo.dart';
import 'package:localsend_app/widget/responsive_list_view.dart';
import 'package:refena_flutter/refena_flutter.dart';
import 'package:routerino/routerino.dart';
+import 'package:url_launcher/url_launcher.dart';
final _isLinux = checkPlatform([TargetPlatform.linux]);
final _isWindows = checkPlatform([TargetPlatform.windows]);
@@ -74,24 +76,10 @@ class SettingsTab extends StatelessWidget {
onChanged: vm.onChangeColorMode,
),
),
- _SettingsEntry(
+ _ButtonEntry(
label: t.settingsTab.general.language,
- child: TextButton(
- style: TextButton.styleFrom(
- backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,
- shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),
- foregroundColor: Theme.of(context).colorScheme.onSurface,
- ),
- onPressed: () => vm.onTapLanguage(context),
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 5),
- child: Text(
- vm.settings.locale?.humanName ?? t.settingsTab.general.languageOptions.system,
- style: Theme.of(context).textTheme.titleMedium,
- textAlign: TextAlign.center,
- ),
- ),
- ),
+ buttonLabel: vm.settings.locale?.humanName ?? t.settingsTab.general.languageOptions.system,
+ onTap: () => vm.onTapLanguage(context),
),
if (checkPlatformIsDesktop()) ...[
/// Wayland does window position handling, so there's no need for it. See [https://github.com/localsend/localsend/issues/544]
@@ -237,7 +225,6 @@ class SettingsTab extends StatelessWidget {
),
_SettingsSection(
title: t.settingsTab.network.title,
- padding: const EdgeInsets.only(bottom: 0),
children: [
AnimatedCrossFade(
crossFadeState: vm.serverState != null &&
@@ -397,6 +384,47 @@ class SettingsTab extends StatelessWidget {
),
],
),
+ _SettingsSection(
+ title: t.settingsTab.other.title,
+ padding: const EdgeInsets.only(bottom: 0),
+ children: [
+ _ButtonEntry(
+ label: 'LocalSend',
+ buttonLabel: t.settingsTab.other.about,
+ onTap: () async {
+ await context.push(() => const AboutPage());
+ },
+ ),
+ _ButtonEntry(
+ label: t.settingsTab.other.support,
+ buttonLabel: t.settingsTab.other.donate,
+ onTap: () async {
+ await context.push(() => const DonationPage());
+ },
+ ),
+ _ButtonEntry(
+ label: t.settingsTab.other.privacyPolicy,
+ buttonLabel: t.general.open,
+ onTap: () async {
+ await launchUrl(
+ Uri.parse('https://localsend.org/#/privacy'),
+ mode: LaunchMode.externalApplication,
+ );
+ },
+ ),
+ if (checkPlatform([TargetPlatform.iOS, TargetPlatform.macOS]))
+ _ButtonEntry(
+ label: t.settingsTab.other.termsOfUse,
+ buttonLabel: t.general.open,
+ onTap: () async {
+ await launchUrl(
+ Uri.parse('https://www.apple.com/legal/internet-services/itunes/dev/stdeula/'),
+ mode: LaunchMode.externalApplication,
+ );
+ },
+ ),
+ ],
+ ),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@@ -423,33 +451,16 @@ class SettingsTab extends StatelessWidget {
'© ${DateTime.now().year} Tien Do Nam',
textAlign: TextAlign.center,
),
- const SizedBox(height: 30),
- Theme(
- data: Theme.of(context).copyWith(
- textButtonTheme: TextButtonThemeData(
- style: TextButton.styleFrom(
- foregroundColor: Theme.of(context).colorScheme.onSurface,
- ),
+ Center(
+ child: TextButton.icon(
+ style: TextButton.styleFrom(
+ foregroundColor: Theme.of(context).colorScheme.onSurface,
),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- TextButton.icon(
- onPressed: () async {
- await context.push(() => const AboutPage());
- },
- icon: const Icon(Icons.info),
- label: Text(t.aboutPage.title),
- ),
- TextButton.icon(
- onPressed: () async {
- await context.push(() => const ChangelogPage());
- },
- icon: const Icon(Icons.history),
- label: Text(t.changelogPage.title),
- ),
- ],
+ onPressed: () async {
+ await context.push(() => const ChangelogPage());
+ },
+ icon: const Icon(Icons.history),
+ label: Text(t.changelogPage.title),
),
),
const SizedBox(height: 80),
@@ -531,6 +542,42 @@ class _BooleanEntry extends StatelessWidget {
}
}
+/// A specialized version of [_SettingsEntry].
+class _ButtonEntry extends StatelessWidget {
+ final String label;
+ final String buttonLabel;
+ final void Function() onTap;
+
+ const _ButtonEntry({
+ required this.label,
+ required this.buttonLabel,
+ required this.onTap,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return _SettingsEntry(
+ label: label,
+ child: TextButton(
+ style: TextButton.styleFrom(
+ backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,
+ shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),
+ foregroundColor: Theme.of(context).colorScheme.onSurface,
+ ),
+ onPressed: onTap,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 5),
+ child: Text(
+ buttonLabel,
+ style: Theme.of(context).textTheme.titleMedium,
+ textAlign: TextAlign.center,
+ ),
+ ),
+ ),
+ );
+ }
+}
+
class _SettingsSection extends StatelessWidget {
final String title;
final List<Widget> children;
diff --git a/app/lib/provider/purchase_provider.dart b/app/lib/provider/purchase_provider.dart
new file mode 100644
index 00000000..45d61d19
--- /dev/null
+++ b/app/lib/provider/purchase_provider.dart
@@ -0,0 +1,187 @@
+import 'dart:async';
+
+import 'package:collection/collection.dart';
+import 'package:in_app_purchase/in_app_purchase.dart';
+import 'package:localsend_app/model/state/purchase_state.dart';
+import 'package:refena_flutter/refena_flutter.dart';
+
+final purchaseProvider = ReduxProvider<PurchaseService, PurchaseState>((ref) {
+ return PurchaseService();
+});
+
+class PurchaseService extends ReduxNotifier<PurchaseState> {
+ @override
+ PurchaseState init() => const PurchaseState(
+ prices: {},
+ purchases: {},
+ pending: false,
+ );
+}
+
+class InitPurchaseStream extends AsyncReduxAction<PurchaseService, PurchaseState> {
+ final listening = Completer<void>();
+
+ @override
+ Future<PurchaseState> reduce() async {
+ Future.delayed(Duration.zero, () => listening.complete());
+ await for (final event in InAppPurchase.instance.purchaseStream) {
+ for (final purchase in event) {
+ await dispatchAsync(_HandlePurchaseUpdate(purchase));
+ }
+ }
+ return state;
+ }
+}
+
+class FetchPricesAndPurchasesAction extends AsyncReduxAction<PurchaseService, PurchaseState> {
+ @override
+ Future<PurchaseState> reduce() async {
+ if (state.prices.isNotEmpty) {
+ emitMessage('Already fetched');
+ return state;
+ }
+
+ try {
+ await dispatchAsync(FetchPricesAction());
+ } catch (_) {}
+
+ try {
+ await dispatchAsync(PurchaseRestoreAction());
+ } catch (_) {}
+ return state;
+ }
+}
+
+/// Fetches prices for all products.
+/// They come from the platform's store and vary by country.
+class FetchPricesAction extends AsyncReduxAction<PurchaseService, PurchaseState> {
+ @override
+ Future<PurchaseState> reduce() async {
+ final response = await InAppPurchase.instance.queryProductDetails(PurchaseItem.values.map((e) => e.platformProductId).toSet());
+ final priceMap = <PurchaseItem, String>{};
+ for (final product in response.productDetails) {
+ final item = PurchaseItem.values.firstWhereOrNull((e) => e.platformProductId == product.id);
+ if (item == null) {
+ continue;
+ }
+ priceMap[item] = product.price;
+ }
+ return state.copyWith(
+ prices: priceMap,
+ );
+ }
+}
+
+/// Handles the update information triggered by the purchase flow of the platform.
+class _HandlePurchaseUpdate extends AsyncReduxAction<PurchaseService, PurchaseState> {
+ final PurchaseDetails purchase;
+
+ _HandlePurchaseUpdate(this.purchase);
+
+ @override
+ bool get trackOrigin => false;
+
+ @override
+ Future<PurchaseState> reduce() async {
+ if (purchase.status == PurchaseStatus.pending) {
+ return state.copyWith(pending: true);
+ } else {
+ dispatch(_SetPendingAction(false));
+ }
+
+ if (purchase.status == PurchaseStatus.error) {
+ // ignore: avoid_print
+ throw 'Error purchasing: ${purchase.error?.message}';
+ } else if (purchase.status == PurchaseStatus.purchased || purchase.status == PurchaseStatus.restored) {
+ final purchaseEnum = PurchaseItem.values.firstWhereOrNull((element) => element.platformProductId == purchase.productID);
+ if (purchaseEnum == null) {
+ throw 'Unknown product ID: ${purchase.productID}';
+ }
+ dispatch(AddPurchaseAction(purchaseEnum, purchase));
+ }
+
+ if (purchase.pendingCompletePurchase) {
+ // No need to verify. It's just a donation...
+ await InAppPurchase.instance.completePurchase(purchase);
+ }
+
+ return state;
+ }
+
+ @override
+ String get debugLabel => 'HandlePurchaseUpdate(${purchase.status}, ${purchase.productID})';
+}
+
+class AddPurchaseAction extends ReduxAction<PurchaseService, PurchaseState> {
+ final PurchaseItem item;
+ final PurchaseDetails purchase;
+
+ AddPurchaseAction(this.item, this.purchase);
+
+ @override
+ PurchaseState reduce() {
+ return state.copyWith(
+ purchases: {
+ ...state.purchases,
+ item: purchase,
+ },
+ );
+ }
+}
+
+class _SetPendingAction extends ReduxAction<PurchaseService, PurchaseState> {
+ final bool pending;
+
+ _SetPendingAction(this.pending);
+
+ @override
+ PurchaseState reduce() => state.copyWith(pending: pending);
+}
+
+/// Action to restore purchases.
+/// Dispatched on first app start or manually by the user.
+class PurchaseRestoreAction extends AsyncReduxAction<PurchaseService, PurchaseState> {
+ @override
+ Future<PurchaseState> reduce() async {
+ try {
+ await InAppPurchase.instance.restorePurchases();
+ } catch (_) {}
+ return state;
+ }
+}
+
+/// Action to reset the purchase state.
+/// Only used for testing.
+class PurchaseResetAction extends ReduxAction<PurchaseService, PurchaseState> {
+ @override
+ PurchaseState reduce() => state.copyWith(
+ purchases: {},
+ pending: false,
+ );
+}
+
+/// Initiate the purchase flow for a product.
+/// The actual callbacks are handled by [_HandlePurchaseUpdate].
+class PurchaseAction extends AsyncReduxAction<PurchaseService, PurchaseState> {
+ final PurchaseItem item;
+
+ PurchaseAction(this.item);
+
+ @override
+ Future<PurchaseState> reduce() async {
+ final response = await InAppPurchase.instance.queryProductDetails(<String>{item.platformProductId});
+ final productDetails = response.productDetails.firstOrNull;
+ if (productDetails == null) {
+ throw Exception('Product not found: ${item.platformProductId}');
+ }
+
+ // TODO: Handle changing subscriptions if subscriptions would be added
+ await InAppPurchase.instance.buyNonConsumable(
+ purchaseParam: PurchaseParam(productDetails: productDetails),
+ );
+ return state;
+ }
+
+ @override
+ String get debugLabel => 'BuyAction(${item.name})';
+}
diff --git a/app/lib/util/native/platform_check.dart b/app/lib/util/native/platform_check.dart
index 86e84d29..782923b1 100644
--- a/app/lib/util/native/platform_check.dart
+++ b/app/lib/util/native/platform_check.dart
@@ -54,3 +54,8 @@ bool checkPlatformIsNotWaylandDesktop() {
}
return true;
}
+
+/// This platform supports payment (in-app purchase)
+bool checkPlatformSupportPayment() {
+ return checkPlatform([TargetPlatform.android, TargetPlatform.iOS, TargetPlatform.macOS]);
+}
diff --git a/app/macos/Flutter/GeneratedPluginRegistrant.swift b/app/macos/Flutter/GeneratedPluginRegistrant.swift
index 60fb281d..793aa288 100644
--- a/app/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/app/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -11,6 +11,7 @@ import device_info_plus
import dynamic_color
import file_selector_macos
import gal
+import in_app_purchase_storekit
import network_info_plus
import package_info_plus
import pasteboard
@@ -32,6 +33,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
GalPlugin.register(with: registry.registrar(forPlugin: "GalPlugin"))
+ InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin"))
NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
diff --git a/app/macos/Podfile.lock b/app/macos/Podfile.lock
index 13e6233c..def53945 100644
--- a/app/macos/Podfile.lock
+++ b/app/macos/Podfile.lock
@@ -14,6 +14,9 @@ PODS:
- gal (1.0.0):
- Flutter
- FlutterMacOS
+ - in_app_purchase_storekit (0.0.1):
+ - Flutter
+ - FlutterMacOS
- network_info_plus (0.0.1):
- FlutterMacOS
- package_info_plus (0.0.1):
@@ -54,6 +57,7 @@ DEPENDENCIES:
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- gal (from `Flutter/ephemeral/.symlinks/plugins/gal/darwin`)
+ - in_app_purchase_storekit (from `Flutter/ephemeral/.symlinks/plugins/in_app_purchase_storekit/darwin`)
- network_info_plus (from `Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- pasteboard (from `Flutter/ephemeral/.symlinks/plugins/pasteboard/macos`)
@@ -87,6 +91,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral
gal:
:path: Flutter/ephemeral/.symlinks/plugins/gal/darwin
+ in_app_purchase_storekit:
+ :path: Flutter/ephemeral/.symlinks/plugins/in_app_purchase_storekit/darwin
network_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos
package_info_plus:
@@ -122,6 +128,7 @@ SPEC CHECKSUMS:
file_selector_macos: 468fb6b81fac7c0e88d71317f3eec34c3b008ff9
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
+ in_app_purchase_storekit: 4fb7ee9e824b1f09107fbfbbce8c4b276366dc43
network_info_plus: f4fbc7877ab7b3294500d9441dfa53cd54972d05
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99
diff --git a/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 10111382..664dcdec 100644
--- a/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -59,6 +59,9 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
+ <StoreKitConfigurationFileReference
+ identifier = "../../ios/MyLocalSendStoreKit.storekit">
+ </StoreKitConfigurationFileReference>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
diff --git a/app/macos/Runner.xcworkspace/contents.xcworkspacedata b/app/macos/Runner.xcworkspace/contents.xcworkspacedata
index 21a3cc14..4536ec1d 100644
--- a/app/macos/Runner.xcworkspace/contents.xcworkspacedata
+++ b/app/macos/Runner.xcworkspace/contents.xcworkspacedata
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
+ <FileRef
+ location = "group:../ios/MyLocalSendStoreKit.storekit">
+ </FileRef>
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
diff --git a/app/pubspec.lock b/app/pubspec.lock
index e417ca42..88ff2f04 100644
--- a/app/pubspec.lock
+++ b/app/pubspec.lock
@@ -700,6 +700,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.1+1"
+ in_app_purchase:
+ dependency: "direct main"
+ description:
+ name: in_app_purchase
+ sha256: bdda02b5b11b56d5e29c7f0c57c433db3452b0c8ce1c37cbfcf1de52946efd9f
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.1.11"
+ in_app_purchase_android:
+ dependency: transitive
+ description:
+ name: in_app_purchase_android
+ sha256: c4b84caa4e2c7ffebda444c5033fd8423cc3a45a6e1066929bbbcd4daf665db5
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.3.0+15"
+ in_app_purchase_platform_interface:
+ dependency: transitive
+ description:
+ name: in_app_purchase_platform_interface
+ sha256: "5168afbc54f406f741252b66d41872c1193a0066a6edcb587176290b92e2d537"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.3.6"
+ in_app_purchase_storekit:
+ dependency: transitive
+ description:
+ name: in_app_purchase_storekit
+ sha256: "29526f5ce85bd908b4cacdadb2e8ef299bccbb516b90d2881805343f868502ab"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.3.7"
intl:
dependency: "direct main"
description:
diff --git a/app/pubspec.yaml b/app/pubspec.yaml
index b4db64ef..26f4ab63 100644
--- a/app/pubspec.yaml
+++ b/app/pubspec.yaml
@@ -31,6 +31,7 @@ dependencies:
flutter_markdown: 0.6.18
gal: 2.1.2
image_picker: 1.0.4
+ in_app_purchase: 3.1.11
intl: ^0.18.0 # allow newer versions, so it can compile with newer Flutter versions
launch_at_startup: 0.2.2
logging: 1.2.0