Posts by Naslausky • 2,350 points
96 posts
-
2
votes1
answer46
viewsA: In flutter, is there any difference between using dependencies?
Of documentation of language we can see that: Dev dependencies differ from regular dependencies in that dev dependencies of Packages you Depend on are Ignored. That is, translating, the difference…
-
1
votes1
answer121
viewsA: Error Use of undeclared type , when trying to use the identifier of one screen to carry information, to another
This error indicates that he doesn’t know the type ToDoItem. You are passing on the following Sender: let selectedItem = toDoItems[indexPath.row] performSegue(withIdentifier: "TaskDetailsSegue",…
-
3
votes2
answers464
viewsA: How to make a GIT repository a common system folder again?
When you turn the remote git init a new repository is created. This is nothing more than creating a folder occult calling for .git. All information related to git is contained in this directory. In…
-
0
votes1
answer228
viewsA: Memory management/cloud image storage by Flutter
Looking at the documentation included in the question, we see in the builder network widget Image the following description: All network images are cached regardless of HTTP headers. If cacheWidth…
-
2
votes1
answer155
views -
2
votes1
answer303
viewsA: Increase the size of the Flutter Gesturedetector
Englobe the widget Online in a padding with the value of the "clickable margin" you want: double margemClicavel = 50.0; GestureDetector( child: Padding( padding: EdgeInsets.all(margemClicavel),…
-
1
votes1
answer316
viewsA: missingpluginexception(no implementation found for method distanceBetween on Channel flutter/baseflow.com/geolocator.methods
This error message indicates that the method requested by you was not found. Like that method exists and is correctly used, you should check some points: You need to run the package fetch command…
-
0
votes1
answer163
viewsA: Return value 0 or 1 with checkbox (Dart)
You didn’t put the error line (it’s important to put when you ask a question here), but it’s probably the following: value: _ativado, The error occurs because Property value expects a value of the…
-
1
votes2
answers235
viewsA: Doubt Flutter: Listview
You are responsible for choosing what to display in each case. Its function: (BuildContext context, int index) {} Receives only one index as parameter, it will vary from 0 until the value you put in…
-
1
votes1
answer44
viewsA: Error in logic to replace all phrases within an x file using Bash Shell Script
Inside simple quotes (') everything is interpreted literally. That is, you need to close the single quotes, put something in double quotes ("), and re-open the single quotes.…
-
2
votes1
answer138
viewsA: Set the application version to the default 4 numbers
According to the pubspec documentation: A version number is three Numbers separated by Dots, like 0.2.43. It can also Optionally have a build ( +1, +2, +Hotfix.oopsie) or prerelease (-dev.4,…
-
4
votes1
answer326
viewsA: Best Practices for Creating Widgets
The first case you are creating your own Widget by extending and using composition of other Widgets. This created Widget has methods and attributes that make it possible for Flutter to keep better…
-
1
votes2
answers73
viewsA: Use of a _dolarChanged(String text) void function generating an error message in onChanged
You have two alternatives: You can define your function by specifying the type of the parameter and the return, as follows: [...] TextEditingController controller, void Function (String) function, )…
-
1
votes3
answers331
viewsA: Iterate in Map<List, String>
As another suggestion to the other answer, you can use the method foreach to iterate over all elements of a Map: Map<List, String> _mapList = { [1, 'A']: "1A", [2, 'B']: "2A" };…
-
1
votes2
answers57
viewsA: Track data count shows wrong result
When you do the following: scanf("%f", &salario); you are using the flag %f which is a Float number. You should use the decimal integer, since the variable is an integer: scanf("%d",…
-
3
votes1
answer370
viewsA: Create sublists in python
From what I understand, you need to create a list with n Sublists, all empty. You can do using list comprehension: numeroDeSublistas = 4 self.buckets = [[] for _ in range(numeroDeSublistas)] What…
-
1
votes1
answer52
viewsA: Dartime Format (month name with minuscule letter)
After looking at the Documentation of the Dateformat class, no other parameter seems to do what you want. This "uppercase" information seems to come directly from when you select the locale pt_BR.…
-
4
votes1
answer540
viewsA: Why does Python consider an empty string ('or "") to be present in a simple variable with characters, but not in a composite one?
This behavior can be found in documentation: For container types such as list, tuple, set, frozenset, Dict, or Collections.deque, the Expression x in y is equivalent to any(x is e or x == e for e in…
-
0
votes1
answer36
viewsA: Exclude items from another list
You can use list comprehension: idteste = [item for item in lista if item not in idtrain] Another possible method is the use of Sets. Sets can be subtracted from each other to get the different…
-
4
votes2
answers162
viewsA: Join of lists in Python
Use the method extend of the list: a = [[1, 0, 0, 0], [1, 1, 1, 0], [1, 0, 0, 0]] b = [[1, 0, 1, 0], [1, 0, 1, 1]] a.extend(b) print(a) That returns the desired value: [[1, 0, 0, 0], [1, 1, 1, 0],…
-
3
votes2
answers102
viewsA: Do partial imports bring advantages to the application?
Looking from the performance point of view, use the show/hidedoes not imply necessarily in an improvement. That is, although you tell the compiler that your code will only use one specific class, it…
-
2
votes2
answers197
viewsA: When to use Factory in abstract classes?
Abstract classes are classes that cannot be instantiated Correct. What characterizes it by definition of Dart Language tour is the fact that it cannot be instantiated. and its implementation depends…
-
0
votes2
answers1131
viewsA: Convert Map to String to fill Dropdown in Flutter
The Futurebuilder is a widget that is built based on the last interaction with a Future. When your Future returned by the function _categorias() has not yet completed, snapshot.data will be null,…
-
0
votes1
answer76
viewsA: Flutter Data Passage
You must do this assignment in the method initState: String Dados; @override void initState() { super.initState(); Dados = widget.Dados; } Explanation: At the time you assigned the value to the…
-
3
votes2
answers488
viewsA: Voidcallback x Function what’s the difference?
1) From what I understand Voidcallback is a 'nickname' for void Function() Correct. Because it is open-source, you have checked that it is the same as a function that has no return, and does not…
-
3
votes2
answers546
viewsA: Difference between ways to import with and without 'package:'
The following import : import 'controller/conferencia_controller.dart'; Is an import relative. This means that the specified path is relative to the file that is making the import. Even, it is also…
-
4
votes1
answer71
viewsA: In pubspec.lock, what is a "direct main" dependency?
Let’s assume that in your pubspec.yaml you make clear the need for two dependencies: Dependencia_A: '<3.0.0' Dependencia_B: '<3.0.0' It means that these two dependencies are necessary directly…
-
2
votes1
answer1107
viewsA: Decimal Flutter
From what I understand, your wish is to keep the same number of houses after the decimal point: 12,12345 turns 12,12 0,012345 becomes 0,012 If this is really your case, you can use the method of a:…
-
0
votes2
answers3211
viewsA: Conversion of values into flutter
Use the method parse: double novoValor = double.parse(controllerTextnum.text); As stated in the documentation, it will play an exception if the given string is not valid as double. To prepare for…
-
1
votes2
answers130
viewsA: Set variable with highest existing number in file
The Sort is not working because it is comparing alphabetically and not numerically. One way to fix this is to add digits "0" or " "(space) at the beginning of all numbers so that they all have the…
-
1
votes2
answers834
viewsA: Find the highest vector value
I believe you got confused on the first line that assigned the highest value. for (i = 0; i < n; i++) { if (i == 0) { vet[i] = maior; } if (vet[i] > maior) { maior = vet[i]; } } The right…
-
0
votes1
answer121
viewsA: wrong structure in my code! does not fall in any condition
There are many things that can be improved in your code. As a suggestion, you could check the user input right at the beginning, and only break and loop once, given that the input was adequate. That…
-
9
votes2
answers4605
views -
2
votes3
answers472
viewsA: How to add a new key to a dictionary?
Instead of creating the dictionary with all letters 0, start it empty: dict={} When it’s done dict[chaveNova]=NovoValor, it already includes in the dictionary if that key does not exist. Also, as…
-
0
votes1
answer350
viewsA: How can I create a loop per seconds in python without Sleep or delay
Try using the time library: from time import time tempoAEsperar=10 #Espera por 10 segundos start = time() while (time()-start < tempoAEsperar): #seu código aqui The return of time() is a number…
-
0
votes1
answer321
viewsA: A more efficient Bruteforce
Are you trying to randomly kick passwords using the random.choice(alphabet). This way you don’t keep any control over the passwords already tried, or the ordering of the kicks. I’m not sure about…
-
2
votes5
answers158
viewsA: Python - Function that copies content from one list to another list
According to that answer, the moment you do: dest =orig.copy() What the interpreter does is take the name (or "label") dest, of the internal scope, and place it on the object returned by the method…
-
0
votes1
answer1445
viewsA: Draw an item from the List, and then draw another item from a list with the name that was drawn from the first list
A suggestion is to delete this intermediate between the lists, so you don’t need to have something that links the "Lucas" of a table with the "Lucas1" "Lucas2" of others. You can do this by making…
-
2
votes1
answer95
viewsA: Replace columns of a row when another column starts with a specific word
Use: awk -F, '$4=="\"PEDRO\"" {$8="\"E\""}1' OFS=, nomeDoArquivo Explanation: First we configure the delimiter to be the comma character, since it is a file of type CSV. The expression checks…
-
3
votes1
answer176
viewsA: Function to invert strings in C
There are several problems in your code. First, when you define a literal string with char s[] = "World"; you are allocating only the memory space required for that specific number of characters.…
-
4
votes1
answer113
viewsA: Count letters 'a' from a file, using egrep and wc
Use the parameter to egrep -o which, according to man: Prints only the matching part of the lines. It will print only the part that fits the pattern described by you. This also solves the problem…
-
3
votes3
answers1086
viewsA: Select "Open with" with . bat command
First, if you call a file . bat with a parameter in the command line, you can access it through the variable %1, for example: set caminhoDaImagem=%1 To know how to pass more parameters you can check…
-
0
votes1
answer84
viewsA: My code for the jug puzzle is not working
I believe that your program could have many of its features re-thought, such as the need to have global variables and the need to make use of so many pointers, since there are only three pots.…
-
0
votes1
answer300
viewsA: Problems committing version on Github
You must have downloaded the files without initializing a local repository. Try, in a different directory, rotate the command: git clone url_do_repositório_no_github Then, in this directory, you…
-
-5
votes2
answers202
viewsA: What is the purpose of serialization?
According to the reply in English: Object serialization is the conversion of an object to a series of bytes, so that this object can be easily saved on a storage device or transmitted via a…
-
1
votes1
answer164
viewsA: What problem with my exits from the truth table?
1)In your case, you have arbitrated that if there are no cars passing through any of the streets, the street sign 1 turns green, and the street 2 red. This is no problem. Any combination of values…