Search packages, repositories and app categories

card_banner cover
Package detailsv0.0.1+2

card_banner

A simple widget that helps you place a banner on any widget.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
6
Likes
25
Pub points
140

Install package

flutter pub add card_banner

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

CardBanner is a lightweight Flutter widget designed to easily place a banner on any other widget. It provides a simple way to add visual indicators such as badges, ribbons, or labels to UI elements without complex layout management. The banner can be positioned relative to the parent widget and customized with color, text, and alignment options. Ideal for highlighting features, status indicators, or promotional messages in apps across multiple platforms.

Use cases

  • Adding status badges to cards
  • Highlighting promotional content
  • Displaying priority tags on items
  • Creating custom ribbons for UI elements
  • Enhancing user feedback with visual cues

Key features

  • Easy integration with any widget
  • Customizable banner text and color
  • Flexible positioning options
  • Supports multiple platforms
  • Minimal boilerplate code
  • Responsive design compatibility

Suitable for

  • Developers building UI-heavy apps
  • Designers needing visual annotations
  • Apps requiring status indicators
  • Cross-platform mobile and web applications
  • Projects with dynamic content tagging

Considerations

  • May require manual alignment adjustments
  • Limited styling beyond basic customization
  • Not suitable for complex animations
  • Best used with simple, static banners
  • Performance impact if overused in large lists

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Card Banner

It is simple to add a banner to any widget using card banner.

Features

  • Highly customizable.
  • Multi-platform support.

Getting started

Add this line to your pubspec.yaml under the dependencies:

dependencies:
    card_banner: <latest-version>

alternatively, you can use this command:

flutter pub add card_banner

Import statement

import 'package:card_banner/card_banner.dart'

Screenshot

Usage

Simple example: Cover the card widget with the card banner and provide the required text. It's done

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color.fromARGB(255, 221, 222, 245),
      body: ListView.builder(
        padding: const EdgeInsets.symmetric(horizontal: 10),
        itemCount: 8,
        itemBuilder: (context, index) {
          return CardBanner(
            text: "50% Off",
            child: foodCard(),
          );
        },
      ),
    );
  }

  Card foodCard() {
    return Card(
      child: ListTile(
        contentPadding: EdgeInsets.zero,
        title: Image.network(
          "https://images.pexels.com/photos/461198/pexels-photo-461198.jpeg",
          fit: BoxFit.cover,
        ),
        subtitle: const Padding(
          padding: EdgeInsets.all(12.0),
          child: Text(
            "Nulla cillum qui elit adipisicing culpa ad laboris amet laboris velit. Pariatur sit tempor nostrud non duis commodo laboris. Consequat incididunt laborum qui dolore in velit consequat mollit amet. Proident eu et sint veniam sunt fugiat quis fugiat sunt pariatur do enim in.",
            overflow: TextOverflow.ellipsis,
            maxLines: 3,
          ),
        ),
      ),
    );
  }
}

Additional information

Check the example project on github for advanced usage.

Categories

Source repository

Projects using this package

No data available yet.