This project is a beginner-friendly Flutter application demonstrating how to build a fully responsive UI that adapts to both mobile and desktop screens. It showcases practical usage of standard Flutter layout widgets including Row, Column, Expanded, Flexible, and LayoutBuilder.
If you have the Flutter SDK installed on your machine, you can easily run this project using either Visual Studio Code (VS Code) or Android Studio.
- Open the Project: Launch VS Code and go to
File > Open Folder...to open this project folder. - Install Extensions: Ensure you have the official
FlutterandDartextensions installed from the Extensions Marketplace (Ctrl+Shift+X). - Get Dependencies: VS Code should automatically fetch dependencies when you open the project. If not, open the integrated terminal (`Ctrl+``) and run:
flutter pub get
- Select a Target Device: Look at the bottom-right corner of the VS Code window (in the status bar). Click on the device name (e.g., "Windows", "Chrome", or an emulator) to select where you want to preview the app.
- Launch the App:
- Open
lib/main.dartin the editor. - Press
F5to start debugging, or clickRun > Start Debuggingfrom the top application menu. - Alternatively, you can click the visual "Run" (Play) icon located at the top-right corner of the code editor.
- Open
- Open the Project: Launch Android Studio and click on
Open(orFile > Openif already inside a project). Select this project folder. - Install Flutter Plugin: Make sure you have the Flutter plugin installed via
Settings > Plugins. - Get Dependencies:
- Open the
pubspec.yamlfile in the project viewer. - Click on the "Pub get" prompt that appears in the action ribbon at the top of the editor pane.
- Open the
- Select a Target Device: In the main top toolbar, locate the device selection dropdown (next to the green "Play" button). Select a running Android Virtual Device (AVD), Chrome, or a connected physical phone.
- Tip: If the list is empty, open the "Device Manager" from the toolbar to create a new virtual device.
- Launch the App:
- Click the green Play (Run) triangle button in the top toolbar.
- Alternatively, press
Shift+F10on Windows to run the application.
Once you have the app running:
- On Desktop/Web Apps: Try horizontally resizing the app window. You'll notice the UI seamlessly transitions between a classic mobile list view (for narrower screens) and a robust sidebar dashboard view (for screens wider than 600px).
- On Mobile Emulators: The layout will default to the vertical stack, optimizing space on smaller screens!