Skip to content

A Flutter package for Offers, Promo and Invites banners. Supports Android and Web.

License

Notifications You must be signed in to change notification settings

om-chauhan/flat_banners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7ea6b2a · Dec 14, 2022

History

11 Commits
Sep 22, 2022
Nov 21, 2021
Nov 21, 2021
Nov 21, 2021
Sep 22, 2022
Dec 14, 2022
Dec 14, 2022
Nov 21, 2021
Nov 21, 2021
Nov 21, 2021
Sep 22, 2022
Sep 22, 2022
Nov 21, 2021

Repository files navigation

flat_banners

pub package

A Flutter package for Offers, Promo and Invites banners. Android support Android and Web.

Usage

To use this plugin, add flat_banners as a dependency in your pubspec.yaml file.

Demo

Example

import 'package:flutter/material.dart';
import 'package:flat_banners/flat_banners.dart';
import 'package:example/controller/data_controller.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Banners Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Home(),
    );
  }
}

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      child: FlatBanners(
        imageWidth: 50,
        gradientColors: [
          const Color(0xff6C59D4).withOpacity(0.9),
          const Color(0xff869DFB).withOpacity(0.7),
        ],
        title: 'Get 500 Coins by Referring',
        subtitle: 'Games are Fun with Friends!',
        btnText: 'Refer a friend',
        image: 'assets/icons/social-media.png',
        onPressed: () {},
      ),
    );
  }
}

See the example app for more complex examples.

Screenshot

Horizontal View Vertical View

Licence

MIT Licence