- Add flutterBeacon.close before initializing to clear stale state - Add 2-second Bluetooth warmup delay for radio initialization - Extend scan duration to 5 seconds for reliable detection - Ensure ACCESS_BACKGROUND_LOCATION permission is included Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
57 lines
1.8 KiB
Dart
57 lines
1.8 KiB
Dart
import "package:flutter/material.dart";
|
|
import "package:flutter_stripe/flutter_stripe.dart";
|
|
import "package:provider/provider.dart";
|
|
|
|
import "app/app_router.dart" show AppRoutes;
|
|
import "app/app_state.dart" show AppState;
|
|
import "services/api.dart" show Api;
|
|
|
|
/// Global key for showing snackbars from anywhere in the app
|
|
final GlobalKey<ScaffoldMessengerState> rootScaffoldMessengerKey =
|
|
GlobalKey<ScaffoldMessengerState>();
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Initialize Stripe with live publishable key (must match backend mode)
|
|
// Backend is in live mode - see api/config/stripe.cfm
|
|
Stripe.publishableKey = 'pk_live_Wqj4yGmtTghVJu7oufnWmU5H';
|
|
|
|
runApp(const PayfritApp());
|
|
}
|
|
|
|
class PayfritApp extends StatelessWidget {
|
|
const PayfritApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiProvider(
|
|
providers: [
|
|
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
|
|
],
|
|
child: Api.isDev
|
|
? Directionality(
|
|
textDirection: TextDirection.ltr,
|
|
child: Banner(
|
|
message: "DEV",
|
|
location: BannerLocation.topEnd,
|
|
color: Colors.orange,
|
|
child: MaterialApp(
|
|
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
|
debugShowCheckedModeBanner: false,
|
|
title: "Payfrit DEV",
|
|
initialRoute: AppRoutes.splash,
|
|
routes: AppRoutes.routes,
|
|
),
|
|
),
|
|
)
|
|
: MaterialApp(
|
|
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
|
debugShowCheckedModeBanner: false,
|
|
title: "Payfrit",
|
|
initialRoute: AppRoutes.splash,
|
|
routes: AppRoutes.routes,
|
|
),
|
|
);
|
|
}
|
|
}
|