Skip to content

Instantly share code, notes, and snippets.

@mukhtharcm
Created July 29, 2025 14:33
Show Gist options
  • Save mukhtharcm/5061b1aa3e21d93849c33e2690932a65 to your computer and use it in GitHub Desktop.
Save mukhtharcm/5061b1aa3e21d93849c33e2690932a65 to your computer and use it in GitHub Desktop.
Day 3 Mini-Project Solution: Static "User Profile" Page
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