Experiment 1:
1. a) Install Flutter and Dart SDK.
System Requirements
● Operating System: Windows 10 or later (64-bit)
● Disk Space: 1.64 GB (does not include disk space for IDE/tools)
● Tools: Git for Windows 2.x, PowerShell 5.0, and a compatible IDE (VS Code, Android
Studio, IntelliJ)
Step 1: Get the Flutter SDK
1. Download the Flutter SDK:
○ Visit the Flutter SDK releases page.
○ Download the latest stable release of the Flutter SDK (the .zip file).
2. Extract the Flutter SDK:
○ Extract the downloaded .zip file and place the contained flutter directory in a
desired installation location (e.g., C:\src\flutter).
Step 2: Update Your Path
1. Locate Your System Path:
○ Open the Start Search, type in env, and select Edit the system environment
variables.
○ In the System Properties window, click on the Environment Variables button.
2. Update Path:
○ In the User variables section, find the Path variable and click Edit.
○ Click New and add the full path to the flutter\bin directory (e.g.,
C:\src\flutter\bin).
○ Click OK to close all windows.
3. Verify Flutter is Added:
○ Open a new Command Prompt or PowerShell window and run flutter doctor.
Step 3: Run flutter doctor
1. Open Command Prompt or PowerShell:
○ Type cmd or powershell in the Start menu and open it.
2. Run flutter doctor:
○ In the terminal, type flutter doctor and press Enter.
○ This command checks your environment and displays a report of the status of
your Flutter installation.
Step 4: Install Android Studio
1. Download Android Studio:
○ Visit the Android Studio download page and download the installer.
2. Install Android Studio:
○ Run the installer and follow the setup wizard to complete the installation.
○ During installation, make sure the boxes for the following are checked:
■ Android SDK
■ Android SDK Platform
■ Android Virtual Device
3. Setup Android Studio:
○ Open Android Studio.
○ Complete the Android Studio Setup Wizard, which includes downloading the
Android SDK components.
Step 5: Set Up the Android Emulator
1. Open Android Studio:
○ Go to Tools > AVD Manager.
2. Create a Virtual Device:
○ Click on Create Virtual Device, select a hardware profile, and click Next.
○ Select a system image (e.g., x86 Images tab), download if necessary, and click
Next.
○ Click Finish to create the AVD.
Step 6: Set Up the IDE (Visual Studio Code)
1. Download VS Code:
○ Visit the Visual Studio Code download page and download the installer.
2. Install VS Code:
○ Run the installer and follow the setup wizard to complete the installation.
3. Install Flutter and Dart Plugins:
○ Open VS Code.
○ Go to Extensions (Ctrl+Shift+X).
○ Search for and install the Flutter and Dart extensions.
Step 7: Set Up the Flutter Device
1. Enable Developer Mode on Your Device:
○ Go to Settings > About phone and tap the Build number 7 times to unlock
developer options.
○ Go to Settings > System > Developer options and enable USB debugging.
2. Connect Your Device:
○ Connect your Android device to your computer via USB.
○ Run flutter devices in the terminal to verify that Flutter recognizes your connected
device.
Step 8: Create and Run a New Flutter Project
1. Create a New Flutter Project:
○ In VS Code, open the command palette (Ctrl+Shift+P).
○ Type Flutter: New Project, then press Enter.
○ Select a project name and location to save the project.
2. Run the Flutter Project:
○ Open the main.dart file in your new project.
○ Press F5 to start debugging and run your app.
That's it! You now have Flutter installed and set up on your Windows machine. You can start
building Flutter applications. If you encounter any issues, the flutter doctor command can
provide helpful diagnostics.
1 b) Write a simple Dart program to understand the language basics.
import 'package:flutter/material.dart';
void main() {
runApp(Abc());
}
class Abc extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Def(),
);
}
}
class Def extends StatelessWidget {
const Def({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Welcome"),
backgroundColor: Colors.purple,
),
body: Column(
children: [
//Widgets
],
),);}}
Viva Questions
1. What is Dart?
2. What is a Future in Dart?
3. What does the async keyword do in Dart?
4. How do you declare a list in Dart?
5. What is null safety in Dart?
6. What are the key features of the Dart programming language?
7. Explain the difference between var, final, and const in Dart.
8. How does Dart handle asynchronous programming?
9. What are the different types of collections in Dart?
10. What are the data types available in Dart?
11. How do you define a class in Dart?
12. What is the difference between final and const in Dart?
13. What is a constructor in Dart?
14. How do you handle exceptions in Dart?
15. What is Flutter and what are its main components?
16. What is a widget in Flutter?
17. Explain the difference between StatelessWidget and StatefulWidget.
18. How does the Flutter rendering process work?
19. What is the build method in Flutter?
20. How do you navigate between screens in Flutter?
21. What is a Container widget in Flutter?
22. What is setState in Flutter?
23. What is a Stream in Flutter?
24. How do you add external packages to a Flutter project?
25. What is hot reload in Flutter?
26. How do you handle user input in Flutter?
27. What is the MaterialApp widget?
28. What is a Scaffold widget?
29. What is the purpose of the pubspec.yaml file in a Flutter project?
30. What is MediaQuery used for in Flutter, and how can you use it to make a widget
responsive?