EXPERIMENT-1
1. a) Install Flutter and Dart SDK.
Dart SDK Installation:
Step 1: Download Dart
SDK. Download Dart
SDK
from
the
Dart
SDK
archive page.
The
URL
is: https://dart.dev/tools/sdk/archive
Click on DART SDK to download
SDK for Windows 64-Bit
Architecture. The download will start and a zip file will be
downloaded.
Step 3: Running Dart. Now open bin folder and type “cmd” as given below:
Flutter SDK
Installation:
STEP 1:Open Flutter Docs website and select
web platform
https://docs.flutter.dev/get-started/install/windows
STEP 2: Download and install the Windows
version of the following packages:
·
Git
for Windows to manage Flutter versions and your own source code
versioning.
·
Google Chrome to
debug JavaScript code for web apps.
STEP 3:
Configure a text editor or IDE
You can build apps with Flutter using any text
editor or integrated development environment (IDE) combined with Flutter's
command-line tools.
Using an IDE with a Flutter extension or plugin
provides code completion, syntax highlighting, widget editing assists,
debugging, and other features.
STEP 4:
Use VS Code to install Flutter
1. To open the Command Palette, press Control
+ Shift + P.
2. In the Command Palette, type flutter.
3. Select Flutter: New Project.
4. VS Code prompts you to locate the Flutter
SDK on your computer.
5. If you have the Flutter SDK installed,
click Locate SDK.
6. If you don't have the Flutter SDK
installed, click Download SDK.
Download the Flutter
SDK
When the Select Folder for Flutter SDK dialog displays,
choose where you want to install Flutter.
1. VS Code places you in your user profile to
start. Choose a different location.
2. Consider %USERPROFILE% or C:\dev.
3. Click Clone Flutter.
When the Flutter installation succeeds, VS Code displays this
pop-up notification:
Do you want to add the Flutter SDK to PATH so it's accessible
in external terminals?
content_copy
Click Add SDK to PATH.
When successful, a notification displays:
The Flutter SDK was added to your PATH
Restart VS Code.
1.b) Write a simple Dart program to understand the language basics.
1) void main() {
print('WELCOME TO SRKR ENGINEERING COLLEGE!');
}
OUTPUT:
WELCOME TO SRKR ENGINEERING COLLEGE!
2) void main() {
int a = 25;
int b = 35;
int sum = a + b;
print('Sum: $sum');
}
OUTPUT:
Sum: 60
3) void main() {
int number = 29;
if (number % 2 == 0) {
print('$number is even.');
} else {
print('$number is odd.');
}
}
OUTPUT:
29 is odd.
4) void main() {
for (int i = 1; i <= 10; i++) {
print(i);
}
}
OUTPUT:
1
2
3
4
5
6
7
8
9
10
Comments
Post a Comment