google addin

This commit is contained in:
Jan Pleterski
2026-11-16 11:46:38 +01:00
parent 9463974813
commit d0c44157f1
7 changed files with 905 additions and 18 deletions
+1
View File
@@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<!-- Added by the camera plugin; the app only takes photos (enableAudio: false) --> <!-- Added by the camera plugin; the app only takes photos (enableAudio: false) -->
<uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"/> <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"/>
File diff suppressed because one or more lines are too long
+34 -16
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import '../services/app_settings.dart'; import '../services/app_settings.dart';
import '../utils/translations.dart'; import '../utils/translations.dart';
import '../services/notification_service.dart'; import '../services/notification_service.dart';
@@ -12,6 +13,8 @@ import 'camera_settings_screen.dart';
class SettingsScreen extends StatelessWidget { class SettingsScreen extends StatelessWidget {
const SettingsScreen({super.key}); const SettingsScreen({super.key});
static const _privacyPolicyUrl = 'https://sdkovinarmuta.si/privacy-and-policy/';
static final Future<PackageInfo> _packageInfo = PackageInfo.fromPlatform(); static final Future<PackageInfo> _packageInfo = PackageInfo.fromPlatform();
@override @override
@@ -119,6 +122,17 @@ class SettingsScreen extends StatelessWidget {
), ),
]), ]),
SectionHeader(t('About')),
GroupCard(children: [
SettingsTile(
title: t('Privacy policy'),
onTap: () => launchUrl(
Uri.parse(_privacyPolicyUrl),
mode: LaunchMode.externalApplication,
),
),
]),
const SizedBox(height: 28), const SizedBox(height: 28),
FutureBuilder<PackageInfo>( FutureBuilder<PackageInfo>(
future: _packageInfo, future: _packageInfo,
@@ -233,23 +247,27 @@ class SettingsScreen extends StatelessWidget {
final s = AppSettings.instance; final s = AppSettings.instance;
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
// 7 options exceed the default 9/16 height cap on smaller phones
isScrollControlled: true,
builder: (sheet) => SafeArea( builder: (sheet) => SafeArea(
child: Column( child: SingleChildScrollView(
mainAxisSize: MainAxisSize.min, child: Column(
children: [ mainAxisSize: MainAxisSize.min,
_SheetTitle(s.t('Remind me')), children: [
for (final h in AppSettings.reminderHourOptions) _SheetTitle(s.t('Remind me')),
SheetOption( for (final h in AppSettings.reminderHourOptions)
label: _hoursBefore(h), SheetOption(
selected: h == s.reminderHours, label: _hoursBefore(h),
selectedColor: s.bulletColor, selected: h == s.reminderHours,
onTap: () { selectedColor: s.bulletColor,
s.setReminderHours(h).then((_) => _reschedule()); onTap: () {
Navigator.pop(sheet); s.setReminderHours(h).then((_) => _reschedule());
}, Navigator.pop(sheet);
), },
const SizedBox(height: 8), ),
], const SizedBox(height: 8),
],
),
), ),
), ),
); );
+29 -2
View File
@@ -63,9 +63,34 @@ class NotificationService {
AndroidFlutterLocalNotificationsPlugin>(); AndroidFlutterLocalNotificationsPlugin>();
await androidPlugin?.createNotificationChannel(_channel); await androidPlugin?.createNotificationChannel(_channel);
await requestPermissions(); await requestPermissions();
await _requestExactAlarmsOnce();
} catch (_) {} } catch (_) {}
} }
// Android 12+ needs "Alarms & reminders" access for on-time delivery
// (denied by default on Android 14+). Ask once; without it we fall back
// to inexact alarms, which Android may delay by an hour or more.
Future<void> _requestExactAlarmsOnce() async {
final android = _plugin.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>();
if (android == null) return;
if (await android.canScheduleExactNotifications() ?? true) return;
final prefs = await SharedPreferences.getInstance();
if (prefs.getBool('exactAlarmAsked') ?? false) return;
await prefs.setBool('exactAlarmAsked', true);
await android.requestExactAlarmsPermission();
}
Future<AndroidScheduleMode> _scheduleMode() async {
final android = _plugin.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>();
final canExact = await android?.canScheduleExactNotifications() ?? true;
return canExact
? AndroidScheduleMode.exactAllowWhileIdle
: AndroidScheduleMode.inexactAllowWhileIdle;
}
/// Fetches the calendar and reschedules all reminders. Call on app start /// Fetches the calendar and reschedules all reminders. Call on app start
/// and whenever notification settings change. /// and whenever notification settings change.
Future<void> rescheduleFromCalendar() async { Future<void> rescheduleFromCalendar() async {
@@ -118,6 +143,7 @@ class NotificationService {
final notifyTekma = prefs.getBool('notifyTekma') ?? true; final notifyTekma = prefs.getBool('notifyTekma') ?? true;
final language = prefs.getString('language') ?? 'Slovenian'; final language = prefs.getString('language') ?? 'Slovenian';
final now = DateTime.now(); final now = DateTime.now();
final mode = await _scheduleMode();
await _plugin.cancelAll(); await _plugin.cancelAll();
@@ -143,6 +169,7 @@ class NotificationService {
title: event.summary ?? 'Event', title: event.summary ?? 'Event',
body: _startsIn(hours, language), body: _startsIn(hours, language),
scheduledDate: notifyAt, scheduledDate: notifyAt,
mode: mode,
); );
} }
} }
@@ -167,6 +194,7 @@ class NotificationService {
required String title, required String title,
required String body, required String body,
required DateTime scheduledDate, required DateTime scheduledDate,
required AndroidScheduleMode mode,
}) async { }) async {
final tzDate = tz.TZDateTime.from(scheduledDate, tz.local); final tzDate = tz.TZDateTime.from(scheduledDate, tz.local);
await _plugin.zonedSchedule( await _plugin.zonedSchedule(
@@ -175,8 +203,7 @@ class NotificationService {
body, body,
tzDate, tzDate,
_notifDetails, _notifDetails,
// Inexact: avoids the SCHEDULE_EXACT_ALARM permission (Play policy). androidScheduleMode: mode,
androidScheduleMode: AndroidScheduleMode.inexactAllowWhileIdle,
uiLocalNotificationDateInterpretation: uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime, UILocalNotificationDateInterpretation.absoluteTime,
); );
+10
View File
@@ -192,6 +192,16 @@ class AppTranslations {
}, },
// Camera settings // Camera settings
'About': {
'English': 'About',
'Slovenian': 'O aplikaciji',
'German': 'Über',
},
'Privacy policy': {
'English': 'Privacy policy',
'Slovenian': 'Politika zasebnosti',
'German': 'Datenschutzerklärung',
},
'Camera Settings': { 'Camera Settings': {
'English': 'Camera Settings', 'English': 'Camera Settings',
'Slovenian': 'Nastavitve kamere', 'Slovenian': 'Nastavitve kamere',
+85
View File
@@ -0,0 +1,85 @@
# Google Play listing — SD Kovinar
App name (max 30): **SD Kovinar**
Category: Sports · Free · No ads · Contains no in-app purchases
Website (Store settings → Contact details): https://sdkovinarmuta.si/
Contact email (Store settings → Contact details, shown publicly): dev.bl3kunja@gmail.com
---
## Slovenščina (default)
### Kratek opis (max 80)
Točkovanje tarč s kamero, živi prenos tarče in dnevnik treningov za strelce.
### Celoten opis
SD Kovinar je aplikacija za strelce, ki želijo hitro in natančno spremljati svoje rezultate.
🎯 TOČKOVANJE S KAMERO
Fotografiraj tarčo in aplikacija sama poišče zadetke ter izračuna rezultat. Prepoznavanje poteka v celoti na telefonu, brez interneta.
📷 ŽIVI PRENOS TARČE
Poveži IP kamero na strelišču in spremljaj tarčo v živo med streljanjem, brez hoje do tarče. Podprta je tudi kamera telefona ter več lokacij s kamerami.
📖 KNJIGA REZULTATOV
Vsi treningi in tekmovanja na enem mestu: skupni rezultat, povprečje na strel in na tarčo ter grafi napredka po mesecih in letih.
📤 DELI REZULTAT
Z enim dotikom ustvari sliko tarče z zadetki, točkami in grafom ter jo pošlji prijateljem.
🎨 PO TVOJI MERI
Več vrst tarč (tudi tarča po meri), izbira barve zadetkov, svetla in temna tema (po nastavitvi telefona). Jeziki: slovenščina, angleščina in nemščina.
👥 ZA ČLANE KLUBA
Člani SD Kovinar Muta s klubsko kodo dobijo še koledar treningov z opomniki in kontakte članov.
Brez oglasov, brez računa. Vsi tvoji podatki ostanejo na tvojem telefonu.
---
## English
### Short description (max 80)
Score targets with your camera, watch live target cams and track your training.
### Full description
SD Kovinar is an app for shooters who want to track their results quickly and accurately.
🎯 CAMERA SCORING
Take a photo of your target and the app finds the hits and calculates the score. Detection runs entirely on your phone, no internet needed.
📷 LIVE TARGET VIEW
Connect an IP camera at the range and watch your target live while shooting, without walking to it. Your phone's camera and multiple camera locations are supported too.
📖 RESULT BOOK
All trainings and competitions in one place: total score, average per shot and per target, and progress charts by month and year.
📤 SHARE YOUR RESULT
One tap creates an image of your target with hits, scores and chart, ready to send to friends.
🎨 MAKE IT YOURS
Several target types (including a custom target), hit colour choice, light and dark theme (follows your phone). Languages: Slovenian, English and German.
👥 FOR CLUB MEMBERS
SD Kovinar Muta members with the club code also get the training calendar with reminders and member contacts.
No ads, no account. All your data stays on your phone.
---
## Deutsch (optional)
### Kurzbeschreibung (max 80)
Scheiben per Kamera auswerten, Trefferbild live sehen und Training verfolgen.
---
## Play Console answers (for reference)
- **Data safety:** No data collected. No data shared. (Camera photos are processed on the device; nothing is uploaded.)
- **Ads:** No ads.
- **Target audience:** 18+ (or 13+), not designed for children.
- **Content rating:** sports app; no violence, no user interaction/chat, no purchases.
- **App access:** All core features work without login. Club features (calendar, contacts) need a club code — provide a code for reviewers in "App access" or state they are optional.
- **Account deletion:** Not applicable — the app has no accounts.
- **Privacy policy URL:** https://sdkovinarmuta.si/privacy-and-policy/
+83
View File
@@ -0,0 +1,83 @@
<!doctype html>
<html lang="sl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SD Kovinar – Politika zasebnosti / Privacy Policy</title>
<style>
body { font-family: system-ui, sans-serif; max-width: 720px; margin: 0 auto; padding: 24px 16px; line-height: 1.55; color: #1b1e21; background: #fff; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; margin-top: 1.6em; }
hr { margin: 40px 0; border: none; border-top: 1px solid #ccc; }
.muted { color: #666; font-size: .9rem; }
</style>
</head>
<body>
<h1>Politika zasebnosti – SD Kovinar</h1>
<p class="muted">Velja od: 13. 11. 2026</p>
<p>Aplikacijo SD Kovinar je razvil član strelskega društva <a href="https://sdkovinarmuta.si/">SD Kovinar Muta</a>. Ta stran pojasnjuje, katere podatke aplikacija uporablja.</p>
<h2>Na kratko</h2>
<p>Aplikacija <strong>ne zbira, ne pošilja in ne deli</strong> osebnih podatkov. Nima računov, oglasov ali analitike. Vsi tvoji podatki ostanejo na tvojem telefonu.</p>
<h2>Kamera</h2>
<p>Kamera se uporablja samo za fotografiranje tarče in prikaz v živo. Prepoznavanje zadetkov poteka v celoti na napravi. Slike se nikamor ne pošiljajo.</p>
<h2>Shranjeni podatki</h2>
<p>Rezultati, slike tarč in nastavitve se shranijo samo v pomnilnik aplikacije na tvojem telefonu. Ob odstranitvi aplikacije se izbrišejo.</p>
<h2>IP kamere</h2>
<p>Če dodaš IP kamero, se aplikacija poveže neposredno na naslov, ki ga vneseš sam (običajno v lokalnem omrežju strelišča). Podatki ne gredo prek naših strežnikov.</p>
<h2>Koledar treningov</h2>
<p>Koledar se prenese iz javnega Google koledarja društva, ki je objavljen tudi na <a href="https://sdkovinarmuta.si/">sdkovinarmuta.si</a>. Pri tem Google kot pri vsakem spletnem zahtevku vidi IP naslov naprave. Opomniki se nastavijo lokalno na telefonu.</p>
<h2>Podatki za člane</h2>
<p>Kontakti članov so v aplikaciji šifrirani in so dostopni samo s klubsko kodo. Aplikacija jih ne pošilja nikamor.</p>
<h2>Deljenje</h2>
<p>Ko izbereš »Deli«, aplikacija ustvari sliko rezultata in odpre sistemski meni za deljenje. Kam jo pošlješ, izbereš sam.</p>
<h2>Otroci</h2>
<p>Aplikacija ni namenjena otrokom, mlajšim od 13 let.</p>
<h2>Spremembe in kontakt</h2>
<p>Morebitne spremembe bodo objavljene na tej strani. Vprašanja: <a href="mailto:dev.bl3kunja@gmail.com">dev.bl3kunja@gmail.com</a></p>
<hr>
<h1 lang="en">Privacy Policy – SD Kovinar</h1>
<p class="muted">Effective: 13 November 2026</p>
<p>The SD Kovinar app was developed by a member of the shooting club <a href="https://sdkovinarmuta.si/">SD Kovinar Muta</a>. This page explains what data the app uses.</p>
<h2>In short</h2>
<p>The app <strong>does not collect, transmit or share</strong> personal data. It has no accounts, ads or analytics. All your data stays on your phone.</p>
<h2>Camera</h2>
<p>The camera is used only to photograph targets and for live view. Hit detection runs entirely on the device. Images are never uploaded.</p>
<h2>Stored data</h2>
<p>Results, target images and settings are stored only in the app's private storage on your phone and are deleted when you uninstall the app.</p>
<h2>IP cameras</h2>
<p>If you add an IP camera, the app connects directly to the address you enter (usually on the range's local network). No data passes through our servers.</p>
<h2>Training calendar</h2>
<p>The calendar is downloaded from the club's public Google Calendar, which is also published on <a href="https://sdkovinarmuta.si/">sdkovinarmuta.si</a>. As with any web request, Google sees the device's IP address. Reminders are scheduled locally on the phone.</p>
<h2>Member data</h2>
<p>Member contacts are encrypted inside the app and only accessible with the club code. The app never sends them anywhere.</p>
<h2>Sharing</h2>
<p>When you tap "Share", the app creates a result image and opens the system share menu. You choose where it goes.</p>
<h2>Children</h2>
<p>The app is not directed at children under 13.</p>
<h2>Changes and contact</h2>
<p>Any changes will be published on this page. Questions: <a href="mailto:dev.bl3kunja@gmail.com">dev.bl3kunja@gmail.com</a></p>
</body>
</html>