super_dialog 0.3.0 copy "super_dialog: ^0.3.0" to clipboard
super_dialog: ^0.3.0 copied to clipboard

A powerful, flexible, and beautifully animated dialog toolkit for Flutter. Create stunning dialogs with smooth slide, scale, fade, rotation, bounce, elastic, and flip animations.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'screens/home_screen.dart';
import 'theme/app_theme.dart';

void main() {
  runApp(const SuperDialogExampleApp());
}

class SuperDialogExampleApp extends StatefulWidget {
  const SuperDialogExampleApp({super.key});

  @override
  State<SuperDialogExampleApp> createState() => _SuperDialogExampleAppState();
}

class _SuperDialogExampleAppState extends State<SuperDialogExampleApp> {
  ThemeMode _themeMode = ThemeMode.light;
  late final GoRouter _router;

  @override
  void initState() {
    super.initState();
    _router = GoRouter(
      debugLogDiagnostics: false,
      initialLocation: '/',
      routes: [
        GoRoute(
          path: '/',
          name: 'home',
          builder: (context, state) => HomeScreen(
            onThemeToggle: _toggleTheme,
            isDarkMode: _themeMode == ThemeMode.dark,
          ),
        ),
      ],
    );
  }

  void _toggleTheme() {
    setState(() {
      _themeMode = _themeMode == ThemeMode.light
          ? ThemeMode.dark
          : ThemeMode.light;
      // Refresh the router to update the theme
      _router.refresh();
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Super Dialog Examples',
      debugShowCheckedModeBanner: false,
      themeMode: _themeMode,
      theme: AppTheme.light,
      darkTheme: AppTheme.dark,
      routerConfig: _router,
    );
  }
}
1
likes
0
points
134
downloads

Publisher

unverified uploader

Weekly Downloads

A powerful, flexible, and beautifully animated dialog toolkit for Flutter. Create stunning dialogs with smooth slide, scale, fade, rotation, bounce, elastic, and flip animations.

Repository (GitHub)
View/report issues

Topics

#dialog #animation #modal #popup

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on super_dialog