Skip to content

Instantly share code, notes, and snippets.

@jeremejazz
Last active March 26, 2025 09:23
Show Gist options
  • Save jeremejazz/4c94e09741eb335fe83f1cae2bd1cce6 to your computer and use it in GitHub Desktop.
Save jeremejazz/4c94e09741eb335fe83f1cae2bd1cce6 to your computer and use it in GitHub Desktop.

Revisions

  1. jeremejazz revised this gist Mar 26, 2025. No changes.
  2. jeremejazz created this gist Mar 26, 2025.
    96 changes: 96 additions & 0 deletions profile_screen.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,96 @@
    import 'package:flutter/material.dart';

    class ProfileScreen extends StatelessWidget {
    const ProfileScreen({super.key});
    @override
    Widget build(BuildContext context) {
    return Scaffold(
    body: Stack(
    children: [
    Image.asset('assets/images/beach.jpg'),
    Transform.translate(
    offset: const Offset(0, 100),
    child: Column(
    children: [
    const ProfileImage(),
    ProfileDetails(),
    ProfileActions(),
    ],
    ),
    ),
    ],
    ),
    );
    }
    }

    class ProfileImage extends StatelessWidget {
    const ProfileImage({super.key});

    @override
    Widget build(BuildContext context) {
    return ClipOval(
    child: Image.asset(
    width: 200,
    height: 200,
    'assets/images/dog.jpg',
    fit: BoxFit.fitWidth,
    ),
    );
    }
    }

    class ProfileDetails extends StatelessWidget {
    const ProfileDetails({super.key});

    @override
    Widget build(BuildContext context) {
    return Padding(
    padding: const EdgeInsets.all(20.0),
    child: Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
    Text(
    'Wolfram Barkovich',
    style: TextStyle(fontWeight: FontWeight.w600, fontSize: 35),
    ),
    _buildDetailsRow('Age', '4'),
    _buildDetailsRow('Status', 'Good Boy'),
    ],
    ),
    );
    }

    Widget _buildDetailsRow(String heading, String value) {
    return Row(
    children: [
    Text('$heading: ', style: const TextStyle(fontWeight: FontWeight.bold)),
    Text(value),
    ],
    );
    }
    }

    class ProfileActions extends StatelessWidget {
    const ProfileActions({super.key});

    @override
    Widget build(BuildContext context) {
    return Row(
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
    _buildIcon(Icons.restaurant, 'Feed'),
    _buildIcon(Icons.favorite, 'Pet'),
    _buildIcon(Icons.directions_walk, 'Walk'),
    ],
    );
    }

    Widget _buildIcon(IconData icon, String text) {
    return Padding(
    padding: EdgeInsets.all(20.0),

    child: Column(children: [Icon(icon, size: 40), Text(text)]),
    );
    }
    }