Questions tagged [flutter]

0

votes
0

answer
3

Views

Show Local Images and Server Images ( with Caching) in Flutter

I am trying to show the image in a Widget picked from Image-Gallery as well as from the Network loaded images. CachedNetworkImage is working fine with Network-images but when I try to pass selected image from gallery it's not working. CachedNetworkImage( imageUrl: url, placeholder: (context, url)...
user532445
1

votes
2

answer
499

Views

Can I call Kotlin function from Dart

Using Flutter, a kotlin/swift function can be called by something like: file.dart: static const platform = const MethodChannel('my.test.flutterapp/battery'); final int result = await platform.invokeMethod('getBatteryLevel'); file.kt: private val CHANNEL = 'my.test.flutterapp/battery' MethodChannel(f...
Hasan A Yousef
1

votes
1

answer
804

Views

how to make text or richtext scrollable in flutter?

It seems text/richtext only support one page, if the content exceed the screen, you can't scroll up/down. Is there an easy way to enable it? Or I have to use the Scrolling Widgets?
camino
1

votes
1

answer
4k

Views

flutter loop inside a widget

I'm new to flutter and was wondering if anyone would be able to guide me. I would like to irritate through a string that I retrieved from a json file. I would like to display each letter separately. Example below. Output Complete Word: Hi Letter pos 0: H Letter pos 1: I What I tried so far is addin...
Ouardia
1

votes
1

answer
363

Views

How to change colour scroll-overflow indicators?

When the user scrolls to the edge of a list or TabView, an animated blue circle appears on the ending edge. What is this called, and how do I change the colour of it? Cheers.
haz
1

votes
3

answer
648

Views

Does flutter take care of all screen sizes

I had an app idea and i want to develop it in either flutter or react native. I chose flutter because I want to learn a new language (Dart) and i know it's still in beta but I don't need to care about a lot of users for at-least 2-3 months since i am gonna learn dart first and then develop it. So my...
Syed Muhammad Oan
1

votes
2

answer
2.6k

Views

Flutter increase height of TextFormField

I am creating a Flutter app. i made the design like this. My TextFormField form field for email and password heights are small. I want it to be the same size of the button. final email = TextFormField( keyboardType: TextInputType.emailAddress, autofocus: false, initialValue: '[email protected]'...
Sathya Baman
1

votes
1

answer
3k

Views

How to layout a list of cards with various height?

I'm just getting started with Flutter. What is the recommended way to layout a list of cards on a screen? Some cards will have only contain a single object as a line of text, but others that contain multiple objects as lines of text should also have a header within the card. For example, here is a m...
Simpler
1

votes
1

answer
975

Views

Flutter: Firebase Pushnotification On Data Change

After getting the comment, i have deployed this folowing code to my firebase project and it was successfully deploed!.But there is no notifications been send to me. Please check my Firebase Realtime database Screenshot here for better understanding. [ITS SOLVED NOW:IT WILL SEND NOTIFICATIONS TO ONL...
Rajesh Jr.
1

votes
2

answer
1k

Views

Flutter - Create dynamic number of texteditingcontrollers

I am recreating an app I have previously made in Swift, and on one of my pages we call an API and based on the results, we present the user a dynamic number of textfields to search by different search parameters. Is there any good way to do this in Dart/Flutter? Since dart doesn't support generatin...
Matt Lampe
0

votes
0

answer
4

Views

any ways to finish processing a codemagic build on app store connect testflight?

I have used codemagic.io to build and send a flutter project to app store connect. It shows up fine in testflight but the app status never changes from processing... so i can not test the app.
fideldonson
0

votes
0

answer
5

Views

How to implement position: sticky and bottom 0 with Flutter?

I want to build a list view with sticky footer like this article's 'Stick to the bottom?!' in Flutter. In CSS, .main-footer{ position: sticky; bottom: 0; } but how to do with Flutter?
Yuya Matsuo
1

votes
2

answer
70

Views

Flutter: Can't create plugin packages

I'm trying to create a plugin package in order to access some specific hardware APIs, both in Android (using Kotlin) and in iOS (using Swift). To that end, I was trying to follow the instructions here: https://flutter.dev/docs/development/packages-and-plugins/developing-packages I'm right now only w...
nbloqs
1

votes
2

answer
298

Views

How can I convert CachedNetworkImage to ImageProvider?

I want to show CachedNetworkImage in CircleAvatar Widget but backgroundImage parameter require ImageProvider.
Wisit Phusi
1

votes
1

answer
41

Views

In Dart / IntelliJ Idea how to make it an error when you miss a return?

In Dart / IntelliJ Idea how to make it an error (not a simple warning) when you miss a return? If I forget to add a return, it's a simple warning, it's very easy to miss, and this makes me waste a lot of time. warning: This function declares a return type of 'RichText', but doesn't end with a return...
MarcG
1

votes
1

answer
1.8k

Views

How to import third party android library to java file in flutter

I am looking to import a java library to a flutter application. I understand that I will need to call the methods of this java file through a dart bridge or platform channel per https://flutter.io/platform-channels/. However I have yet to be able to make the methods from the library Im trying to imp...
Tkgn15
1

votes
1

answer
885

Views

Flutter app size is huge

I am an Android app Developer using java, and I have come to know about Flutter using dart language created by Google. I found it quite intresting and because it builds the app for both Android and ios. I have created a simple TabsLayout Application for Android, the size of the Application 27MB, ple...
Anas Reza
1

votes
1

answer
1.2k

Views

Update UI after removing items from List

I want to update my ListView if i remove or add items. Right now i just want to delete items and see the deletion of the items immediately. My application is more complex so i wrote a small example project to show my problems. The TestItem class holds some data entries: class TestItem { static int i...
Jens
1

votes
1

answer
509

Views

Flutter (Dart) remove firebase database Listener

I add an firebase database Listener to my flutter project as below: databaseReference = database.reference().child('community_board'); databaseReference.onChildAdded.listen(_onEntryAdded); databaseReference.onChildChanged.listen(_onEntryChanged); For Kotlin and swift of firebase, I have to remove th...
GPH
1

votes
1

answer
1k

Views

Flutter- compute method

I'm trying to execute heavy method by compute(). I tried like so. After loop executed, Text widget update but result returns 0 almost right after button was pressed. Does anyone know what am I missing? int _counter; static int loop(int val) { int count = 0; for (int i = 1; i
Daibaku
1

votes
2

answer
233

Views

Empty set state what is the point?

I want to know the point behind calling setState without setting a new value to the variables. readLocal() async { prefs = await SharedPreferences.getInstance(); id = prefs.getString('id') ?? ''; if (id.hashCode
Aya Elsisy
1

votes
2

answer
585

Views

TextField with animated hint / label

I want to implement a form containing TextFields. Each field has a label / hint. I want the hint to animate and become a label when the user starts typing. This is a standard Material design pattern, so I expected it to be implemented by the standard Widgets. Something like this:
Frank Harper
1

votes
1

answer
697

Views

How to go on about receiving JSON array in flutter and parsing it?

I am trying to get a JSON array from a webservice URL and parse it in JSON. The thing is the tutorial I was following shows receving one JSOn obj and parsing it but I need to know how to receive a JSON array and parse it. Below is the code I am working on, I am stuck. Model class Fact { int id; int...
defiant
1

votes
1

answer
703

Views

Flutter: add a floating action button to an image

I'm trying to add a floating action button to an image. The button will be used to change the selected image. I want the button to float over the bottom right of the image. So far all I can do is add the floating action button directly below the image. Thanks for any help! @override Widget build(Bui...
nalyd88
1

votes
1

answer
598

Views

Flutter parsing json with DateTime from Golang RFC3339: FormatException: Invalid date format

When trying to read json files generated with golangs json package in Dart / Flutter I noticed that parsing dates produce an error: FormatException: Invalid date format An example is the following json generated on the Go server: { ... 'dateCreated': '2018-09-29T19:51:57.4139787-07:00', ... } I am u...
Oswin Noetzelmann
1

votes
2

answer
225

Views

Flutter: how to avoid special characters in validator

I have this validation function: class FormFieldValidator{ static String validate(String value, String message){ return (value.isEmpty || (value.contains(**SPECIAL CHARACTERS**))) ? message : null; } } I would like to indicate that doesn't have to contain special characters, but how can I say it?
Little Monkey
1

votes
2

answer
107

Views

How to set the width of a Container based on the length of its child Text? Flutter

I am Trying to develop a chat app and I am trying to display the text messages inside a container and set the width according to the length of the message. How can I set the width according to the length of a String? P.S messages are displayed using listview.builder and each container has a backgrou...
Ashutosh Sharma
1

votes
1

answer
791

Views

How to inner-join in firestore

I want to build a view to show some events inside a listview in my app like this: I have these two tables: Users   Events But I don't know how do a 'inner join' between the tables USERS and EVENTS... I tried this: import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/materi...
Matheus Ribeiro
1

votes
1

answer
923

Views

Make AppBar transparent and show background image which is set to whole scrren

I have added appBar in my flutter application. My screen already have a background image, where i don't want to set appBar color or don't want set separate background image to appBar. I want show same screen background image to appBar also. I already tried by setting appBar color as transparent but...
Rahul Mahadik
1

votes
2

answer
490

Views

Center widget vertically inside a SingleChildScrollView

I'm new to Flutter so I train myself by making a simple form. I realized while I was debugging on my iPhone the virtual keyboard triggered an error : 'A RenderFlex overflowed by 29 pixels on the bottom'. I fixed this issue by wrapping my Container inside a SingleChildScrollView. The problem now is...
Hurobaki
1

votes
1

answer
902

Views

How can I have my AppBar in a separate file in Flutter while still having the Widgets show?

I am currently building a Flutter app that recommends restaurants around the area. However, I've gotten myself in quite the kerfuffle. I want my app to have the code for the AppBar separate from the code for each screen for the sake of organization and cleanliness. So, I built KainAppBar.dart as th...
Xavier Paolo Jamito
1

votes
2

answer
493

Views

flutter : how to persist a List<num> using shared preferences?

how to persist a List like List = [2.5, 5, 7.5, 10] using SharedPreferences please ? EDIT : how to convert stored data as String or List to List ?
ViralCode
1

votes
1

answer
652

Views

Using Offline Persistence in Firestore in a Flutter App

I'm developing a app that uses Firebase's Firestore to send data to the web. One of the functions of the app is being able to save data in the device while being offline and send it to Firestore when internet connection is restored. I activated offline persistence but it dosen't work. DEBUG CONSOLE:...
Brenno Fagundes
1

votes
1

answer
294

Views

How to let vim do syntax highlight right for flutter?

Some background: I am using VSCode for coding in flutter. But when I open many workspaces, it ate all my free RAM quickly (Macbookpro 8GB). (IntelliJ is even worse.) Sometimes, I just need to check other workspaces' Code etc.. So The best option is to use vim for this purpose. I have installed dart-...
sgon00
1

votes
2

answer
361

Views

How to define custom text theme in flutter?

How to make my own text theme style? I only find the default text theme like this but it's not enough. textTheme: TextTheme( body1: TextStyle(), body2: TextStyle(), button: TextStyle(), caption: TextStyle(), display1: TextStyle(), display2: TextStyle(), display3: TextStyle(), display4: TextStyle(),...
stuckedoverflow
1

votes
1

answer
569

Views

Flutter textfield background color on focus

I have a rounded textfield. It works good, but when user tap on it, a grey color background appears. How can I disable that splash effect? This is my code and result: new Container( margin: const EdgeInsets.only(left: 30.0, top: 60.0, right: 30.0), height: 40.0, decoration: new BoxDecoration( color...
hesam
1

votes
2

answer
254

Views

Make Function parameter optional in custom widget flutter

I try to create some custom widget with some parameter in the constructor. This widget has some optional and required parameter. how can make Function type parameter optional in my Widget. class TextInputWithIcon extends StatefulWidget { final String iconPath; final String placeHolder; final Functio...
Saman
1

votes
1

answer
297

Views

Placing two trailing icons in ListTile

I want to place two icons, side by side on the 'trailing' side of a ListTile. I tried adding a Row widget with the two icons inside, but it completely messed up the layout of the entire ListTile, making it unusable. Is there any way to expand the space allocated for the trailing part? Here's the cod...
avishorp
1

votes
1

answer
134

Views

How to properly wait until future is complete in dart

There is a slight bug in my app made with Flutter, that when the user has signed in, it fetches the user information from my database but not fast enough and causes a visual error on my front end of the app. The app has layouts that use the user information (name, location, and image) and it is not...
user3152311
1

votes
1

answer
109

Views

Calling setState() during build without user interaction

What I did : I have integrated FCM (Firebase Cloud Messaging) in my flutter app. I shared the context and the setState() of each page in static variables with these two lines getting called in all the build functions of my pages : @override Widget build(BuildContext context) { StaticClass.currentCon...
Khalil Bz

View additional questions