Questions tagged [dart-2]

Dart 2 is changing the Dart language in many ways, some of which are not backward-compatible.

60 questions
0
votes
0 answers

Flutter PHP MYSQL - Http post convert list of numbers as a string from flutter, to list of numbers as integers on PHP API for mysql query

I know there are too many related questions to the title, but so many answers out there didn't help me achieve what i'm trying to do. I am trying to execute the following code example on mysql: SELECT * FROM users WHERE user_id in (1, 2, 3, 4) The…
Texv
  • 1,225
  • 10
  • 14
0
votes
2 answers

How to compare 2 arrays of different lengths and look for matching values - Flutter

I'm not sure if my strategy or logic is correct to achieve this, but I have 2 lists coming from 2 different jsondata mysql queries, let's say they look like this: List newsAgency = [{id: 1, name: 9news, image: x} {id: 2, name:…
Texv
  • 1,225
  • 10
  • 14
0
votes
1 answer

Dart perform runtime subtype checking

I would like to perform runtime subtype checking in Dart without using dart:mirrors. What I mean by this is that given two types A and B, either as variables with type Type or as type arguments on a generic class (i.e the variables being checked…
0
votes
0 answers

I've created my search_dart file but I keep getting this flutter error LateInitializationError: Field 'docsSnap' has not been initialized

I am building a Flutter application and I have integrated Firebase. I'm trying to launch my homedart after the dart2 update but for some reason I cant just need some help I've attached the code below: `class SearchPage extends StatefulWidget { …
0
votes
2 answers

The getter 'value' isn't defined for the type BehaviorSubject<>

After I updated the code to adapt flutter null safety the code below gaves me the error The getter 'value' isn't defined for the type 'BehaviorSubject'. final _brightness = BehaviorSubject(); ... if (_brightness.value ==…
rozerro
  • 5,787
  • 9
  • 46
  • 94
0
votes
0 answers

Dart2 Grammar not recognizing Collection literals

i'm using a grammar from https://github.com/antlr/grammars-v4/blob/master/dart2/Dart2.g4, and trying to recognize Collection literals, tehre is an example of a sample in https://dart.dev/#try-dart, but the grammar does not recognize "var", and in…
PMimosoS
  • 9
  • 1
0
votes
1 answer

Analyzer to find unchecked access to potential null values

I am trying to find out what the status of avoiding unchecked access to null with compiler/analyzer support is in Dart. Having done a couple of years of TypeScript, their strict default-non-null was a huge step forward in making code much safer. I…
user3612643
  • 5,096
  • 7
  • 34
  • 55
0
votes
1 answer

Upgrading to Dart2 gives me silent errors

I have a fairly involved 1.0 dart app I'm trying to upgrade along with another programmer, and we keep being stumped by silent errors. Just in time compilations fail with no information other than just "Build Failed". Running build_runner in…
J.R.
  • 5,789
  • 11
  • 55
  • 78
0
votes
0 answers

Calling a function expecting parent class type with subtype argument

I have started migrating my code from Dart 1.24 to Dart 2.1.0 and I am having some issues with some type casting in functions right now. I have the following code, which is basically a login page on which I register the enter key and the mouse click…
Alex Blais
  • 145
  • 1
  • 2
  • 6
0
votes
1 answer

Angular dart: How to inject a service in a multi level package environment

Dart 2.0.0 Angular 5 I have an application divided into two packages. Let's say that we have package A and package B, that depends on package A. In package A I have a class that uses the service "ServiceA". Now, in package B I have a service called…
J F
  • 1,058
  • 2
  • 10
  • 21
0
votes
1 answer

Migrating to Dart 2 I get a "check imports error" that means that some templates have not been generated

I'm trying to migrate to Dart 2, I have a lot of packages and up to now I could do my job with not so much problems. Now I'm getting a strange error bot with DDC and dart2js: [SEVERE] build_web_compilers|entrypoint on web/main.dart (cached): Unable…
J F
  • 1,058
  • 2
  • 10
  • 21
0
votes
1 answer

Build a non minimized project with dart2js

Have a project builds and runs with webdev serve ok. With webdev build it builds and deploy fine, but crashes when loading in the browser. In order to do better debugging I would like a non-minimized build, but got hit by some other error. Have now…
Jonas Bojesen
  • 855
  • 1
  • 8
  • 22
0
votes
1 answer

Where can I find dart 2 webdev binaries?

I'm migrating an application to Dart 2 and AngularDart 5. I used to build the application on a Jenkins server using 'pub build', (part of the SDK). I included 3 SDKs in the project (one for each Windows, Mac and Linux) and was able to build OS…
Tamas
  • 89
  • 7
0
votes
1 answer

Which directives do I need to import to use material-list-item?

I'm migrating an application to Dart 2 and Angular 5. I have this code in an html file {{key}} Everything works if I declare the use of…
Tamas
  • 89
  • 7
0
votes
3 answers

search in maps dart2 , same as list.indexOf?

I Use this sample for search in Map but not work :|: var xmenList = ['4','xmen','4xmen','test']; var xmenObj = { 'first': '4', 'second': 'xmen', 'fifth': '4xmen', 'author': 'test' }; print(xmenList.indexOf('4xmen')); // 2 …
A1Gard
  • 4,070
  • 4
  • 31
  • 55
1 2 3
4