notification_listview

Last updated:

0 purchases

notification_listview Image
notification_listview Images
Add to Cart

Description:

notification listview

Notification ListView














This NotificationListView Package is optimized for the notification type used in the Hyundai AutoEver internship assignments.

Features #

Shows data according to notification type.
Same as listview.builder except for itembuilder and header related properties.

Getting Start #
Add the package to your pubspec.yaml.
notification_listview: ^1.1.0
copied to clipboard
import the library in your file.
import 'package:notification_listview/notification_listview.dart';
import 'package:notification_listview/notification_tile.dart';
copied to clipboard
In the T part, put the data class for your list.
List<String> list = [];

NotificationListView<String>
//NotificationListView<T>
copied to clipboard
In groupby, write a function that returns the NotiTileType of each element.
class Temp {
...
final NotiTileType notiTileType = NotiTileType.alert;
...
}

...
groupBy: (element) => element.notiTileType,
...
copied to clipboard
Showcase #






Example #

class Temp {
final NotiTileType notiTileType;
final String title;
final String content;

const Temp(this.notiTileType, this.title, this.content);

@override
String toString() {
return 'Temp{title: $title, type: $notiTileType}\n';
}
}

class ListViewPage extends StatefulWidget {
const ListViewPage({Key? key}) : super(key: key);

@override
State<ListViewPage> createState() => _ListViewPageState();
}

class _ListViewPageState extends State<ListViewPage> {
final List<Temp> list = const [
Temp(NotiTileType.alert, "title", "content"),
Temp(NotiTileType.normal, "title", "content"),
Temp(NotiTileType.chatting, "title", "content"),
Temp(NotiTileType.alert, "title", "content"),
Temp(NotiTileType.normal, "title", "content"),
Temp(NotiTileType.chatting, "title", "content"),
Temp(NotiTileType.alert, "title", "content"),
Temp(NotiTileType.normal, "title", "content"),
Temp(NotiTileType.chatting, "title", "content"),
Temp(NotiTileType.alert, "title", "content"),
Temp(NotiTileType.normal, "title", "content"),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const CupertinoNavigationBar(
middle: Text("Notification ListView"),
),
body: Container(
color: Colors.black12,
child: NotificationListView<Temp>(
elements: list,
groupBy: (element) => element.notiTileType,
hasHeader: true,
onTapSearch: () => print("tap search button"),
isSearching: false,
itemCount: list.length,
indexItemBuilder: (context, e, i) => NotiListViewTile(
isNew: true,
title: e.title,
content: e.content,
notiTileType: e.notiTileType,
onTapDelete: () => print("tap delete button"),
),
),
),
);
}
}
copied to clipboard
Additional information #

This package only support Korean.

Contact #

[email protected]
[email protected]

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.