Created
February 9, 2025 11:09
-
-
Save prakhart111/bcbbea9c29babfedc002f9fd84d5e978 to your computer and use it in GitHub Desktop.
Snippet created via Next.js API
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
// Dualite Generated Code | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Portfolio', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
fontFamily: 'Roboto', | |
), | |
home: const MyHomePage(), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
const MyHomePage({Key? key}) : super(key: key); | |
@override | |
State<MyHomePage> createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
final ScrollController _scrollController = ScrollController(); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: LayoutBuilder( | |
builder: (context, constraints) { | |
return SingleChildScrollView( | |
controller: _scrollController, | |
child: Column( | |
children: [ | |
// Header Section | |
Container( | |
height: constraints.maxHeight * 0.8, | |
width: double.infinity, | |
decoration: const BoxDecoration( | |
gradient: LinearGradient( | |
begin: Alignment.topLeft, | |
end: Alignment.bottomRight, | |
colors: [Colors.blue, Colors.purple], | |
), | |
), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
const CircleAvatar( | |
radius: 80, | |
backgroundImage: NetworkImage('https://placehold.co/160x160'), | |
), | |
const SizedBox(height: 20), | |
const Text( | |
'John Doe', | |
style: TextStyle( | |
fontSize: 40, | |
fontWeight: FontWeight.bold, | |
color: Colors.white, | |
), | |
), | |
const SizedBox(height: 10), | |
const Text( | |
'Software Developer', | |
style: TextStyle( | |
fontSize: 24, | |
color: Colors.white70, | |
), | |
), | |
], | |
), | |
), | |
// About Section | |
Padding( | |
padding: const EdgeInsets.all(32.0), | |
child: Column( | |
children: [ | |
const Text( | |
'About Me', | |
style: TextStyle( | |
fontSize: 32, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 20), | |
Text( | |
'I am a passionate software developer with expertise in mobile and web development. ' | |
'I love creating beautiful and functional applications that solve real-world problems.', | |
style: TextStyle( | |
fontSize: 18, | |
color: Colors.grey[700], | |
), | |
textAlign: TextAlign.center, | |
), | |
], | |
), | |
), | |
// Skills Section | |
Container( | |
padding: const EdgeInsets.all(32.0), | |
color: Colors.grey[100], | |
child: Column( | |
children: [ | |
const Text( | |
'Skills', | |
style: TextStyle( | |
fontSize: 32, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 20), | |
Wrap( | |
spacing: 10, | |
runSpacing: 10, | |
alignment: WrapAlignment.center, | |
children: [ | |
_buildSkillChip('Flutter'), | |
_buildSkillChip('Dart'), | |
_buildSkillChip('React'), | |
_buildSkillChip('JavaScript'), | |
_buildSkillChip('Python'), | |
_buildSkillChip('Git'), | |
], | |
), | |
], | |
), | |
), | |
// Projects Section | |
Padding( | |
padding: const EdgeInsets.all(32.0), | |
child: Column( | |
children: [ | |
const Text( | |
'Projects', | |
style: TextStyle( | |
fontSize: 32, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 20), | |
Wrap( | |
spacing: 20, | |
runSpacing: 20, | |
children: [ | |
_buildProjectCard( | |
'Project 1', | |
'A brief description of project 1', | |
'https://placehold.co/300x200', | |
), | |
_buildProjectCard( | |
'Project 2', | |
'A brief description of project 2', | |
'https://placehold.co/300x200', | |
), | |
_buildProjectCard( | |
'Project 3', | |
'A brief description of project 3', | |
'https://placehold.co/300x200', | |
), | |
], | |
), | |
], | |
), | |
), | |
// Contact Section | |
Container( | |
padding: const EdgeInsets.all(32.0), | |
color: Colors.grey[900], | |
child: Column( | |
children: [ | |
const Text( | |
'Contact Me', | |
style: TextStyle( | |
fontSize: 32, | |
fontWeight: FontWeight.bold, | |
color: Colors.white, | |
), | |
), | |
const SizedBox(height: 20), | |
Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
IconButton( | |
icon: const Icon(Icons.email, color: Colors.white), | |
onPressed: () {}, | |
), | |
IconButton( | |
icon: const Icon(Icons.linkedin, color: Colors.white), | |
onPressed: () {}, | |
), | |
IconButton( | |
icon: const Icon(Icons.github, color: Colors.white), | |
onPressed: () {}, | |
), | |
], | |
), | |
], | |
), | |
), | |
], | |
), | |
); | |
}, | |
), | |
); | |
} | |
Widget _buildSkillChip(String label) { | |
return Chip( | |
label: Text( | |
label, | |
style: const TextStyle(color: Colors.white), | |
), | |
backgroundColor: Colors.blue, | |
); | |
} | |
Widget _buildProjectCard(String title, String description, String imageUrl) { | |
return Card( | |
elevation: 4, | |
child: Container( | |
width: 300, | |
padding: const EdgeInsets.all(16), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Image.network( | |
imageUrl, | |
height: 200, | |
width: double.infinity, | |
fit: BoxFit.cover, | |
), | |
const SizedBox(height: 16), | |
Text( | |
title, | |
style: const TextStyle( | |
fontSize: 20, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
Text( | |
description, | |
style: TextStyle( | |
color: Colors.grey[600], | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment