SHARE
TWEET

List

a guest Jan 22nd, 2020 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import 'package:bb_storage_inventory/models/category.dart';
  3. import 'package:bb_storage_inventory/services/categories.dart';
  4. import 'package:bb_storage_inventory/views/abstract/firebase.entity.list.widget.dart';
  5. import 'package:bb_storage_inventory/views/categories/categoriesEdit.dart';
  6. import 'package:firebase_auth/firebase_auth.dart';
  7. import 'package:flutter/material.dart';
  8.  
  9. class CategoriesList extends FirebaseEntityListWidget<Category, Categories> {
  10.   @override
  11.   ListTile buildListTile(BuildContext context, Category item) {
  12.     return ListTile(
  13.       leading: Hero(
  14.         tag: 'category_icon_${item.uuid}',
  15.         child: CircleAvatar(
  16.           backgroundColor: Colors.deepOrangeAccent,
  17.           child: Icon(
  18.             Icons.bookmark_border,
  19.             color: Colors.white,
  20.           )
  21.         )
  22.       ),
  23.       title: Text("${item.name}"),
  24.       subtitle: Text(item.icon),
  25.     );
  26.   }
  27.  
  28.   @override
  29.   Widget editWidgetInstance(Category item) {
  30.     return new CategoryEdit(category: item);
  31.   }
  32.  
  33.   @override
  34.   Category newModelInstanceProvider() {
  35.     return new Category();
  36.   }
  37.  
  38.   @override
  39.   Categories serviceInstanceProvider(FirebaseUser userInstance) {
  40.     return Categories(userInstance.uid);
  41.   }
  42.  
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top