59 lines
1.6 KiB
Dart
59 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'screens/auth_screen.dart';
|
|
import 'services/address_repository.dart';
|
|
import 'services/auth_repository.dart';
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({
|
|
super.key,
|
|
AuthRepository? authRepository,
|
|
AddressRepository? addressRepository,
|
|
this.enableLiveFeatures = true,
|
|
}) : _authRepository = authRepository ?? const LocalAuthRepository(),
|
|
_addressRepository = addressRepository ?? const LocalAddressRepository();
|
|
|
|
final AuthRepository _authRepository;
|
|
final AddressRepository _addressRepository;
|
|
final bool enableLiveFeatures;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'Acceso',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF0F766E)),
|
|
useMaterial3: true,
|
|
),
|
|
home: AuthBootstrap(
|
|
authRepository: _authRepository,
|
|
addressRepository: _addressRepository,
|
|
enableLiveFeatures: enableLiveFeatures,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class AuthBootstrap extends StatelessWidget {
|
|
const AuthBootstrap({
|
|
super.key,
|
|
required this.authRepository,
|
|
required this.addressRepository,
|
|
this.enableLiveFeatures = true,
|
|
});
|
|
|
|
final AuthRepository authRepository;
|
|
final AddressRepository addressRepository;
|
|
final bool enableLiveFeatures;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AuthScreen(
|
|
authRepository: authRepository,
|
|
addressRepository: addressRepository,
|
|
enableLiveFeatures: enableLiveFeatures,
|
|
);
|
|
}
|
|
}
|