Skip to content

Commit

Permalink
profile nine
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Apr 25, 2020
1 parent 0331a6a commit 307dc2d
Show file tree
Hide file tree
Showing 2 changed files with 252 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/core/presentation/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'package:flutter_ui_challenges/src/pages/misc/musicplayer.dart';
import 'package:flutter_ui_challenges/src/pages/misc/musicplayer2.dart';
import 'package:flutter_ui_challenges/src/pages/onboarding/intro6.dart';
import 'package:flutter_ui_challenges/src/pages/profile/profile8.dart';
import 'package:flutter_ui_challenges/src/pages/profile/profile9.dart';
import 'package:flutter_ui_challenges/src/pages/settings/settings1.dart';
import 'package:flutter_ui_challenges/src/pages/settings/settings2.dart';
import 'package:flutter_ui_challenges/src/pages/settings/settings3.dart';
Expand Down Expand Up @@ -120,6 +121,7 @@ final List<dynamic> pages = [
path: AnimatedListOnePage.path),
]),
MenuItem(title: "Profile", icon: Icons.person, items: [
SubMenuItem("Profile Nine", ProfileNinePage(), path: ProfileNinePage.path),
SubMenuItem("Profile One", ProfileOnePage(), path: ProfileOnePage.path),
SubMenuItem("Profile Two", ProfileTwoPage(), path: ProfileTwoPage.path),
SubMenuItem("Profile Three", ProfileThreePage(),
Expand Down
250 changes: 250 additions & 0 deletions lib/src/pages/profile/profile9.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
import 'package:cached_network_image/cached_network_image.dart';
/**
* Author: Damodar Lohani
* profile: https://github.com/lohanidamodar
*/

import 'package:flutter/material.dart';
import 'package:flutter_custom_clippers/flutter_custom_clippers.dart';
import 'package:flutter_ui_challenges/core/presentation/res/assets.dart';

class ProfileNinePage extends StatelessWidget {
static final String path = "lib/src/pages/profile/profile9.dart";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Profile"),
centerTitle: true,
backgroundColor: Colors.transparent,
elevation: 0,
),
extendBody: true,
extendBodyBehindAppBar: true,
body: Stack(
children: [
ClipPath(
clipper: OvalBottomBorderClipper(),
child: Container(
margin: const EdgeInsets.only(top: 30),
height: 380,
decoration: BoxDecoration(
color: Colors.pink,
),
),
),
ClipPath(
clipper: OvalBottomBorderClipper(),
child: Container(
height: 380,
decoration: BoxDecoration(
image: DecorationImage(
image: CachedNetworkImageProvider(pancake),
fit: BoxFit.cover),
),
foregroundDecoration:
BoxDecoration(color: Colors.pink.withOpacity(0.8)),
),
),
ListView(
padding: const EdgeInsets.all(8.0),
children: [
const SizedBox(height: 90),
_buildAvatar(avatars[4]),
const SizedBox(height: 10.0),
Text(
"Damodar Lohani",
style: Theme.of(context)
.textTheme
.headline6
.copyWith(color: Colors.white),
textAlign: TextAlign.center,
),
const SizedBox(height: 5.0),
Text(
"Flutter & Full Stack Developer",
style: TextStyle(
color: Colors.white70,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 10.0),
Card(
color: Colors.white,
elevation: 0,
margin: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 32.0,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
child: Column(
children: [
Text(
"255K",
style: Theme.of(context).textTheme.headline4,
),
const SizedBox(height: 10.0),
Text(
"Followers",
style: Theme.of(context).textTheme.subtitle1,
),
],
),
),
Expanded(
child: Column(
children: [
Text(
"105K",
style: Theme.of(context).textTheme.headline4,
),
const SizedBox(height: 10.0),
Text(
"Following",
style: Theme.of(context).textTheme.subtitle1,
),
],
),
),
],
),
),
),
const SizedBox(height: 20.0),
Text(
"Favorite",
style: Theme.of(context).textTheme.headline5,
),
const SizedBox(height: 10.0),
SizedBox(
height: 150,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
_buildFavoriteCard(context, "Design"),
const SizedBox(width: 10.0),
_buildFavoriteCard(context, "Fruits"),
const SizedBox(width: 10.0),
_buildFavoriteCard(context, "Nature"),
const SizedBox(width: 10.0),
],
),
),
const SizedBox(height: 20.0),
Text(
"Friends",
style: Theme.of(context).textTheme.headline5,
),
Container(
height: 60,
width: double.infinity,
child: Stack(
children: [
...avatars
.asMap()
.map(
(i, e) => MapEntry(
i,
Transform.translate(
offset: Offset(i * 30.0, 0),
child: SizedBox(height: 60,width: 60,child: _buildAvatar(e, radius: 30)),
),
),
)
.values
.toList(),
],
),
)
],
)
],
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
backgroundColor: Colors.red,
onPressed: () {},
),
);
}

CircleAvatar _buildAvatar(String image, {double radius = 80}) {
return CircleAvatar(
backgroundColor: Colors.white,
radius: radius,
child: CircleAvatar(
radius: radius - 2,
backgroundImage: CachedNetworkImageProvider(image),
),
);
}

Widget _buildFavoriteCard(BuildContext context, String title) {
return Container(
width: 150,
height: 150,
child: Stack(
children: [
Container(
decoration: BoxDecoration(
color: Colors.blueAccent,
borderRadius: BorderRadius.circular(10.0),
),
height: double.infinity,
width: double.infinity,
margin: const EdgeInsets.symmetric(
horizontal: 8.0,
),
),
Container(
decoration: BoxDecoration(
color: Colors.indigo,
borderRadius: BorderRadius.circular(10.0),
),
height: double.infinity,
width: double.infinity,
margin: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 4.0,
),
),
Container(
clipBehavior: Clip.antiAlias,
alignment: Alignment.center,
height: double.infinity,
width: double.infinity,
margin: const EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: CachedNetworkImageProvider(images[0]),
fit: BoxFit.cover),
borderRadius: BorderRadius.circular(10.0)),
foregroundDecoration: BoxDecoration(
color: Colors.blue.withOpacity(0.3),
borderRadius: BorderRadius.circular(10.0)),
),
Container(
alignment: Alignment.center,
height: double.infinity,
width: double.infinity,
margin: const EdgeInsets.only(bottom: 20),
child: Text(
title,
style: Theme.of(context)
.textTheme
.headline6
.copyWith(color: Colors.white),
),
),
],
),
);
}
}

0 comments on commit 307dc2d

Please sign in to comment.