Created
July 29, 2025 14:33
-
-
Save mukhtharcm/5061b1aa3e21d93849c33e2690932a65 to your computer and use it in GitHub Desktop.
Day 3 Mini-Project Solution: Static "User Profile" Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return const MaterialApp( | |
| // Removes the debug banner | |
| debugShowCheckedModeBanner: false, | |
| home: ProfilePage(), | |
| ); | |
| } | |
| } | |
| class ProfilePage extends StatelessWidget { | |
| const ProfilePage({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: const Text("Profile"), | |
| backgroundColor: Colors.blue, | |
| ), | |
| body: const Center( | |
| child: Column( | |
| // mainAxisAlignment centers the column's content vertically | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: <Widget>[ | |
| // A large icon to represent a profile picture | |
| Icon( | |
| Icons.account_circle, | |
| size: 100, | |
| color: Colors.grey, | |
| ), | |
| // A SizedBox provides a fixed-size box for spacing | |
| SizedBox(height: 20), | |
| // Text widget for the name | |
| Text( | |
| 'Ahmed Khan', | |
| style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), | |
| ), | |
| SizedBox(height: 8), | |
| // Text widget for the location | |
| Text( | |
| 'Dubai, UAE', | |
| style: TextStyle(fontSize: 16, color: Colors.black54), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment