Categories
Mastering Development

How can you wait until the function finish in flutter

I am working on an app that has Loop Timer so I want the loop that responsible for going through the list of times. so the problem is the loop goes through them all at once, and I want to find a way to wait for it in till it finishes to go to the […]

Categories
Mastering Development

Flutter : How to disable drag down to close showModalBottomSheet

I want to disable drag down to close the showModalBottomSheet I have already tried using enableDrag:false, When i’m using enableDrag:false, is showing me below error Below is my code modal(BuildContext context) { showModalBottomSheet( context: context, enableDrag:false, isDismissible: false, backgroundColor: Colors.transparent, builder: (context) { return Container( width: MediaQuery.of(context).size.width, child: Stack( alignment: Alignment.topCenter, children: <Widget>[ Container( width: […]

Categories
Mastering Development

Is there any way a single widget to be added like a showMenu content instead of using property ` items:` which expect `List

showMenu<Widget>( context: context, color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5)), items: _buildPopupMenuItems(context)); Something like body property that expects single widget?

Categories
Mastering Development

how to make Percent Indicator change color programmatically in flutter?

I’m using a package called percent indicator https://pub.dev/packages/percent_indicator and I’m currently using its CircularPercentIndicator() I’m just wondering how to change the progress color when a certain percentage met? For example: I have a starting progress color of green at 0% when reaching 60% progress color should change to orange and when reaching 80% color should […]

Categories
Development

How to link StaggeredGridView items individually?

Following a tutorial on StaggeredGridView I successfully built a page to display staggered grids of text and an icon. The tutorial stopped short on explaining how to link each grid item separately. I am aware of onTap, GestureDetector, OnPressed, but I can not figure out how to implement any of these in this grid layout […]

Categories
Development

Error: Cannot copy between a TFLite tensor with shape [1,5] and a java object with shape [1,5,4]

I converted a keras model to TFLite and am using a Flutter TFLite package to try and run it. The model loads but once I give it an image the app crashes and produces the error in the title. I am assuming the extra 4 at the end of the java object is what’s crashing […]

Categories
Development

Flutter SliverAppBar which renders the title inside flexible space only when scrolled up

I want to render some cool widget as the title for the FlexibleSpaceBar but when I scroll up this title(the named argument of FlexibleSpaceBar) becomes the title of the appbar instead of this title I want to use some other widget to be displayed in the appbar(Simply a text widget or something). Here is the […]

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

checkbox in a listview inside a ‘Dialog’ not working in flutter

I’m triggering a dialog box on a button click in which I want to print some rows containing data fetched from firestore. The ‘Dialog’ box has a Listview widget where I’m looping through my document snapshot to print rows along with checkboxes in front of them. Basically I want to perform an action on all […]

Categories
Development

How can you set title and icon for a flutter web app?

What I’m trying to do is build a flutter web app that, when displayed in the browser, the tab shows an icon and a title (as currently it only shows the world icon and the localhost… title). Actual Result : Desired Result : Edit: I can now add the title, as this is set in […]