Categories
Mastering Development

Why can’t I access the firestore values in flutter?

Using the example here. I modified some code to output the the message onTap as follows: The List is generated with real values from firestore. but the output is blank. It’s not empty, as I tested with another set of output. How can I retrieve these real values to use in onTap event handler? …. […]

Categories
Mastering Development

Flutter ListView.builder with Wrap widget

i have the following code and i want the items displayed horizontally but it is displaying them vertically. anybody have an idea what am i doing wrong? ListView.builder( itemCount: _categories.length, scrollDirection: Axis.vertical, shrinkWrap: true, itemBuilder: (_, i) => Wrap( direction: Axis.horizontal, spacing: 10.0, runSpacing: 20.0, children: [ CategoryItem( _categories[i].id, _categories[i].name, _categories[i].description, _categories[i].imageUrl, _categories[i].restaurantId, ), Divider(), […]

Categories
Mastering Development

Flutter – How to shrink the width of listview items

Though I have some experience with Android development, I am very new to flutter. I am trying create a page in flutter where I need to cover the entire page with Google maps and on top of that in one side I need to display list of images. I am able to achieve this with […]

Categories
Development

Flutter – Update UI from another page when refreshing server data on firstpage

I recently started with Flutter, I ‘made’ an app where you get data from a server and in the app you can update the data. But to keep the app updated with the data from the server, i have made an auto refresh, so after 10 min it get the data from the server again. […]

Categories
Development

Trying to implement loading spinner while loading data from Firestore with Flutter

I’m working on an app that display spinner when backend loading data from Firestore but it’s not worked as intended and I’m having a struggle to find the flaw. My Orders Page code import ‘package:flutter/material.dart’; import ‘package:provider/provider.dart’; import ‘package:table_service/providers/order.dart’; import ‘../providers/session.dart’; class OrdersPage extends StatefulWidget { bool isLoading = true; @override _OrdersPageState createState() => _OrdersPageState(); […]

Categories
Development Firebase

Flutter rendering list from firebase based on condition in dropdown menu

I’m trying to figure out how to render a list from a specific collection in firebase and to change that list when selecting options from dropdown menu. I could get the list rendered on 1 collection, but when I add my dropdown menu, with the default value being ‘lost’, nothing is displayed. Here’s what I […]

Categories
Development

Flutter: Correct approach to get value from Future

I have a function which returns images directory path, it performs some additional check like if directory exists or not, then it behaves accordingly. Here is my code: Future<String> getImagesPath() async { final Directory appDir = await getApplicationDocumentsDirectory(); final String appDirPath = appDir.path; final String imgPath = appDirPath + ‘/data/images’; final imgDir = new Directory(imgPath); […]

Categories
Database Development Firebase

Flutter – how to read list from Firebase realtime database using model

[ Sorry for my bad english ] In this project I’m viewing events lists in some pages from JSON API and in CloudEvents page I’m viewing another list from from Firebase Database, using Event model … Now when I run CloudEvents page I get null for itemsEvent[i].startDate with this Error: A non-null String must be […]

Categories
Development

Flutter Retrieve Data from Firebase

I tried this tutorial https://www.youtube.com/watch?v=ZiagJJTqnZQ but my data didn’t show, the length is still showing 0 This is my firebase https://i.imgur.com/D6kBpp8.png Code questions.dart class Questions { String question, questioner, status; Questions(this.question, this.questioner, this.status); } timeline.dart import ‘package:flutter/material.dart’; import ‘questions.dart’; import ‘package:firebase_database/firebase_database.dart’; class TimeLine extends StatefulWidget { @override State<StatefulWidget> createState() { return _TimeLineState(); } } class […]