background 1.1.0 copy "background: ^1.1.0" to clipboard
background: ^1.1.0 copied to clipboard

A Flutter package to display images or videos as backgrounds.

Background #

A Flutter package to display images or videos as backgrounds.

Features #

A flexible Flutter widget to display a customizable background—image or video—behind any child widget.

  • Image Background: Automatically displays an image when an image file path is provided.
  • Video Background: Plays a muted, looping video when a video file path is detected.
  • Child Overlay: Seamlessly overlays your child widget on top of the background.
  • Smart Media Detection: Automatically identifies the background type based on the file path.
  • Perfect for splash screens, login pages, or any UI that needs a rich, dynamic background.

Getting started #

  1. Add the latest version of package to your pubspec.yaml (and run flutter pub get):
dependencies:
background:^1.1.0
OR
```console
flutter pub add background
  1. Import the package and use it in your Flutter App.
import 'package:background/background.dart';

Example usage #

Background Image #

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Background(
        path: 'assets/png/image.png',
        child: Center(
          child: Text(
            'Hello, Farhan!',
            style: TextStyle(color: Colors.white, fontSize: 24),
          ),
        ),
      )
  );
}

Background Video #

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Background(
        path: 'assets/video/background.mp4',
        child: Center(
          child: Text(
            'Hello, Farhan!',
            style: TextStyle(color: Colors.white, fontSize: 24),
          ),
        ),
      )
  );
}

Supported File Types #

File Type Supported
Image PNG, JPG, JPEG, GIF, BMP, WEBP
Video MP4, MOV, AVI, MKV, WEBM
37
likes
0
points
174
downloads

Publisher

verified publisherfarhansadikgalib.com

Weekly Downloads

A Flutter package to display images or videos as backgrounds.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, video_player

More

Packages that depend on background