sistemato assets, finito creazione company, inizio lavoro store

This commit is contained in:
2026-04-09 11:30:57 +02:00
parent 0033a0aee6
commit 510d8e6f15
19 changed files with 524 additions and 231 deletions

View File

@@ -5,27 +5,20 @@ import 'package:flux/core/theme/theme.dart';
import 'package:flux/core/theme/bloc/theme_bloc.dart';
import 'package:flux/features/auth/bloc/auth_bloc.dart';
import 'package:flux/features/auth/ui/auth_screen.dart';
import 'package:flux/features/company/bloc/company_bloc.dart';
import 'package:flux/features/company/data/company_repository.dart';
import 'package:flux/features/company/ui/create_company_screen.dart';
import 'package:flux/features/store/data/store_repository.dart';
import 'package:flux/features/store/ui/create_store_screen.dart';
import 'package:flux/ui/home_screen.dart';
import 'package:flux/ui/settings/settings.dart';
import 'package:flux/features/settings/settings.dart';
import 'package:get_it/get_it.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final GetIt getIt = GetIt.instance;
getIt.registerSingleton<SharedPreferences>(
await SharedPreferences.getInstance(),
);
getIt.registerSingleton<AppSettings>(AppSettings());
await Supabase.initialize(
url: 'https://pvqpjloswwvtfoxbkfbh.supabase.co',
anonKey:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InB2cXBqbG9zd3d2dGZveGJrZmJoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ5MjkyNjgsImV4cCI6MjA5MDUwNTI2OH0.-7nitlX1pzPGscGawlIF0vhwuD_w209FUU0PxDNGm0Y',
);
getIt.registerSingleton<SupabaseClient>(Supabase.instance.client);
await setupLocator();
runApp(
MultiBlocProvider(
@@ -37,12 +30,30 @@ void main() async {
create: (context) => SessionBloc()..add(AppStarted()),
),
BlocProvider<AuthBloc>(create: (context) => AuthBloc()),
BlocProvider<CompanyBloc>(create: (context) => CompanyBloc()),
],
child: const FluxApp(),
),
);
}
Future<void> setupLocator() async {
final GetIt getIt = GetIt.instance;
getIt.registerSingleton<SharedPreferences>(
await SharedPreferences.getInstance(),
);
await Supabase.initialize(
url: 'https://pvqpjloswwvtfoxbkfbh.supabase.co',
anonKey:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InB2cXBqbG9zd3d2dGZveGJrZmJoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ5MjkyNjgsImV4cCI6MjA5MDUwNTI2OH0.-7nitlX1pzPGscGawlIF0vhwuD_w209FUU0PxDNGm0Y',
);
getIt.registerSingleton<SupabaseClient>(Supabase.instance.client);
getIt.registerLazySingleton<AppSettings>(() => AppSettings());
getIt.registerLazySingleton<CompanyRepository>(() => CompanyRepository());
getIt.registerLazySingleton<StoreRepository>(() => StoreRepository());
}
class FluxApp extends StatelessWidget {
const FluxApp({super.key});