app_chiseletor 1.2.0+9 copy "app_chiseletor: ^1.2.0+9" to clipboard
app_chiseletor: ^1.2.0+9 copied to clipboard

A comprehensive Flutter framework that provides seamless integration of theme management, Firebase authentication (Email, Google Sign-in), and multilingual support (en, zh, zh_TW). Features include cu [...]

example/lib/main.dart

import 'package:app_chiseletor/auth/auth_wrapper.dart';
import 'package:app_chiseletor/theme/app_initializer_singleton.dart';
import 'package:app_chiseletor/widgets/theme_material_app_singleton.dart';
import 'package:app_chiseletor_example/pages/demo_content.dart';
import 'package:app_chiseletor_example/pages/homepage.dart';
import '../l10n/app_localizations.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../themes/my_custom_theme.dart';
import '../themes/blue_theme.dart';
import 'package:app_chiseletor/theme/theme_manager_singleton.dart';

void handleError(Object error, StackTrace stack) {
  debugPrint('ERROR: $error\nSTACK: $stack');
}

void main() async {
  FlutterError.onError = (details) {
    FlutterError.presentError(details);
    handleError(details.exception, details.stack ?? StackTrace.empty);
  };
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  // 使用單例模式初始化主題管理器
  await ThemeManagerSingleton.initialize(
    customThemes: [
      MyCustomTheme(),
      BlueTheme(),
    ],
  );
  // 使用新的單例版本的 AppInitializer
  final providers = await AppInitializerSingleton.initialize(
    defaultLocale: const Locale('zh', 'TW'),
    externalSupportedLocales: AppLocalizations.supportedLocales,
  );

  runApp(
    MultiProvider(
      providers: providers,
      child: Builder(
        builder: (context) => const ThemedMaterialAppSingleton(
          debugShowCheckedModeBanner: false,
          home: AuthWrapper(
            homepage: HomePage(child: DemoContent()),
          ),
          localizationsDelegates: AppLocalizations.localizationsDelegates,
          supportedLocales: AppLocalizations.supportedLocales,
        ),
      ),
    ),
  );
}
0
likes
30
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive Flutter framework that provides seamless integration of theme management, Firebase authentication (Email, Google Sign-in), and multilingual support (en, zh, zh_TW). Features include custom theme creation, dark mode support, and persistent authentication state.

Repository (GitHub)
View/report issues
Contributing

Topics

#theme #authentication #localization #firebase #flutter-widgets

Documentation

Documentation

License

MIT (license)

Dependencies

cupertino_icons, firebase_auth, firebase_core, flutter, flutter_localizations, google_sign_in, intl, nested, provider

More

Packages that depend on app_chiseletor