Last active
March 1, 2025 14:07
-
-
Save rubywai/431029b022b69fb61f29054dcf642cb5 to your computer and use it in GitHub Desktop.
This file contains 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 MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Profile Dashboard', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
brightness: Brightness.light, | |
scaffoldBackgroundColor: const Color(0xFFF8F9FA), | |
), | |
home: const ProfileDashboard(), | |
); | |
} | |
} | |
class ProfileDashboard extends StatelessWidget { | |
const ProfileDashboard({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
elevation: 0, | |
backgroundColor: Colors.transparent, | |
foregroundColor: Colors.black87, | |
title: const Text('Profile Dashboard'), | |
actions: [ | |
IconButton( | |
icon: const Icon(Icons.notifications_outlined), | |
onPressed: () {}, | |
), | |
IconButton( | |
icon: const Icon(Icons.settings_outlined), | |
onPressed: () {}, | |
), | |
], | |
), | |
body: SingleChildScrollView( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
// Profile Header Section | |
Container( | |
padding: const EdgeInsets.all(16.0), | |
child: Row( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: [ | |
// Square Profile Picture | |
Container( | |
width: 100, | |
height: 100, | |
decoration: BoxDecoration( | |
color: Colors.grey.shade300, | |
borderRadius: BorderRadius.circular(8), | |
boxShadow: [ | |
BoxShadow( | |
color: Colors.black.withValues(alpha: 0.1), | |
blurRadius: 8, | |
offset: const Offset(0, 3), | |
), | |
], | |
), | |
child: ClipRRect( | |
borderRadius: BorderRadius.circular(8), | |
child: Image.network( | |
'https://via.placeholder.com/100', | |
fit: BoxFit.cover, | |
errorBuilder: (context, error, stackTrace) { | |
return const Icon( | |
Icons.person, | |
size: 50, | |
color: Colors.grey, | |
); | |
}, | |
), | |
), | |
), | |
const SizedBox(width: 16), | |
// Profile Info | |
Expanded( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
const Text( | |
'Alex Johnson', | |
style: TextStyle( | |
fontSize: 24, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 4), | |
const Text( | |
'Senior UI/UX Designer', | |
style: TextStyle( | |
fontSize: 16, | |
color: Colors.grey, | |
), | |
), | |
const SizedBox(height: 8), | |
Row( | |
children: [ | |
Container( | |
padding: const EdgeInsets.symmetric( | |
horizontal: 12, | |
vertical: 6, | |
), | |
decoration: BoxDecoration( | |
color: Colors.blue.withValues(alpha: 0.1), | |
borderRadius: BorderRadius.circular(20), | |
), | |
child: const Row( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Icon( | |
Icons.location_on_outlined, | |
size: 16, | |
color: Colors.blue, | |
), | |
SizedBox(width: 4), | |
Text( | |
'San Francisco', | |
style: TextStyle( | |
color: Colors.blue, | |
), | |
), | |
], | |
), | |
), | |
const SizedBox(width: 8), | |
Container( | |
padding: const EdgeInsets.symmetric( | |
horizontal: 12, | |
vertical: 6, | |
), | |
decoration: BoxDecoration( | |
color: Colors.green.withValues(alpha: 0.1), | |
borderRadius: BorderRadius.circular(20), | |
), | |
child: const Row( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Icon( | |
Icons.verified_outlined, | |
size: 16, | |
color: Colors.green, | |
), | |
SizedBox(width: 4), | |
Text( | |
'Verified', | |
style: TextStyle( | |
color: Colors.green, | |
), | |
), | |
], | |
), | |
), | |
], | |
), | |
], | |
), | |
), | |
], | |
), | |
), | |
// Stats Section | |
Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Row( | |
children: [ | |
_buildStatItem('Projects', '38', Colors.blue), | |
_buildStatItem('Followers', '1,248', Colors.purple), | |
_buildStatItem('Following', '486', Colors.orange), | |
], | |
), | |
), | |
// Bio Section | |
const Padding( | |
padding: EdgeInsets.symmetric(horizontal: 16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Text( | |
'About Me', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
SizedBox(height: 8), | |
Text( | |
'Passionate UI/UX designer with 7+ years of experience creating user-centered designs for web and mobile applications. Specializing in clean, intuitive interfaces that enhance user experience.', | |
style: TextStyle( | |
color: Colors.black87, | |
height: 1.5, | |
), | |
), | |
], | |
), | |
), | |
// Recent Activity Section | |
Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
const Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Text( | |
'Recent Activity', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
Text( | |
'View All', | |
style: TextStyle( | |
color: Colors.blue, | |
fontWeight: FontWeight.w500, | |
), | |
), | |
], | |
), | |
const SizedBox(height: 16), | |
_buildActivityItem( | |
icon: Icons.article_outlined, | |
title: 'Published a new article', | |
description: 'The Future of UI Design in 2025', | |
time: '2 hours ago', | |
color: Colors.blue, | |
), | |
_buildActivityItem( | |
icon: Icons.library_add_check_outlined, | |
title: 'Completed a project', | |
description: 'E-commerce Mobile App Redesign', | |
time: '1 day ago', | |
color: Colors.green, | |
), | |
_buildActivityItem( | |
icon: Icons.people_outlined, | |
title: 'Joined a new team', | |
description: 'Product Design Team at TechCorp', | |
time: '3 days ago', | |
color: Colors.purple, | |
), | |
], | |
), | |
), | |
// Skills Section | |
Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
const Text( | |
'Skills', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 16), | |
Wrap( | |
spacing: 8, | |
runSpacing: 8, | |
children: [ | |
_buildSkillChip('UI Design'), | |
_buildSkillChip('UX Research'), | |
_buildSkillChip('Wireframing'), | |
_buildSkillChip('Prototyping'), | |
_buildSkillChip('Figma'), | |
_buildSkillChip('Adobe XD'), | |
_buildSkillChip('Sketch'), | |
_buildSkillChip('User Testing'), | |
], | |
), | |
], | |
), | |
), | |
const SizedBox(height: 24), | |
], | |
), | |
), | |
); | |
} | |
Widget _buildStatItem(String title, String value, Color color) { | |
return Expanded( | |
child: Container( | |
margin: const EdgeInsets.symmetric(horizontal: 4), | |
padding: const EdgeInsets.symmetric(vertical: 16), | |
decoration: BoxDecoration( | |
color: Colors.white, | |
borderRadius: BorderRadius.circular(12), | |
boxShadow: [ | |
BoxShadow( | |
color: Colors.black.withValues(alpha: 0.05), | |
blurRadius: 10, | |
offset: const Offset(0, 4), | |
), | |
], | |
), | |
child: Column( | |
children: [ | |
Text( | |
value, | |
style: TextStyle( | |
fontSize: 20, | |
fontWeight: FontWeight.bold, | |
color: color, | |
), | |
), | |
const SizedBox(height: 4), | |
Text( | |
title, | |
style: TextStyle( | |
fontSize: 14, | |
color: Colors.grey.shade600, | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
Widget _buildActivityItem({ | |
required IconData icon, | |
required String title, | |
required String description, | |
required String time, | |
required Color color, | |
}) { | |
return Container( | |
margin: const EdgeInsets.only(bottom: 16), | |
padding: const EdgeInsets.all(16), | |
decoration: BoxDecoration( | |
color: Colors.white, | |
borderRadius: BorderRadius.circular(12), | |
boxShadow: [ | |
BoxShadow( | |
color: Colors.black.withValues(alpha: 0.05), | |
blurRadius: 10, | |
offset: const Offset(0, 4), | |
), | |
], | |
), | |
child: Row( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Container( | |
padding: const EdgeInsets.all(12), | |
decoration: BoxDecoration( | |
color: color.withValues(alpha: 0.1), | |
borderRadius: BorderRadius.circular(12), | |
), | |
child: Icon( | |
icon, | |
color: color, | |
size: 24, | |
), | |
), | |
const SizedBox(width: 16), | |
Expanded( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Text( | |
title, | |
style: const TextStyle( | |
fontSize: 16, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 4), | |
Text( | |
description, | |
style: const TextStyle( | |
color: Colors.black87, | |
), | |
), | |
const SizedBox(height: 4), | |
Text( | |
time, | |
style: TextStyle( | |
fontSize: 12, | |
color: Colors.grey.shade600, | |
), | |
), | |
], | |
), | |
), | |
], | |
), | |
); | |
} | |
Widget _buildSkillChip(String label) { | |
return Container( | |
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), | |
decoration: BoxDecoration( | |
color: Colors.blue.withValues(alpha: 0.1), | |
borderRadius: BorderRadius.circular(20), | |
border: Border.all( | |
color: Colors.blue.withValues(alpha: 0.3), | |
width: 1, | |
), | |
), | |
child: Text( | |
label, | |
style: const TextStyle( | |
color: Colors.blue, | |
fontWeight: FontWeight.w500, | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment