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

  • Home
  • SEARCH
  • 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 8776701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:07:06+00:00 2026-06-13T19:07:06+00:00

I tried using a piece of dart code creating a file with HTML5 file

  • 0

I tried using a piece of dart code creating a file with HTML5 file API. The code was found on some dart slides, slightly fixed to be able to run under M1. I’m using latest Dart SDK 0.2.1.2_r14167. Code is simple (I also tried calling it with last two parameters (callbacks) set with the same result).

import 'dart:html';

void main() {
  window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 50*1024*1024, (fs) {
    fs.root.getFile('log.txt', {"create": true}, null, null);
  });
}

It throws:

Exception: NoSuchMethodError: incorrect number of arguments passed to
method named ‘getFile’ Receiver: Instance of
‘_DirectoryEntryImpl@0x33cc944a’ Tried calling: getFile(“log.txt”,
Instance of ‘LinkedHashMapImplementation’, null,
null) Found: getFile(path, options, successCallback, errorCallback)
Stack Trace: #0 Object.noSuchMethod (dart:core-patch:772:3)

Am I doing something wrong or SDK is broken?

  • 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-13T19:07:07+00:00Added an answer on June 13, 2026 at 7:07 pm

    Yes you are doing it basically wrong, but I wouldn’t blame you since even the IDE seems to do it the way you are doing it!

    Here’s how to do it properly:

    import 'dart:html';
    
    void main() {
      window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 50*1024*1024, (DOMFileSystem fs) {
        fs.root.getFile('log.txt', options: {'create': true}, successCallback: (FileEntry e) {
          print(e.fullPath);
        });
      });
    }
    

    It uses named parameters and the signature for getFile is:

    void getFile(String path, {Map options, EntryCallback successCallback, ErrorCallback errorCallback});
    

    So, if you look carefully, the first parameter is compulsory, but the rest aren’t and in fact can be specified in any order as long as you specify them by their names.

    If you are still confused, read about the named parameters.

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

Sidebar

Related Questions

I tried using curl syntax: curl http:// localhost:8983/solr/update/csv?stream.file=/usr/local/src/apache-solr-3.6.0/example/exampledocs/my+file.csv&separator=;&stream.contentType=text/plain;charset=utf-8 with no luck. I get: -bash:
I tried using the following code for a HTML page, but it doesn't work.
I tried using juggernaut cocoa: https://github.com/fpotter/juggernaut-cocoa Added this line to my code: JuggernautClient *client
I tried using axis2 1.6 (and nightly 1.7) to generate Java code from the
I am using the following piece of code in my app: string_array = getResources().getStringArray(R.array.array_of_strings);
I have a piece of code that I may not be able to change.
I have following piece of code which tries to load an XML file from
I need some help about PHP GD. Here is my piece of code. header(Content-type:
I am having problems writing a piece of code for android. I am using
I have following piece of code which posts some data into database: $post =

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.