Skip to content

Instantly share code, notes, and snippets.

@wackyapps
Created December 23, 2025 23:15
Show Gist options
  • Select an option

  • Save wackyapps/cb65a67f31e368fb9601ad75758b3472 to your computer and use it in GitHub Desktop.

Select an option

Save wackyapps/cb65a67f31e368fb9601ad75758b3472 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(const PetProfileApp());
}
class PetProfileApp extends StatelessWidget {
const PetProfileApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Create Pet Profile',
theme: ThemeData(
useMaterial3: true,
fontFamily: 'Roboto',
),
home: const CreatePetProfileScreen(),
);
}
}
class CreatePetProfileScreen extends StatelessWidget {
const CreatePetProfileScreen({super.key});
static const Color backgroundColor = Color(0xFFFBE6C8);
static const Color cardColor = Color(0xFFFFF6EA);
static const Color primaryGreen = Color(0xFF3E7F6B);
static const Color hintColor = Color(0xFF9E9E9E);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: backgroundColor,
body: SafeArea(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 12),
/// Back Button
const CircleAvatar(
backgroundColor: Colors.white,
child: Icon(Icons.arrow_back, color: Colors.black),
),
const SizedBox(height: 24),
/// Header
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text(
'Create Pet Profile',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'Tell us a little about your fur baby\nso we can tailor their care.',
style: TextStyle(fontSize: 14),
),
],
),
),
const Icon(
Icons.pets,
size: 64,
color: Colors.orange,
),
],
),
const SizedBox(height: 24),
/// Upload Photo
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: cardColor,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Stack(
alignment: Alignment.bottomRight,
children: [
const CircleAvatar(
radius: 36,
backgroundColor: Color(0xFFFFB566),
child: Icon(Icons.pets, size: 36),
),
Container(
padding: const EdgeInsets.all(6),
decoration: const BoxDecoration(
color: primaryGreen,
shape: BoxShape.circle,
),
child: const Icon(
Icons.camera_alt,
size: 16,
color: Colors.white,
),
),
],
),
const SizedBox(height: 12),
const Text(
'Upload Your Photo',
style: TextStyle(
color: primaryGreen,
fontWeight: FontWeight.w600,
),
),
],
),
),
const SizedBox(height: 20),
_label('Name'),
_textField(hint: 'Charlie'),
_label('Species'),
_dropdown(
value: 'Cat',
items: const ['Cat', 'Dog'],
),
_label('Breed'),
_textField(hint: 'Domestic Shorthair'),
_label('Birthday'),
_textField(
hint: 'MM/YYYY/DD',
suffix: Icons.calendar_today,
),
_label('Gender'),
Row(
children: [
Expanded(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 14),
decoration: BoxDecoration(
color: primaryGreen,
borderRadius: BorderRadius.circular(24),
),
alignment: Alignment.center,
child: const Text(
'Female',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(width: 12),
Expanded(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 14),
decoration: BoxDecoration(
color: cardColor,
borderRadius: BorderRadius.circular(24),
),
alignment: Alignment.center,
child: const Text(
'Male',
style: TextStyle(fontWeight: FontWeight.w500),
),
),
),
],
),
const SizedBox(height: 20),
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_label('Weight'),
_dropdown(
value: 'Ex. 25 lbs',
items: const ['Ex. 25 lbs', '10 lbs', '20 lbs'],
),
],
),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_label('Color'),
_dropdown(
value: 'Ex. Black',
items: const ['Ex. Black', 'White', 'Brown'],
),
],
),
),
],
),
const SizedBox(height: 100),
],
),
),
),
/// Bottom Button
Padding(
padding: const EdgeInsets.all(20),
child: SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: primaryGreen,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28),
),
),
onPressed: () {},
child: const Text(
'Continue',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
),
],
),
),
);
}
/// Helpers
Widget _label(String text) {
return Padding(
padding: const EdgeInsets.only(bottom: 6, top: 16),
child: Text(
text,
style: const TextStyle(fontWeight: FontWeight.w600),
),
);
}
Widget _textField({required String hint, IconData? suffix}) {
return TextFormField(
decoration: InputDecoration(
hintText: hint,
suffixIcon: suffix != null ? Icon(suffix) : null,
filled: true,
fillColor: cardColor,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: BorderSide.none,
),
hintStyle: const TextStyle(color: hintColor),
),
);
}
Widget _dropdown({
required String value,
required List<String> items,
}) {
return DropdownButtonFormField<String>(
value: value,
items: items
.map(
(e) => DropdownMenuItem(
value: e,
child: Text(e),
),
)
.toList(),
onChanged: (_) {},
decoration: InputDecoration(
filled: true,
fillColor: cardColor,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: BorderSide.none,
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment