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 8692523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:19:41+00:00 2026-06-13T00:19:41+00:00

My attempt to simply ‘Extend’ the Map class fails because List is an interface

  • 0

My attempt to simply ‘Extend’ the Map class fails because List is an interface and cannot be extended but must be implemented.

The goal was simply to add a few methods on top of some existing class such as:

List.add_unique(item) where I only want to append if the item does not already exist. This can be done nicely by and-ing the append !=null logic with List.indexOf(item) != -1 (where -1 is notFound). This would be a good and easy to understand example?

But, how to accomplish this in the shortest, least overall overhead sort of way? I think I would be OK with loose typing – at least to start with.

There are other methods I wish to add and or modify such as an .add() method for the Map class.

I have not dealt with interfaces for many years and I’m thinking there might just be a much easier way overall to get started on this side of my project.

Thanks!

  • 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-13T00:19:42+00:00Added an answer on June 13, 2026 at 12:19 am

    I’ve hit this problem too. The best workaround at the moment is to create a class that forwards all of the method calls. Something like:
    https://github.com/dart-lang/html5lib/blob/master/lib/src/list_proxy.dart

    Then you can inherit from ListProxy and override or add whatever methods you need.

    If people find this useful enough, maybe we can put it in its own pub package. I’m hoping we can get dart:core fixed, though, so it supports inheritance from all of the core collection classes.

    By the way, if you’re trying to override a method in Map it’s much easier: you can import 'dart:coreimpl'; and extend HashMapImplementation.

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

Sidebar

Related Questions

Simply trying to extend View and do some custom work, but Eclipse will complain
I attempt to use webservice return POCO class generated from entity data model as
I have been at this for hours now and I simply cannot figure it
I am going to attempt to keep this as simple as possible, but the
I simply have a table that contains a list of countries and their ISO
I'm simply trying to change a hover trigger to a click but for some
I have searched the web in attempt to work this problem out but to
I have a list of dicts that stores URLs. It has simply two fields,
First off, this is homework, but I am simply looking for a hint or
I have a new project which simply put, is an attempt to formalize the

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.