- Set up the Flutter development environment.
- Learn basic Flutter widgets needed to create login and register pages.
- Implement login and register pages.
- Learn about shared preferences and use them to store and fetch data.
Objective: Install and set up the Flutter development environment.
-
Install Flutter SDK:
- Visit the official Flutter installation page and follow the instructions for your operating system (Windows, macOS, or Linux).
- Ensure you have the following prerequisites installed:
- Git
- A code editor like VS Code or Android Studio
-
Set Up IDE:
- VS Code:
- Install Visual Studio Code.
- Install the Flutter and Dart extensions from the VS Code Marketplace.
- Android Studio:
- Download and install Android Studio.
- Install the Flutter plugin through the Plugin Manager.
- VS Code:
-
Configure an Android/iOS Emulator:
- Follow the Flutter device setup guide to set up an Android or iOS emulator.
-
Verify Installation:
- Open a terminal and run the following command to verify your Flutter installation:
flutter doctor
- Open a terminal and run the following command to verify your Flutter installation:
Objective: Understand and implement basic Flutter widgets needed for creating login and register pages.
-
Widgets to Learn:
Container
Row
andColumn
Text
TextField
ElevatedButton
Scaffold
-
Showing Snackbar
- The
ScaffoldMessenger
widget in Flutter provides an easy way to display snackbars, material banners, and other messages in your app. - Use ScaffoldMessenger.of(context).showSnackBar to display a snackbar.
- The
Objective: Understand and implement navigation and routing in Flutter.
-
Basic Routing:
- Use
Navigator.push
andNavigator.pop
for simple navigation.
- Use
-
Named Routes:
- Define named routes for better navigation management.
Objective: Learn to add images in the UI to make it more attractive .
-
Create an
assets
directory:- In the root directory of your Flutter project, create a new folder named
assets
.
- In the root directory of your Flutter project, create a new folder named
-
Add your asset files:
- Place your image files (or other assets) inside the
assets
directory. You can organize them further into subdirectories if needed (e.g.,assets/images/
).
- Place your image files (or other assets) inside the
-
Declare Assets in
pubspec.yaml
:- Open
pubspec.yaml
:
- In the root directory of your Flutter project, open the
pubspec.yaml
file.
- Declare your assets:
- Under the
flutter
section, declare your assets as follows:flutter: assets: - assets/images/ - assets/images/your_image.png
- Open
-
Loading Images from Assets:
- Use the
Image.asset
widget to load an image from your assets:
- Use the
-
Loading Images from the Network:
- Use the
Image.network
widget to load an image from a network URL
- Use the
Objective: Implement login and register pages using given figma file.
-
Login Page:
- Create a new screen for the login page.
- Use
TextField
for username and password inputs. - Add an
ElevatedButton
for the login action.
-
Register Page:
- Create a new screen for the register page.
- Use
TextField
for user details (username, email, password, etc.). - Add an
ElevatedButton
for the register action.
Objective: Learn how to use shared preferences to store and fetch data for login and registration purposes.
-
Install Shared Preferences Package:
- Add the
shared_preferences
package to yourpubspec.yaml
file:dependencies: shared_preferences: ^2.0.6
- Add the
-
Using Shared Preferences:
- Store user data upon registration.
- Fetch and validate user data during login.
Objective: Enhance the UI and add progress indicators for better user experience.
-
Improve UI:
- Use
Padding
andMargin
for better spacing. - Apply
BoxDecoration
toContainer
for rounded corners and shadows.
- Use
-
Progress Indicators:
- Use
CircularProgressIndicator
orLinearProgressIndicator
while waiting for data or during long-running operations.
- Use
Objective: Learn how to check and handle internet connectivity.
-
Install Connectivity Package:
- Add the
connectivity_plus
package to yourpubspec.yaml
file:dependencies: connectivity_plus: ^2.0.2
- Add the
-
Using Connectivity Package:
- Check the internet connection status and handle changes.
- Dialogs are important UI components in mobile applications for displaying critical information, alerts, prompts, or receiving user input. In Flutter, developers should learn about the following types of dialogs:
1. AlertDialog
2. SimpleDialog
3. Custom Dialogs