FLUTTER ECOSYSTEM

abhishek-900/card_banner

abhishek-900/card_banner open-source repository details.

card_banner 프로젝트 이미지
Stars
0
Forks
0
최근 푸시(UTC)
2022. 12. 4.
프로젝트 상태
활성
Abhishek Singh GitHub avatar
GITHUB User

Abhishek Singh ↗

Abhishek Singh is a versatile software developer with expertise in mobile application development.

언어C++CMakeDartHTMLCSwiftKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^2.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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

https://user-images.githubusercontent.com/45100807/205489258-8d06faa3-c101-45ba-a33c-4bb24073de24.png

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.