initial commit

This commit is contained in:
bastien
2026-06-28 12:29:06 +02:00
parent 79d5b012a9
commit 20f383dd62
93 changed files with 4269 additions and 1 deletions
+39
View File
@@ -0,0 +1,39 @@
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart';
/// Plateformes supportées par l'application (mobile natif uniquement, pas de web).
enum AppPlatform {
android,
ios,
}
/// Indique si la plateforme courante est supportée (Android ou iOS).
bool get isMobilePlatformSupported {
if (kIsWeb) {
return false;
}
return Platform.isAndroid || Platform.isIOS;
}
/// Plateforme courante. Lance une exception si web ou desktop.
AppPlatform get currentAppPlatform {
if (kIsWeb) {
throw UnsupportedError(
'Laverie Mobile ne cible pas le web. Utilisez Android ou iOS.',
);
}
if (Platform.isAndroid) {
return AppPlatform.android;
}
if (Platform.isIOS) {
return AppPlatform.ios;
}
throw UnsupportedError(
'Plateforme non supportée. Cible : Android (prioritaire) et iOS.',
);
}
bool get isAndroid => !kIsWeb && Platform.isAndroid;
bool get isIos => !kIsWeb && Platform.isIOS;