A whole lot of stuff

This commit is contained in:
Courtney Arnold 2026-08-18 11:04:58 -05:00
parent faf319322a
commit ad850d2be6
50 changed files with 3013 additions and 213 deletions

View file

@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../services/app_state.dart';
/// Shown right after a user watches the app's one ad placement (see
/// [AdService.showGateAd] / [AppState.syncNow]) — not on every sync, only
/// the moment an ad was actually just shown to them, since that's when the
/// "you could skip these" pitch is most relevant. Purely informational: it
/// doesn't block or delay the sync that triggered it, which is already
/// proceeding underneath it by the time this appears.
Future<void> showAdFreeUpsellDialog(BuildContext context) {
return showDialog<void>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Tired of Ads?'),
content: Consumer<AppState>(
builder: (context, appState, _) => Text(
appState.adFreeYearPriceLabel == null
? "You can remove ads for a full year with a single one-time purchase."
: 'You can remove ads for a full year for '
'${appState.adFreeYearPriceLabel} — a single one-time purchase.',
),
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Not Now'),
),
FilledButton(
onPressed: () {
Navigator.of(context).pop();
context.read<AppState>().buyAdFreeYear();
},
child: const Text('Remove Ads'),
),
],
),
);
}