v0.0.1+2card_banner
一个简单的 widget,可帮助您在任何 widget 上放置横幅。
25喜欢 7近 30 天下载140Pub 分数
AndroidiOSWebmacOSWindowsLinux
abhishek-900/card_banner open-source repository details.
以下为英文项目原文快照,最新内容请访问 GitHub。
It is simple to add a banner to any widget using card banner.
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'
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,
),
),
),
);
}
}
Check the example project on github for advanced usage.
依赖清单 3 项
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗