Posts by Matheus Ribeiro • 4,942 points
219 posts
-
0
votes1
answer31
viewsA: How to read multiple values in a single line on Dart?
You can use the function split() that breaks the String according to the tab you inform and turns into a List. So you only need to recur only once the value and then treat it to be used in the other…
-
0
votes1
answer18
viewsA: object appears in console but is not added to list
Come on, there are 2 points that are causing your problem... first If your list will be mutable, ie, will have its status changed, the variable _list must be declared within the state and not in the…
flutteranswered Matheus Ribeiro 4,942 -
3
votes1
answer54
viewsA: Flutter: snapshot.data does not load Json value
From Dart 2.0 was included the Nullsafety that brings extra security to us while we are developing our application. Actually many courses are lagged at this point by being something more "current".…
-
0
votes2
answers26
viewsA: Open Alert when user enters access screen
You can use the initState() of Statefulwidget, only need to wait for the screen to be built, to have the correct access to the context of the same. Below is an example of how it can be done: import…
flutteranswered Matheus Ribeiro 4,942 -
1
votes1
answer31
viewsA: Problem displaying a captured json from an API in my column widget - Flutter
You haven’t told us exactly what your problem is, but looking at your JSON, it’s possibly a problem with the way you treat it, change the following block to: Future<Perfil> listar() async {…
-
1
votes2
answers1817
viewsA: Error: The argument type 'String? ' can’t be Assigned to the Parameter type 'String' because 'String? ' is nullable and 'String' isn’t
Your problem is that you are using null-Safety and are trying to pass a value String? for a parameter that asks only String... Like the guy var "becomes" the type of value you report, it becomes a…
-
0
votes1
answer43
viewsA: Flutter Listview does not show updated data
You’re putting some things in the wrong places... Objects that may change, must be inside the State when you are using Statefulwidget, then make the following modifications: class…
-
1
votes2
answers70
viewsA: How to wait for return to continue running the app? - Flutter
The way you did, there are two ways out... 1st Form (Not the best) Let the onPressed of Elevatedbutton async and await the return of Future, even though it’s void. ElevatedButton( onPressed: ()…
-
1
votes1
answer32
viewsA: When writing in input the text starts in the middle instead of the beginning
Your problem is in question the padding... TextFormField( decoration: InputDecoration( contentPadding: EdgeInsets.fromLTRB(50, 38, 50, 10), filled: true, fillColor: Colors.blue, border:…
-
2
votes1
answer50
viewsA: Flutter - message is only sent if all fields are filled
As you are starting, I leave as a hint, that go a little at a time, try to understand a little more about some points of the framework and language. In your code, just process the image data to know…
-
2
votes1
answer32
viewsA: Problem using firebase Listen with mobx
On the Mobx issue, working with reactive lists requires a small change Instead of using a simple list, like this one: List<Pedido> listPedidos = []; You need to use a ObservableList, thus:…
-
1
votes1
answer164
viewsA: State Management with Flutter
You’ve lost yourself in the midst of asynchronous methods await and then()... There are two ways to do what you want, but I will focus on the Futurebuilder. First let’s modify your method Dice() as…
-
2
votes1
answer184
viewsA: Flutter Mobx+Modular Data Not Loaded
The problem is that a property Observable only reflects your changes when your instance is changed, that is, another object is set as value. In your case as your property is a Model, you are only…
-
1
votes1
answer62
viewsA: View Arrays Data Items
I’ll give you an example of a JSON in the same format as your "item > sub-items", hence you implement it for your case... I will use the following JSON: { "usuarios":[ { "id":"001",…
-
0
votes2
answers90
viewsA: How to dynamically remove all the treble accents contained in a String?
You can do it this way: void main() { String s = "Eaí? Como vai você?"; print(removerAcentos(s)); } String removerAcentos(String str) { var comAcento =…
dartanswered Matheus Ribeiro 4,942 -
2
votes1
answer87
viewsA: Observerlist + Mobx problem
I gave as an example a project of mine from Github and it is on it that I will base myself Campo Minado. In order for your code to be organized in a better way and have all the reactivity you want,…
-
2
votes2
answers77
viewsA: Problem using Mobx and Observerlist
First, when you use the Mobx, inside the Widget Observer no need to use the setState(). Observerlist This type of list, will be listening to the change in the reference of each object it contains;…
flutteranswered Matheus Ribeiro 4,942 -
3
votes1
answer350
viewsA: Add keyboard when using if in Textformfield in Flutter
I couldn’t accurately reproduce your problem, but I was able to get to something close and it might help you... In his Row that possessed the problem, make the following modification: Row( children:…
-
2
votes1
answer23
viewsA: AND no SQL (Firebird)
Use the clause IN UPDATE PRODUTOS SET categoria = '001' WHERE marca IN ('1774', '1775', '1776') You can also use a sub-select there to return the code of the tags you want, for example, if you have…
-
2
votes1
answer68
viewsA: Flutter: Sublist model of the same model, (Class tree)
You need to treat these same sub-categories made with the categories. I’ll leave you an example and you apply for your case, let’s assume that the API returns you a list of users and each user can…
-
1
votes1
answer81
viewsA: 6 positional argument(s) expected, but 1 found. Try Adding the Missing FLUTTER
As the error itself says "You are trying to call a method that has 6 mandatory parameters, but you are only reporting one of them." It’s probably this method here: Future<Avaliacao>…
-
0
votes1
answer847
viewsA: Rangeerror (index) error: Invalid value: Valid value range is Empty: 0
To wait for a request and only then build your screen, you need to use the Widget FutureBuilder, below I leave an example: Future<List<Users>> _getDataProfile() async { var token =…
-
2
votes1
answer40
viewsA: Insert ad for each x item in the list
You can make use of ListView.separated, so it is better organized your code and easier understanding and separation of what is a list item and what is an ad. I’ll leave below an example based on…
-
0
votes1
answer156
viewsA: How to prevent the Bottom menu from displaying over the Drawer menu?
According to the Flutter documentation, it is indicated that there is only one Widget Scaffold in your application, being the first Widget after the Materialapp (If you are using the same):…
-
1
votes1
answer267
viewsA: I am unable to delete in Firebase database with Flutter
You are switching to delete one documentId blank, because at no point are you feeding this property... Here at this point: await advogados.delete(documentId); Change to: If you have the firestore…
-
3
votes1
answer265
viewsA: Difference between debug SHA-1 and production
Briefly SHA-1 is not something "made" by Flutter, but something that Android uses. The SHA-1 DEBUG signature is the most "basic" signature certificate used to run some things while you develop your…
flutteranswered Matheus Ribeiro 4,942 -
2
votes2
answers53
viewsA: Help with Stack, to create template as example
I’ll leave here an example for you to understand and then you exchange the Widgets according to what you need. You’re making the wrong use of Stack and Positioned, so that the Positioned run it…
-
1
votes1
answer39
viewsA: Variable is not being decremented as the line excluded through Dismissible
Your problem is related to your logic, come on... Here you are removing the item from the list, then you remove the item again with the removeAt which in turn returns the deleted item which is a Map…
-
1
votes1
answer82
viewsA: Footer covering other Scaffold widgets
As you want to display a list, from what I understand, with its current structure you can use the Widget SingleChildScrollView, so that you can scroll between the items. How will you work with a…
-
1
votes1
answer260
viewsA: Creating flutter tables generating error in such table
The problem is that you should create all the tables you need when creating the database. Each new table added later should be added along with the version increment "version". For your case, do it…
-
1
votes1
answer290
viewsA: How do I update a Widget via a controller in an Onchanged field?
As you are already working with a TextEditingController, no need to pick up the text directly by OnChanged(), This should solve your problem: import 'package:flutter/material.dart'; void main()…
-
0
votes1
answer365
viewsA: How to put background images in the same listtitle in this Flutter image
I advise you to create a custom Widget to do such an operation, I will give an example using an image of the internet and you make the necessary adaptations to what you need. Create the following…
flutteranswered Matheus Ribeiro 4,942 -
0
votes2
answers82
viewsA: Problem with value animation in Flutter
You can use the Widget TweenAnimationBuilder to make things simpler. In my tests, work with the value as double a more fluid animation has emerged, so I advise you to treat the int as a double only…
-
3
votes2
answers264
viewsA: Listview doesn’t update on the screen!
You have two problems in your implementation. Improving Move the list into the state class. class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); }…
-
0
votes1
answer98
viewsA: Tabbarview with card generating error while loading data into flutter
You need to add one TabController your class to work with the TabBarView. In your case it would be controller: TabController(length: 2, vsync: this) Another thing wrong is that you are creating a…
-
0
votes2
answers46
viewsA: How to implement Voidcallback in a List of Items to list in a Gridview?
As you may notice, the problem is related to constants. You can resolve leaving your callback also constant, as follows: void onClick() { print("Teste"); } const List<ItemExemplo> itenslist =…
-
2
votes1
answer49
viewsA: API call returning delayed data
To load the part of the layout you want, after the API calls there are a few ways, I will give you the example of one and then you try to apply for your case (Since you have not given us much…
-
0
votes1
answer132
viewsA: Datetime.Parse returning wrong time
The function is not wrong, the problem is that you are not taking into account the time zone (Time-zone). This is returned in your JSON: 2020-08-04T07:38:33-04:00 Is being converted to: 2020-08-04…
-
0
votes1
answer42
viewsA: Method cartReference Returning Null (in my firebase has the Subcollection 'Cart', within the 'Users' Collection)
Well come on, in pieces. 1. This is a function, not a variable: void addToCart(Products product) 2. Have you read about Try-catch? It serves to treat errors, for example: try { Int valorTotal = 0;…
-
1
votes1
answer352
viewsA: Another Exception was thrown: Nosuchmethoderror: The getter 'zipcode' was called on null
The problem is that you are not passing a value to your property address by instantiating the class CepInputField, so the constructor returns NULL to it and when accessing it as…
-
1
votes2
answers1866
viewsA: Flutter - How to change the size of a Textfield correctly?
One way out is you try to work with the contentPadding. I’ll leave an example below, test there and see if it fits your case: import 'package:flutter/material.dart'; final Color darkBlue =…
-
1
votes1
answer317
viewsA: Configuration of Flutter web and Firebase
This is the following structure that your index.html must have to work with firebas: <body> <!-- This script installs service_worker.js to provide PWA functionality to application. For more…
-
1
votes1
answer39
viewsA: WB How to make use of Android Studio Profile?
You could try to understand the error message first, right? If it is in English, try to translate it... In English: Exception: Profile mode is not supported for emulators. Translating to English:…
flutteranswered Matheus Ribeiro 4,942 -
2
votes1
answer576
viewsA: How to put text under Boxdecoration Flutter
All you need to do is use one Column with the widgets Container and Text. I advise you to create a separate widget for the items, where you receive as parameter the text and the image you want... So…
-
2
votes1
answer345
viewsA: How to create a Listview.Separated correctly
You’re looking to use a ListView horizontal, so you need to make the necessary adjustments: ListView.separated( itemCount: 25, scrollDirection: Axis.horizontal, separatorBuilder: (BuildContext…
-
1
votes1
answer207
viewsA: Flutter Autocompletetextfield with dynamic hintText
Dude it doesn’t make much sense for you to store the widget in a variable just to get its text if you can create one TextEditingController which serves this purpose. As you said in your comment, I…
-
1
votes1
answer270
viewsA: Wait for an asynchronous function to finish to continue
Just remembering, the functions should always start with lowercase letters (Lower-case). Regarding your problem, I believe you’re trying to capture the user before function…
-
0
votes1
answer385
viewsA: Passage of parameter through the modular
At the click of the home_page item you are doing it right. But you will not pass the parameter to the ChildModule but for the class linked to routers. Do the implementation correctly in the Module…
-
1
votes2
answers235
viewsA: Doubt Flutter: Listview
You have the possibility to join the two lists into one and work validating the data type at the time you use it. Let’s assume you owned these two classes class Infracao { Infracao({this.id,…
-
1
votes1
answer118
viewsA: Doubt Flutter: Listview duplicate data
You are setting the text "INFRACTIONS" fixed to each item in the list... Do the following: body: Column( children: <Widget>[ Container( height: 30, width: double.infinity, child:…