Coder Social home page Coder Social logo

Comments (6)

eernstg avatar eernstg commented on July 28, 2024 1

A class instance member named m will always have a higher priority than any extension instance member with the same name. You can use this.property to indicate that you wish to use an inherited property, which is helpful in the case where another property is in the lexical scope. Here is an example that shows a few scoping properties including those two:

String property = "global";

class A {
  String property = "instance";
}

class B extends A {
  void foo() {
    print(property); // 'global'.
    print(this.property); // 'instance'.
    print('$otherProperty, ${this.otherProperty}'); // 'extension, extension'.
  }
}

extension on B {
  String get property => 'unused';
  String get otherProperty => 'extension';
}

main() => B().foo();

from sdk.

devoncarew avatar devoncarew commented on July 28, 2024 1

We do have community guidelines here as well :) Generally, asking questions here doesn't scale - community resources do. This issue tracker is better for bug reports and feature requests.

from sdk.

devoncarew avatar devoncarew commented on July 28, 2024

FYI, general questions on Dart usage are better asked on other community resources, such as stack overflow and those listed at https://dart.dev/community.

from sdk.

busslina avatar busslina commented on July 28, 2024

@eernstg

Thanks again for a wonderful explanation. This time it didn't bother me but another time, with statusCode or success I think, I spent many time to realize what was going on. It was very weird because it was a global property but not in the same file (was Dart global I think). I will try to find it and share here for the record.

UPDATE: It was a global of another package of me. So, yes, Now I know that I have to care about this.

from sdk.

busslina avatar busslina commented on July 28, 2024

FYI, general questions on Dart usage are better asked on other community resources, such as stack overflow and those listed at https://dart.dev/community.

I shared a war video (t.me link) on Discord Flutter off-topic with an advisor, and I got banned. (+ also in Discord Dart for commenting the incident). GitHub is more secure for me because it has no off-topic :)

from sdk.

busslina avatar busslina commented on July 28, 2024

Yeah, I usually report incidents rather than questions:
imagen

from sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.