Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

dart .. operator

Zion answered on May 18, 2022 Popularity 9/10 Helpfulness 5/10

Contents


More Related Answers

  • dart and or
  • dart power operator
  • dart spread
  • flutter difference between ? operator and ! operator
  • dart string equals
  • ?? in dart
  • dart is keyword
  • dart null aware operator ??
  • what means ?? in dart
  • object in dart
  • dart operator overloading
  • flutter Null check operator used on a null value
  • /// in dart
  • operators vs symbols in flutter
  • ternary operation in dart

  • dart .. operator

    2

    Cascades (..)

    Basically its like then() for objects 


    To perform a sequence of operations on the same object, use cascades (..). We’ve all seen an expression like this:

    // code

    myObject.someMethod()

    It invokes someMethod() on myObject, and the result of the expression is the return value of someMethod().

    Here’s the same expression with a cascade:


    // code

    myObject..someMethod() 


    Example

    var button = querySelector('#confirm');

    button?.text = 'Confirm';

    button?.classes.add('important');

    button?.onClick.listen((e) => window.alert('Confirmed!'));

    button?.scrollIntoView();


    With cascade

    querySelector('#confirm')

    ?..text = 'Confirm'

    ..classes.add('important')

    ..onClick.listen((e) => window.alert('Confirmed!'))

    ..scrollIntoView(); 

    Popularity 9/10 Helpfulness 5/10 Language whatever
    Source: dart.dev
    Tags: dart whatever
    Link to this answer
    Share Copy Link
    Contributed on Mar 09 2023
    Zion
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    5
    Popularity 9/10 Helpfulness 5/10 Language dart
    Source: Grepper
    Tags: dart
    Link to this answer
    Share Copy Link
    Contributed on Nov 10 2022
    Ravin Laheri
    0 Answers  Avg Quality 2/10

    3
    Popularity 10/10 Helpfulness 5/10 Language dart
    Source: Grepper
    Tags: dart
    Link to this answer
    Share Copy Link
    Contributed on May 24 2022
    Vel
    0 Answers  Avg Quality 2/10

    7
    Popularity 10/10 Helpfulness 5/10 Language cpp
    Source: Grepper
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on Aug 15 2022
    Marijuana
    0 Answers  Avg Quality 2/10

    1
    Popularity 9/10 Helpfulness 3/10 Language dart
    Source: Grepper
    Tags: cascade
    Link to this answer
    Share Copy Link
    Contributed on Jul 08 2022
    Wilson Toribio
    0 Answers  Avg Quality 2/10

    1
    Popularity 9/10 Helpfulness 3/10 Language dart
    Source: Grepper
    Tags: dart
    Link to this answer
    Share Copy Link
    Contributed on May 18 2022
    Adorable Alpaca
    0 Answers  Avg Quality 2/10

    0
    Popularity 8/10 Helpfulness 2/10 Language dart
    Source: Grepper
    Tags: dart
    Link to this answer
    Share Copy Link
    Contributed on Aug 13 2022
    Shah Solayman Sinha
    0 Answers  Avg Quality 2/10

    0
    Popularity 8/10 Helpfulness 2/10 Language dart
    Tags: dart
    Link to this answer
    Share Copy Link
    Contributed on Aug 16 2022
    namesaq
    0 Answers  Avg Quality 2/10

    0
    Popularity 9/10 Helpfulness 1/10 Language dart
    Source: Grepper
    Tags: dart
    Link to this answer
    Share Copy Link
    Contributed on Jul 06 2022
    Wilson Toribio
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.