condora_automatic_getter_storage_directory 1.0.1 condora_automatic_getter_storage_directory: ^1.0.1 copied to clipboard
A Flutter package that provides an automatic and platform-aware solution for managing storage directories across web and non-web platforms, handling both debug and release environments efficiently.
import 'package:flutter/material.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:condora_automatic_getter_storage_directory/condora_automatic_getter_storage_directory.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize Hydrated Bloc Storage dynamically.
HydratedBloc.storage = await HydratedStorage.build(
storageDirectory: await condoraAutomaticGetterStorageDirectory(
webStorageDirectory: HydratedStorage.webStorageDirectory,
),
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Placeholder(),
),
);
}
}