Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:46:48+00:00 2026-06-05T22:46:48+00:00

I keep seeing references to _internal in examples like the following: class Symbol {

  • 0

I keep seeing references to _internal in examples like the following:

class Symbol {
    final String name;
    static Map<String, Symbol> _cache;

    factory Symbol(String name) {
        if (_cache == null) {
        _cache = {};
     }

     if (_cache.containsKey(name)) {
        return _cache[name];
     } else {
        final symbol = new Symbol._internal(name);
        _cache[name] = symbol;
        return symbol;
      }
    }

  Symbol._internal(this.name);
}

I’ve gathered from the code that it’s a privately accessible constructor. The last line Symbol._internal(this.name); seems a bit confusing because it appears to be a statement within the class body and not within a method body, leading me to believe it’s actually the internal constructor definition without a method body.

Are my assumptions correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:46:51+00:00Added an answer on June 5, 2026 at 10:46 pm

    The _internal construction is just a name often given to constructors that are private to the class (the name is not required to be ._internal you can create a private constructor using any Class._someName construction).

    For example the following code only allows you to create new persons from outside the class using a caching constructor:

    class Person {
    
        final String name;
        static Map<String,Person> _cache;
    
        factory Person(String name) {
            if(_cache === null) {
                _cache = new Map<String,Person>();
             }
             if(_cache[name] === null]) {
                _cache[name] = new Person._internal(name); 
             }
             return _cache[name];
        }
       
        Person._internal(this.name);
    }
    

    In general Dart treats any _construction as private to either the class or the library that contains it. For example you can define as a global function like this:

    _globalToThisLibaryOnly() {
        print("can only be called globally within this #library");
    }
    

    which can be called from any file that is sourced within the library that defines it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep seeing List derived classes that look something like this class MyClassList :
When reading, I keep seeing references to what they call Business Objects . I've
I've been reading a couple books/online references about compiler theory, and keep seeing that
I have a about brackets like this {} in VB.net. I keep seeing syntax
While trying to learn Unity , I keep seeing the following code for overriding
I keep seeing code that does checks like this if (IsGood == false) {
I've been reading a lot of PHP tutorials lately, and I keep seeing examples
I keep seeing references to being able to execute code from the debugger, but
I keep seeing examples that manually iterate through all of the subviews of a
I keep seeing a phrase like this: //Example one CGPoint backgroundScrollVel = ccp(-1000, 0);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.