A5, AEHS, Lahore, Pakistan
+92 306 77 57 681
Flutter has revolutionized mobile app development by enabling developers to create high-quality, natively compiled applications for mobile, web, and desktop from a single codebase. In this blog, we'll guide you through the initial steps of setting up Flutter and building your first cross-platform app.
Install Flutter SDK:
Install an Editor:
Set Up the Android Emulator:
Create a New Project:
flutter create my_first_app cd my_first_app Understanding the Project Structure:
lib/main.dart : The main entry point of your Flutter app.pubspec.yaml : The configuration file for your app’s dependencies.android and ios directories: Platform-specific code.Writing Your First Flutter Code:
Open lib/main.dart and replace the existing code with the following:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('My First Flutter App'),
),
body: Center(
child: Text('Hello, Flutter!'),
),
),
);
}
}
Running Your App:
flutter run in the terminal.Widgets:
Stateless vs Stateful Widgets:
Hot Reload: