Initial commit — app fidélité magasin (tablette)

App Flutter de programme de fidélité : login staff, clients (nom/prénom),
scan QR, factures (€→points), récompenses, réglages. Backend Supabase
(schéma SQL + RLS anti-triche dans supabase/). Icône incluse.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 21:37:06 +02:00
commit 1d3ee69c6d
60 changed files with 4468 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import '../theme.dart';
import '../utils/format.dart';
/// Petite pastille colorée affichant un solde de points (ex : « 12,5 pts »).
class PastillePoints extends StatelessWidget {
final double valeur;
final bool grande;
const PastillePoints(this.valeur, {super.key, this.grande = false});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: grande ? 16 : 12,
vertical: grande ? 8 : 5,
),
decoration: BoxDecoration(
color: AppTheme.accent.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(30),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.stars_rounded,
size: grande ? 22 : 16, color: AppTheme.accent),
const SizedBox(width: 6),
Text(
points(valeur),
style: TextStyle(
color: AppTheme.accent,
fontWeight: FontWeight.w700,
fontSize: grande ? 18 : 14,
),
),
],
),
);
}
}
+83
View File
@@ -0,0 +1,83 @@
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';
import '../models/client.dart';
import '../services/reglages.dart';
import '../theme.dart';
/// Affiche le QR code d'un client dans une boîte de dialogue. Le client peut le
/// prendre en photo (ou plus tard on l'imprimera) : c'est sa carte de fidélité.
Future<void> afficherQrClient(BuildContext context, Client client) {
final magasin = Reglages.instance.nomMagasin;
return showDialog<void>(
context: context,
builder: (ctx) => Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
child: Padding(
padding: const EdgeInsets.fromLTRB(28, 28, 28, 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (magasin.isNotEmpty)
Text(
magasin,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: AppTheme.grisTexte),
),
const SizedBox(height: 4),
Text(
client.nomComplet,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
),
const SizedBox(height: 20),
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: const Color(0xFFE0E0E4)),
),
child: QrImageView(
data: client.code,
version: QrVersions.auto,
size: 220,
gapless: false,
eyeStyle: const QrEyeStyle(
eyeShape: QrEyeShape.square,
color: AppTheme.noir,
),
dataModuleStyle: const QrDataModuleStyle(
dataModuleShape: QrDataModuleShape.square,
color: AppTheme.noir,
),
),
),
const SizedBox(height: 14),
Text(
client.code,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
letterSpacing: 2,
),
),
const SizedBox(height: 8),
const Text(
'Présentez ce code en caisse pour cumuler des points.',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, color: AppTheme.grisTexte),
),
const SizedBox(height: 12),
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: const Text('Fermer'),
),
],
),
),
),
);
}