voxa_core 1.1.0+1
voxa_core: ^1.1.0+1 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 [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:voxa_core/voxa_core.dart';
import 'example_app/src/features/intro/presentation/screens/splash_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
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 DynamicColorBuilder(
builder: (lightDynamic, darkDynamic) {
return MaterialApp(
title: 'Voxa Core Demo',
debugShowCheckedModeBanner: false,
// 3. Leverage Package Theme Engine
theme: VoxaThemeBuilder.buildLight(
tokens: VoxaTokens.light,
config: themeConfig,
colorScheme: themeConfig.colors.useDynamicColor ? lightDynamic : null,
),
darkTheme: VoxaThemeBuilder.buildDark(
tokens: VoxaTokens.dark,
config: themeConfig,
colorScheme: themeConfig.colors.useDynamicColor ? darkDynamic : null,
),
themeMode: themeConfig.themeMode,
home: const VoxaSplashScreen(),
);
},
);
}
}