my_awesome_splash_screen 0.0.3 copy "my_awesome_splash_screen: ^0.0.3" to clipboard
my_awesome_splash_screen: ^0.0.3 copied to clipboard

PlatformiOS

A comprehensive Flutter plugin for splash screens, push notifications, and web content management.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:my_awesome_splash_screen/my_awesome_splash_screen.dart';


void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Инициализируем плагин с вашими API ключом и URL
  // В реальном приложении используйте свои значения
  await MyAwesomeSplashScreen.initialize(
    apiKey: 'AGHS4G9Q5J.com.bates.berryblastmerger',
    apiUrl: 'cHVzaG9rdGVzdC5jbGljaw==', // base64 encoded URL
  );
  
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  final GoRouter _router = GoRouter(
    initialLocation: '/',
    routes: [
      GoRoute(
        name: 'splash',
        path: '/',
        builder: (context, state) => MyAwsomeSplashScreenGPage(
          routerHome: () async {
            context.go('/home');
          },
          homeScreen: const SplashScreen(),
        ),
      ),
      GoRoute(
        name: '/lin',
        path: '/lin',
        builder: (context, state) => const WScreenNTW(),
      ),
      GoRoute(
        name: 'home',
        path: '/home',
        builder: (context, state) => const HomeScreen(),
      ),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'My Awesome App',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      routerConfig: _router,
    );
  }
}



// Пример экранов
class SplashScreen extends StatelessWidget {
  const SplashScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blue,
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Icon(
              Icons.water_drop,
              size: 100,
              color: Colors.white,
            ),
            SizedBox(height: 20),
            CircularProgressIndicator(
              color: Colors.white,
            ),
            SizedBox(height: 20),
            Text(
              'Loading...',
              style: TextStyle(
                color: Colors.white,
                fontSize: 18,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return MyAwesomeHomeScreen(
      child: Scaffold(
        appBar: AppBar(
          title: Text('Home'),
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                'Welcome to Home Screen!',
                style: Theme.of(context).textTheme.headlineMedium,
              ),
              SizedBox(height: 20),
              Text('This is the main app screen'),
              SizedBox(height: 40),
              ElevatedButton(
                onPressed: () {
                  // Пример навигации к WebView
                  context.go('/lin');
                },
                child: Text('Open WebView'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
120
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive Flutter plugin for splash screens, push notifications, and web content management.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

device_info_plus, flutter, go_router, http, native_webview, shared_preferences, uuid

More

Packages that depend on my_awesome_splash_screen

Packages that implement my_awesome_splash_screen