Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 07 18:54
    @timsneath banned @hpoit_gitlab
  • Aug 07 18:54
    @timsneath banned @hpoit
  • Jan 31 22:29

    dart-bot on master

    Add pkg/analysis_server/pubspec… (compare)

  • Jan 31 22:12

    dart-bot on master

    First stab at tests for "Spread… (compare)

  • Jan 31 22:10
    jackokring opened #35830
  • Jan 31 21:14

    dart-bot on master

    [vm, gc] Use work stealing for … (compare)

  • Jan 31 21:05

    dart-bot on master

    [vm] Simplify VirtualMemory::Tr… (compare)

  • Jan 31 20:15
    renatoathaydes opened #35829
  • Jan 31 20:13

    dart-bot on master

    [vm] Maintain view-ness of byte… (compare)

  • Jan 31 19:59

    dart-bot on master

    Add the capability in analysis … (compare)

  • Jan 31 19:35
    jmesserly closed #33685
  • Jan 31 19:19
    srawlins opened #35828
  • Jan 31 18:35

    dart-bot on master

    Add a "summary-deps-output" opt… (compare)

  • Jan 31 18:33

    dart-bot on master

    Extract EnumListParameter value… (compare)

  • Jan 31 18:09

    dart-bot on master

    Fix override_on_non_overriding_… (compare)

  • Jan 31 17:46
    stereotype441 labeled #35827
  • Jan 31 17:46
    stereotype441 labeled #35827
  • Jan 31 17:46
    stereotype441 labeled #35827
  • Jan 31 17:46
    stereotype441 opened #35827
  • Jan 31 17:23
    srawlins edited #35826
Jonathan Rezende
@jodinathan
if Base is abstract, then the case B is better
abstract class Base {
  bool get doSomething;
}
class Foo implements Base {
  @override
  final bool doSomething = true;
}
István Soós
@isoos

@BasketballICO_twitter: it depends on (1) the number of such properties, (2) how deep your class hierarchy goes and (3) how often do you need to change it from the defaults.

Case A is great if you have only a few, or you don't have many subclasses or if you override it all the time. Case B is better if you override only a few of them at a time, but need to preserve them in the hierarchy chain.

Basketball ICO
@BasketballICO_twitter
Thank you, I really appreciate your opinions. :D
@jodinathan base is abstract, but the propery have a default value, and its value is rarely changed, but it must be possible.
@jakemac53 thanks
@isoos thanks, at the moment only have 3 properties, and the inheritece is only 1 level, i will go for pass parameters via super constructor 😀.

Respect this, how can add documentation to this parameter, currently I add to the constructor like this: is the same of this question


class Base{
  final bool _foo;
  final bool _bar;
  /// bla, bla
  /// [foo]:  bla bla....
  /// [bar]: bla bla...
  Base({bool foo, bool bas}) :
          _foo = foo,
         _bar = bar;
}

This is the right way? thanks

Jonathan Rezende
@jodinathan
you could also do:
class Base {
  final bool foo;

  Base(this.foo);
}
Basketball ICO
@BasketballICO_twitter
Thanks but I want/prefer to keep this variable private for user
Navid
@navidshad
hi everyone
how to use window.onError event stream? I want to get the error message.
Jimmy Forrester-Fellowes
@jimmyff
I'm get out of memory errors running a command line dart app (it's generating image intensive PDFs ) - is there a flag to allow it to have more memory?
actually, i think it's taking all my memory :laughing: hmm
Jimmy Forrester-Fellowes
@jimmyff
fixed it, just need to remove old PDF's from memory after finished writing them to disk
Jacob MacDonald
@jakemac53
@jimmyff also you might want to use a Pool from package:pool to limit the number you process at a time
Jimmy Forrester-Fellowes
@jimmyff
ah okay, i'll check that out. Thanks @jakemac53
Jacob MacDonald
@jakemac53
basically:
final pool = Pool(<pool-size>);

pool.withResource(() => doMemoryIntensiveStuffHere());
Jimmy Forrester-Fellowes
@jimmyff
ah great, that's perfect. Thanks so much @jakemac53
Paul DeMarco
@pauldemarco
has anyone ever seen build_runner hang after 30 seconds ?
[INFO] 30.5s elapsed, 1127/1143 actions completed.
I'm trying to generate the entirety of Stripe API using openapi-generator and auto_data
It seems to freeze around this asset everytime. Not really sure how to debug this...
Simon Binder
@simolus3
It should tell you which input and which builder is causing the delay (maybe try running with -v?)
István Soós
@isoos
@jimmyff: what are you using to generate pdfs?
Jacob MacDonald
@jakemac53
@pauldemarco ya it sounds like a specific builder is hanging - it should alert you every 15 seconds or so if no actions have completed with a list of pending actions
Jimmy Forrester-Fellowes
@jimmyff
@isoos package:pdf -it's basically reimplemented the flutter widget system, very cool package
István Soós
@isoos
wow, nice, good to know!
Jimmy Forrester-Fellowes
@jimmyff
Hey @jakemac53 , i implemented package:pool however I still get the out of memory error although now my host systems memory doesn't go through the roof. I have a work around (I create all the PDFs individually and stitch them together at the end), so this isn't a major issue for me:
Exhausted heap space, trying to allocate 268435472 bytes.
Unhandled exception:
Out of Memory
#0      List._allocateData (dart:core-patch/growable_array.dart)
#1      List._grow (dart:core-patch/growable_array.dart:251:19)
#2      List.addAll (dart:core-patch/growable_array.dart:181:9)
#3      PdfStream.putBytes (package:pdf/src/stream.dart:47:13)
Jacob MacDonald
@jakemac53
@jimmyff did you try smaller pools also (even size 1)? If it just uses a ton of memory there isn't much to be done
Jimmy Forrester-Fellowes
@jimmyff
ah okay, sorry yeah I should have tried reducing the pool size, I'll give that a tweak. It's definetly improved the memory consumption already
Wenlong
@luo276785794
hi,everyone
Paul DeMarco
@pauldemarco
i'm slightly confused here with protobuf JSON output... .toProto3Json() does not output a valid JSON string, and I'm required to use jsonEncode(person.toProto3Json()) when sending, and Person()..mergeFromProto3Json(jsonDecode(data)) when receiving. Is this intended operation?
It's not too bad, just a bit confusing with all the JSON options
I suppose I should just use protobuf without the json serialization :)
Victor Lin
@vlin59_twitter
Hi, would anyone happen to know how to get the unminified output of dart2js when running webdev build? I saw in the docs the —no-release flag but that uses the ddc.
Ah it looks like we still would minify in debug mode, that is probably a bug, but in any case you can also override the dart2js_args option of the same builder
So basically the command line way is to add --define "build_web_compilers|entrypoint=compiler=dart2js" --define "build_web_compilers|entrypoint=dart2js_args=[\"--no-minify\"]"
Jacob MacDonald
@jakemac53
Just updated that actually, I guess it minifies by default so you have to explicitly pass --no-minify
Victor Lin
@vlin59_twitter
Ahh… ok thanks. I’ll update my build.yaml
Jacob MacDonald
@jakemac53
that is easier ;)
Paul DeMarco
@pauldemarco
I'm trying to generate a gRPC web client stub for dart. Is the generated code supposed to consider the stuff inside (google.api.http)? https://cloud.google.com/apis/design/standard_methods#create
rpc CreateBook(CreateBookRequest) returns (Book) {
  option (google.api.http) = {
    // The `parent` captures the parent resource name, such as "shelves/1".
    post: "/v1/{parent=shelves/*}/books"
    body: "book"
  };
}
Tõnis Ostrat
@tonisostrat
is it possible to have the dart formatter preserve empty lines between import statements?
import 'dart:io';
                // this one remains
import 'package:myapp/some/thing.dart;
                // this one gets removed
import 'package:flutter/material.dart';
István Soós
@isoos
@tonisostrat: after formatting an empty line remains between imports if there were any, so you can control it by hitting enter if you want to keep the line, and remove it when you want it to get removed.
Tõnis Ostrat
@tonisostrat
interesting, i tried it out on the command line and it does work.. but when i do the format in Android Studio the blank lines get removed. the problem is i've specified AS to use the dart formatter and there are no import line settings anywhere i can see :/
anybody had the same problem?
AdamSGit
@AdamSGit
Hi guys ! What would be the dart equivalent of the javascript expression var result = foo || bar; ? Thanks
h4xhor
@h4xhor

Hi @AdamSGit , if foo and bar are booleans I think it'd be the same.

From the gudes http://dartdoc.takyam.com/articles/js-dart-interop/ I'm trying to get Dart to call a JavaScript function that is asynchronous like this:
var result = await obj.callMethod('some_async_function', [some_parameter]));

The problem is that result is always {} so I'm assuming the JavaScript function returns immediately. Is there a way to call the function using await from Dart? Thanks.

Simon Binder
@simolus3
@AdamSGit If you're using the logical or as a null coalescing operator, the Dart alternative would be ??. So foo ?? bar would be foo it it's not null, bar otherwise. But as @h4xhor said, they're the same for non-null booleans.
@h4xhor Shouldn't the JavaScript function return a Promise if it's async? You can convert promises to Dart futures by importing dart:html_common and then using convertNativePromiseToDartFuture(promise), which can be await-ed.
AdamSGit
@AdamSGit
@simolus3 Finally ! Thanks mate. Thanks @h4xhor as well.