firestore_search 0.1.1 copy "firestore_search: ^0.1.1" to clipboard
firestore_search: ^0.1.1 copied to clipboard

discontinued
outdated

This package helps developers to implement cloud_firestore search in their apps.

example/example.dart

import 'package:firestore_search/firestore_search.dart';
import 'package:flutter/material.dart';

import 'data_model.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar'),
        ),
        body: Center(
          child: Container(
            child: Text('Hello World'),
          ),
        ),
      ),
    );
  }
}

class SearchFeed extends StatefulWidget {
  @override
  _SearchFeedState createState() => _SearchFeedState();
}

class _SearchFeedState extends State<SearchFeed> {
  @override
  Widget build(BuildContext context) {
    return FirestoreSearchScaffold(
      firestoreCollectionName: 'data',
      searchBy: 'name',
      dataListFromSnapshot: DataModel().dataListFromSnapshot,
      builder: (context, snapshot) {
        if (snapshot.hasData) {
          final List<DataModel> dataList = snapshot.data;

          return ListView.builder(
              itemCount: dataList?.length ?? 0,
              itemBuilder: (context, index) {
                final DataModel data = dataList[index];

                return Column(
                  mainAxisSize: MainAxisSize.min,
                  mainAxisAlignment: MainAxisAlignment.center,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text('${data?.name ?? ''}'),
                    Text('${data?.description ?? ''}')
                  ],
                );
              });
        }
        return Center(
          child: CircularProgressIndicator(),
        );
      },
    );
  }
}
90
likes
0
pub points
70%
popularity

Publisher

verified publisherasadhameed.com

This package helps developers to implement cloud_firestore search in their apps.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cloud_firestore, flutter

More

Packages that depend on firestore_search