Dart/Flutter Flashcards
What does stringList.trim() do?
It trims extra spaces from strings in the list.
How to parse strings to integers in Dart?
int.parse()
How to get input from the user in Dart?
stdin.readLineSync()
How to open multiple folders in VS Code?
Use File > Add Folder to Workspace.
How to create a new Flutter project?
flutter create <project_name></project_name>
What’s the purpose of flutter run?
It starts the development server for a Flutter app.
How to update Flutter and Dart together?
flutter upgrade
How to check the Dart version?
dart –version
What is a Flutter workspace?
A collection of folders and files for a Flutter project.
How to add a folder to the current workspace in VS Code?
Go to File > Add Folder to Workspace
How to save a workspace in Visual Studio Code?
Go to File > Save Workspace As.
What is the purpose of a workspace in VS Code?
to group and manage multiple folders.
How to update Flutter and Dart separately?
Use flutter upgrade for Flutter and manually update Dart SDK.
How to check if Flutter is installed correctly?
flutter doctor
What command starts a Flutter application?
flutter run
How to create a new Dart-only project?
dart create <project_name></project_name>
How can I access an existing database in my Flutter project’s assets?
Use rootBundle.load() to load the database from assets.
How do I open a database directly from my assets in Flutter?
await openDatabase(databasePath)
What does getApplicationDocumentsDirectory() return?
The directory where user-generated files are stored.
How can I join paths in Dart?
Use the join() function from path package.
How can I check if a file or database exists in Dart?
File.exists(path_to_file)
What is the purpose of getDatabasesPath()
It returns the path for storing databases on the device.
How can I define a global variable in Dart?
Declare it outside of any function.
How do I close a database in Flutter?
.close()