2 6007
2 6007
Objectives: We will build a simple mobile app using Flutter that displays a number on
the screen. Each time you press a button, the number increases by one. This is known as a
counter app and is a great first project for beginners. It helps you understand how Flutter
widgets work and how user interaction updates the interface. You'll also get hands-on
experience with the Dart programming language. By building this app, you’ll learn how
state management works in Flutter and how to structure a basic app. This project is
simple yet powerful for building a strong foundation.
Procedure:
● Set up Flutter:
First, install Flutter on your computer. Also, install an app to write your code, like
Android Studio or VS Code.
● Create a new app:
Open your terminal or command prompt and type:
flutter create counter_app
This will create a new Flutter project with all the files you need.
● Change the code:
Go to the main.dart file and change the code. Add these things:
A MaterialApp with your own app name and colors.
A StatefulWidget to keep and update the number.
A FloatingActionButton that adds 1 to the number when you press it.
● Make it look nice:
Change the background color and the top bar (AppBar) color.
Use Container widgets to show the number in a nice way.
● Run your app:
Try running your app on your phone or in an emulator. Press the button and see the number
go up.
Conclusion: The experiment shows how to make a simple mobile app with Flutter that interact
with it. It helps us to understand basic ideas like designing the app’s look, organizing parts of
the app, and managing the information using Dart and Flutter.