voxa_core 1.0.0
voxa_core: ^1.0.0 copied to clipboard
Voxa is an enterprise-grade Flutter foundation package. It provides a complete design system with dynamic Material 3 theming, type-safe tokens, and a robust networking stack with auto-token refresh. I [...]
import 'package:flutter/material.dart';
import 'package:voxa_core/voxa_core.dart';
import 'example_app/src/features/products/presentation/screens/product_list_screen.dart';
void main() async {
// 1. Initialize Voxa Foundation (Logging, Theme, DI)
await VoxaBootstrap.initialize(environment: VoxaEnvironment.development);
runApp(
ProviderScope(
overrides: [
// 2. Configure Package API Foundation
// This provides the base configuration for the package's internal dioProvider
apiConfigProvider.overrideWithValue(
ApiConfig.development(baseUrl: 'https://fakestoreapi.com'),
),
],
child: const VoxaStoreApp(),
),
);
}
class VoxaStoreApp extends HookConsumerWidget {
const VoxaStoreApp({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final themeConfig = ref.watch(voxaThemeControllerProvider);
return MaterialApp(
title: 'Voxa Store',
debugShowCheckedModeBanner: false,
// 3. Leverage Package Theme Engine
// This automatically applies Voxa Design System tokens and FlexColorScheme
theme: VoxaThemeBuilder.build(
brightness: Brightness.light,
tokens: VoxaTokens.light,
scheme: themeConfig.colors.scheme,
),
darkTheme: VoxaThemeBuilder.buildDark(
tokens: VoxaTokens.dark,
scheme: themeConfig.colors.scheme,
),
themeMode: themeConfig.themeMode,
home: const ProductListScreen(),
);
}
}