How to run Flutter Official Samples in Visual Studio Code

897

I posted the question on github flutter as a feedback, and a gentleman called VladyslavBondarenko gave me a hint, and finally I figured out how to run the samples: just download the whole official samples from https://github.com/flutter/samples/blob/master/INDEX.md, and then open some of the folders in VS code, and you will be able to compile and run the samples.

However, the compiler complains that there are lots of deprecated APIs used in the codes, which means some of the codes are not updated to the latest version.

Share:
897
BradW
Author by

BradW

Updated on December 17, 2022

Comments

  • BradW
    BradW over 1 year

    I am new to Flutter, and want to run the Flutter Official Samples in Visual Studio Code, but didn't prevail. For example, I managed to copy paste the banner codes into VS code, but it shows error in the second import statement:

    import 'package:flutter/material.dart';
    import 'package:gallery/l10n/gallery_localizations.dart';
    

    I even tried to copy-paste the whole gallery directory from the GitHub samples to the .pub-cache, but still cannot compile the codes properly.

    Does anyone know how to solve my problem?

    Really appreciate.

    Best Regards, Brad