Posts by Matheus Ribeiro • 4,942 points
219 posts
-
1
votes1
answer2178
viewsA: How to resolve "the getter data was called on null"?
The problem is you’re instilling your LikesModel within your ScopedModel but is not passing the snapshot to the model, so when you try to access it will give the error that is receiving... Below I…
-
0
votes1
answer381
viewsA: Pass Values through Stream / Bloc
You need to add a few more things to your Bloc, follow the modifications below... In login_bloc.Dart final BehaviorSubject<String> _usuario = BehaviorSubject<String>.seeded("");…
-
3
votes1
answer1051
viewsA: Dart Check if a date is valid
I ran some tests directly on Dartpad and the parse already makes that date check print(DateTime.parse("2019-12-26")); /* Resultado: (Data) 2019-12-26 00:00:00.000 */…
dartanswered Matheus Ribeiro 4,942 -
0
votes2
answers157
viewsA: Pre-inserted text from the database
It even looks like you providing complete example still lacked creation of TextController, but come on, I’ll give you an example and you adjust your need. class CommentStyle extends StatelessWidget…
-
1
votes2
answers524
viewsA: Why this mistake in decorating my container on the flutter?
This error means you cannot use the property color along with the decoration.color... Examples Paint a Container Container( color: Colors.red, width:100, height: 100 ) Create a Container with…
-
0
votes1
answer345
viewsA: Update to Flutter/Dart database
In your class Client create the following method void fromMap(Map<String, dynamic> json) { id: json["id"]; fullname: json["fullname"]; } Note: I used two fields as an example only, implement…
-
3
votes1
answer1630
viewsA: The method 'validate' was called on null. Receiver: null Tried Calling: validate()
What you need is to use a Form, follows an example of how you can do: GlobalKey<FormState> _formKey = GlobalKey<FormState>(); @override Widget build(BuildContext context) { DateTime…
-
1
votes1
answer2975
viewsA: Flutter passing data between screens
I believe your problem may be here: body: ScopedModelDescendant<UserModel>(builder: (context, child, model){ return SingleChildScrollView( child: Container( child: CommentStyle( ), ), ); }));…
-
1
votes1
answer198
viewsA: Error trying to change the configured Locale using a Dart library
You’re probably not instantiating the EasyLocation. In the Github documentation you showed us is told to instantiate the controller on main of your project, that way: void main() =>…
-
3
votes1
answer52
viewsA: NULL value before incrementing
To start variables with zeroed value do so: class ProfilePage extends StatefulWidget { ProfilePage({Key key, this.valueScore=0, this.valueLifes=0}): super(key: key); final int valueScore; final int…
-
2
votes1
answer430
viewsA: Deserialize JSON - Dart/Flutter
Here on this Stackoverflow question I already answered something that solves your question How to compare Map and Json value in flutter?. I saw that you managed to solve your problem, but it follows…
-
5
votes1
answer143
viewsA: Error while running Dart list
You have only missed the return of your method chamarGetGaiola, do so: Future<List<Gaiola>> chamarGetGaiola(String usuario, String token) async { ... } But as your method will return one…
-
1
votes1
answer205
viewsA: Popular Dropdown with api
I answered a similar question a few days ago, you can rely on it to fix your problem by making a small change... That’s my answer to another question How to compare Map and Json value in flutter?…
-
0
votes1
answer1814
viewsA: Keep login active on flutter
Sharedpreferences is one of the ways to do it, I’m using it also in my project. I’ll explain using the model I’m using. Create a class just to keep things in place LocalSettings import…
-
1
votes2
answers785
viewsA: How to compare Map and Json values in flutter?
Seeking to complement the reply of @Juliohenrique, brought some improvements to its development. How can you come to have other data in this JSON informed, it would be a good thing if you put the…
-
1
votes1
answer1303
viewsA: Pass data from one screen to another in Flutter with Firestore
As you have not put what you have already tried in your question, I will make an example medium above so that you understand. Modify your Productscreen class as follows: If you use the…
flutteranswered Matheus Ribeiro 4,942 -
1
votes1
answer455
viewsA: Flutter does not return images from api
According to the error you made available, you are trying to access an image that does not exist on your device. Invalid argument(s): No host specified in URI file://1573130697077_login_enabled.PNG…
-
1
votes2
answers560
viewsA: Check Empty Fluttter async return
Following the structure of your code, try using the .isEmpty if (resultReceita.isEmpty) print("Esta vazio"); else print("Não vazio"); Explanation Your database query may not be returning any record,…
-
1
votes1
answer599
viewsA: Flutter calling a dialog inside an onTap()
Your mistake is passing one showDialog for a Navigator... Modify the block of OnTap() as follows: [...] onTap: () { if (index == 2) _showMaterialDialog(); else { Navigator.push( context,…
-
3
votes1
answer1163
viewsA: Navigation with named routes
Do it this way Modify this part of your code void main() { runApp(MaterialApp( debugShowCheckedModeBanner: false, title: "Ufly BizJets", home: HomeScreen(), routes: { '/': (context) =>…
-
1
votes3
answers858
viewsA: Windows service does not start automatically
You can include your service on automatic Windows startup as follows: Enter the code in the event AfterInstall procedure TService.ServiceAfterInstall(Sender: TService); var oRegEdit : TRegistry;…
-
1
votes1
answer46
viewsA: Count column data and reset after Cpf exchange
From what I understand your problem is more in the matter of mounting SQL. I created an example here, where you can test the solution Example Let’s imagine the following structure of your table…
-
1
votes1
answer352
viewsA: setFocus in the grid column with the name of the field in the database
You can do it this way grdAjuste.SelectedField := cdsDados.FieldByName('id_codigo');
-
4
votes1
answer2254
viewsA: Flutter - How to perform a search in a listview?
The Bloc Pattern brings us, among many other things, the possibility of redesigning only part of our Widgets without having to "modify the whole tree". The way you did, putting your entire widgets…
-
1
votes2
answers529
viewsA: Flutter - How to pass Firestore ID list to a Futurebuilder?
A complication that exists when using the firestore is to perform the JOINS of life... The way you did is an exit to the problem, you just need to perform some small modifications. As you already…
-
1
votes1
answer241
viewsA: How to make only the user who saved the String can see Flutter/Firebase?
You can store in your Customers lockers the user code that entered the Qrcode and then when filtering its lokers you bring only those who have the respective code. When connecting to firebase you…
-
2
votes1
answer1044
viewsA: How to generate, encode and encrypt random string in Flutter
I tested the first code informed by you and it worked correctly... Following the steps of the exercise cited in a comment by you, I did as follows import 'dart:convert'; import 'dart:math'; void…
-
0
votes2
answers47
viewsA: Doubt about SELECT command using IN
Let’s go in pieces 1º SQL select lista, (select if (count(login.LogID) > 0, 'S', 'N') from login where login.LogID = 407 and login.LogID in (11,157,66,158,407)) as Seguindo from Comentarios It…
mysqlanswered Matheus Ribeiro 4,942 -
1
votes3
answers860
viewsA: Deserializar json vector in Dart/Flutter
Here’s an example of how you can do it class Service extends Entity{ int id; int idUser; DateTime startDate; DateTime endDate; String title; String subtitle; String description; double price; int…
-
0
votes1
answer42
viewsA: Parameters Firebase bank
It is possible to do what you want, but anyway you would have to have a . json default file. To connect to another database you would have to create another instance of FirebaseApp and configure it…
-
1
votes1
answer1201
viewsA: #1064 - You have a syntax error in your SQL next to 'DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci' on line 1
Missed you put the name of your database.... CREATE DATABASE IF NOT EXISTS MinhaDataBase DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; To run in your most current Mysql just give a name to the…
-
0
votes1
answer309
viewsA: Use more than one Firebase database in an app created in Flutter
In a quick search, it seems that it is possible to do what you want, but anyway you would have to have a . json default file. To connect to another database you would have to create another instance…
-
1
votes2
answers103
viewsA: Insert value in Table Y for all existing Table X Ids
This should solve your problem insert into premio(contas_id, id_premio, qtd_premio) select contas_id, 01, 1500 from contas Explaining: Will be made one select in all table data CONTAS bringing the…
-
2
votes2
answers666
viewsA: DELETE WITH LEFT JOIN
In your SQL you are referencing the key fields in the clause ON and again at WHERE. Try to put in the WHERE some validation as for example DELETE doacoes, animais FROM doacoes INNER JOIN animais ON…
-
7
votes1
answer2535
viewsA: How to keep Appbar and Bottomnavigationbar between pages
Using the BottomNavigationBar you will not call the screens by Navigation in the normal way, you could use for example a TabView or a PageView to change between your screens. Take an example (One of…
flutteranswered Matheus Ribeiro 4,942 -
3
votes1
answer1130
viewsA: How to use Tformatsettings in Delphi 10 Tokyo?
This is an example of how I use procedure FillFormatSettings(var FSettings: TFormatSettings); begin {$IFNDEF VER180} FSettings:=TFormatSettings.Create('pt-BR'); {$ENDIF}…
-
2
votes2
answers482
viewsA: When is it recommended to Initialize a final property in the Class constructor?
When you use the class shape Cart you can perform validations. When using the : initialized "Initializing Lists" that are expressions executed before constructs of superclass, are also executed…
-
2
votes3
answers3057
viewsA: Current location - Flutter
I saw that you use the getLocation() but it doesn’t use its value, so try something like this: import 'dart:async'; import 'package:location/location.dart'; import 'package:flutter/material.dart';…
-
0
votes2
answers265
viewsA: ORDER BY Mysql - Reporting organisation
See if this SQL helps you with anything: select distinct c.campo1 ,c.campo2 ,c.campo3 ,c.campo4 from message m inner join session s on s.id = m.session_id inner join contact c on c.id = s.contact_id…
-
1
votes3
answers793
viewsA: How to delete only records from a field of my table in SQL
You can do it this way UPDATE produto SET dtsaneamento = null; Edited To delete only records prior to date just do so UPDATE produto SET dtsaneamento = null where campo_data < "2019-01-01"; If…
-
0
votes2
answers1502
viewsA: How to get the value of the variable outside the Future method in Flutter?
The problem is in the method loadPdf(), do as follows: Future<void> loadPdf() async { try{ var dir = await getApplicationDocumentsDirectory(); setState(() { path =…
-
0
votes1
answer188
viewsA: How to pass a second parameter using . htaccess to php code?
If you just repeat the rule of the first parameter it does not work? RewriteRule ^statusmesa\/?([0-9]+)\/?([0-9]+)\/?$ statusmesa.php?idmesa=$1&status=$2 Example Example of friendly url:…
-
2
votes1
answer76
viewsA: Data to string conversion
If I don’t understand your doubt wrong, you seem to be doing it contrary to what you need, do it this way: static int ajustaMesAno(DateTime d) { return ((d.Year * 12) + d.Month); } DateTime inicio =…
-
0
votes1
answer469
viewsA: Send special character in Request body via Httprequest in Delphi XE2?
You only need to use the escape characters. Escape character is a way for you to say that character & is a character really and not just a parameter. If you put a character like < inside an…
-
0
votes3
answers340
viewsA: Sort in SQL by prioritizing a specific field value
My answer is the same as the others but I show you another way to use the ORDER BY, see: SELECT id ,id_ls ,id_sistema_ls ,nome ,ativo FROM clientes WHERE id_ls IN…
-
0
votes1
answer81
viewsA: COUNT + JOIN WITH DIFFICULTY IN RESULT
Try using this SQL, make the necessary modifications according to your fields: SELECT DISTINCT COUNT(IIF(((V.DATA_SAIDA IS NOT NULL)AND(V.DATA_CHEGADA IS NULL)AND(V.ID_MOTORISTA IS NOT NULL)) ,1…
-
1
votes3
answers69
viewsA: Mysql - Query using Between to know if item is reserved on date/time
It’s not enough you add the clause OR? Staying that way: SELECT * FROM intranet_reuniao WHERE resId = 5 AND ((reuDataInicio BETWEEN '2019-02-26 14:30:00' AND '2019-02-26 16:30:00')OR (reuDataTermino…
mysqlanswered Matheus Ribeiro 4,942 -
2
votes2
answers307
viewsA: Mysql - Query in related tables
This way it should serve you... Note that the field tbl2_criterio is one, and in your SQL you are playing it several times on where, then you ask SQL to result only the records that the field…
-
2
votes2
answers95
viewsA: Problem in SELECT INNER JOIN. Appearing ID instead of name
SELECT P.* ,T.tipo ,C.categoria ,S.subcategoria FROM tbl_produtos P INNER JOIN tbl_tipos T ON P.tipo_fk = T.tipo_id INNER JOIN tbl_categorias C ON P.categoria_fk = C.categoria_id INNER JOIN…
-
0
votes2
answers518
viewsA: Firebird perform automatic reset on Generator
Generator doesn’t always increase +1 when searching for it, see the examples: Here will be incremented +1 to Generator SELECT GEN_ID(GENERATOR, 1) AS ID FROM RDB$DATABASE Already this way below,…