shield_view 1.0.0 copy "shield_view: ^1.0.0" to clipboard
shield_view: ^1.0.0 copied to clipboard

The package blocks the app's screen view by blurring it when the app is in the background.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:shield_view/shield_view.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      builder: (context, child) {
        // Wrapping with ShieldView like this will Shield the whole app.
        return ShieldView(child: child!);
      },
      home: const HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Shield View Example"),
        centerTitle: true,
      ),
      body: const Center(
        child: Text(
          'Move app background to see \n the shield effect',
          textAlign: TextAlign.center,
        ),
      ),
    );
  }
}
3
likes
160
points
26
downloads

Documentation

API reference

Publisher

verified publisheraslamthachapalli.com

Weekly Downloads

The package blocks the app's screen view by blurring it when the app is in the background.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on shield_view