Issue The dart code I compile is: import ‘dart:js’; import ‘package:dio/dio.dart’; final Dio _dio = Dio(); class LoginResponse extends GenericResponse { String? accessToken; String? refreshToken; LoginResponse(statusCode, this.accessToken, this.refreshToken) : super(statusCode); } Future<LoginResponse> login(String phoneNumber, String password, String otp) async {
Continue readingTag: dart2js
What's the most efficient way to make a single-item Iterable in Dart?
Issue In Dart, single-item iterables can be created in various ways. [‘item’]; // A single-item list Iterable.generate(1, (_) => ‘item’); // A single-item generated Iterable How do these methods compare in terms of speed and memory usage, during both creation
Continue readingBitwise operations, wrong result in Dart2Js
Issue I’m doing ZigZag encoding on 32bit integers with Dart. This is the source code that I’m using: int _encodeZigZag(int instance) => (instance << 1) ^ (instance >> 31); int _decodeZigZag(int instance) => (instance >> 1) ^ (-(instance & 1));
Continue readingWhich dart2js command is launched by DartEditor?
Issue After reading article found at https://www.dartlang.org/articles/web-ui/tools.html, I tried to compile my application by following it. My application stored in web/app.html can be successfully compiled to Javascript under DartEditor by using “Run as Javascript” command. When I try to use
Continue readingIs there any tool like gruntjs can convert dart to js when project file changes?
Issue I’m looking for a tool like “gruntjs” which can monitor my dart project, and when file changes, it’s able to: convert dart files to javascript files restart my custom dart command: dart app.dart I don’t find any plugin for
Continue readingCompile dart in the browser
Issue In my application I generate big dart classes. Right now I compile them on the server, which takes CPU time. It would be much better to compile the Dart code within the browser. The code is then loaded via
Continue reading$ in '–global-js-name==', JQuery compatibility and Sublime Text – Build Systems
Issue By default JS script generated by dart2js has global name $ same as JQuery so it can be problematic to use both simultaneously. To solve this problem dart2js has parameter –global-js-name=={GLOBAL NAME} but {GLOBAL NAME} must match \$[a-z]* (example:
Continue reading'Mi' is not a subtype of type 'IF' with dart2js
Issue I’m facing an issue with dart2js since today, dart2js go to the end without any error, but when i launch my webapp on a browser (Chrome) the console send this error “Uncaught type ‘Mi’ is not a subtype of
Continue readingAdding children to SelectElement in Dart
Issue I am creating a (very large) select element that needs to be added in several places on a single page. Instead of recreating it for every instance I am making a single prototype and then doing a deep clone
Continue readingHow to use javascript polyfills with dart2js
Issue I want to use indexedDB polyfill with Dart code compiled to Javascript. When i just added required script, dart2js code does not recognize window.indexedDB property as IDBFactory instance and produce UnknownJavaScriptObject interceptor. I tried to force constructor.name on elements
Continue reading