Skip to content

Commit

Permalink
12/06/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
monkey111111111 committed Jun 11, 2024
1 parent 612d414 commit 976e4fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/screens/data_anggota/data_anggota.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:convert';

import 'package:admin_perpustakaan/services/FirebaseServices.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
// ignore: avoid_web_libraries_in_flutter
Expand All @@ -13,7 +14,7 @@ class DataAnggota extends StatefulWidget {
}

class _DataAnggotaState extends State<DataAnggota> {
FirebaseFirestore firestore = FirebaseFirestore.instance;
FirebaseServices fs = FirebaseServices();

List<QueryDocumentSnapshot>? allData;

Expand Down Expand Up @@ -55,7 +56,7 @@ class _DataAnggotaState extends State<DataAnggota> {
@override
Widget build(BuildContext context) {
return StreamBuilder<QuerySnapshot>(
stream: firestore.collection("users").snapshots(),
stream: fs.getAllStream("users"),
builder: (context, snapshot) {
if (snapshot.hasData) {
allData = snapshot.data!.docs;
Expand Down
3 changes: 0 additions & 3 deletions lib/services/FirebaseServices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ class FirebaseServices {
Stream<QuerySnapshot<Map<String, dynamic>>> searching(
String path, String key, String value) {
Query<Map<String, dynamic>> collection = _db.collection(path);

log("value ", v: value);

collection = collection.where(key, arrayContainsAny: [
value.substring(0, 1).toUpperCase() + value.substring(1),
value.substring(0, 1).toLowerCase() + value.substring(1),
Expand Down

0 comments on commit 976e4fb

Please sign in to comment.