I Got Questions here. How to change screen using FLutter Getx
. I got GetxControll that searchUser from firestore. Here's the code.
class AuthenticationC extends GetxController {
final usersRef = FirebaseFirestore.instance.collection('Users');
List<QueryDocumentSnapshot> searchResultFuture;
searchUser(String query) async {
QuerySnapshot snapshot = await usersRef
.where('DisplayName', isGreaterThanOrEqualTo: query)
.get();
searchResultFuture = snapshot.docs;
return snapshot.docs;
}
}
then I want to change UI from buildNoContent() to With buildSearchedContent(). when the user enters text in the TextField. then it will auto-change the UI. I already got the searchUser but the UI Doesn't change. here the UI Code. Thank You
class SearchUserScreen extends StatelessWidget {
final authenticationC = AuthenticationC.to;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
searchBox(),
SizedBox(
height: 20,
),
authenticationC.searchResultFuture == null // i want to change here
? buildNoContent() // im already using GetBuilder<AuthenticationC>
: Expanded(child: buildSearchedContent(),// But it wont change
),
],
),
),
}
}