You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
192 lines
6.2 KiB
192 lines
6.2 KiB
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:teso/util/SizeConfig.dart';
|
|
|
|
buildProfileHeader(
|
|
BuildContext context,
|
|
String gold,
|
|
String silver,
|
|
String username,
|
|
String bytes,
|
|
String friends,
|
|
String fullname,
|
|
double tall) {
|
|
return Container(
|
|
child: Column(
|
|
children: [
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
//color: Theme.of(context).accentColor,
|
|
//transform: Matrix4.translationValues(0.0, -40.0, 0.0),
|
|
height: SizeConfig.blockSizeHorizontal * 20,
|
|
width: SizeConfig.blockSizeHorizontal * 20,
|
|
decoration: new BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.grey[400],
|
|
),
|
|
child: bytes == null
|
|
? Center(
|
|
child: Text(
|
|
username.characters.characterAt(0).toString().toUpperCase(),
|
|
),
|
|
)
|
|
: bytes == "null"
|
|
? Center(
|
|
child: Text(
|
|
username.characters
|
|
.characterAt(0)
|
|
.toString()
|
|
.toUpperCase(),
|
|
style: TextStyle(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
)
|
|
: Container(
|
|
height: SizeConfig.blockSizeHorizontal * 18,
|
|
width: SizeConfig.blockSizeHorizontal * 18,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(90.0),
|
|
topRight: Radius.circular(90.0),
|
|
bottomLeft: Radius.circular(90),
|
|
bottomRight: Radius.circular(90),
|
|
),
|
|
child: CachedNetworkImage(
|
|
imageUrl: bytes,
|
|
imageBuilder: (context, imageProvider) => FadeInImage(
|
|
height: SizeConfig.blockSizeHorizontal * 18,
|
|
width: SizeConfig.blockSizeHorizontal * 18,
|
|
fit: BoxFit.fill,
|
|
image: imageProvider,
|
|
placeholder:
|
|
AssetImage("assets/images/tesoDP/dp1.png"),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
//transform: Matrix4.translationValues(0.0, -30.0, 0.0),
|
|
child: Center(
|
|
child: Text(
|
|
fullname,
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.8,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
// transform: Matrix4.translationValues(0.0, -25.0, 0.0),
|
|
child: Center(
|
|
child: Text(
|
|
"Friends : " + friends,
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.8,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
height: 18,
|
|
width: double.infinity,
|
|
// transform: Matrix4.translationValues(0.0, -25.0, 0.0),
|
|
margin:
|
|
EdgeInsets.only(left: MediaQuery.of(context).size.width / 3.5),
|
|
child: Center(
|
|
child: Row(
|
|
children: [
|
|
Image(
|
|
image: AssetImage("assets/images/gold1.png"),
|
|
),
|
|
Container(
|
|
child: Center(
|
|
child: Text(
|
|
"Gold Coins : ",
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.8,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 5),
|
|
child: Center(
|
|
child: Text(
|
|
gold,
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.8,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
height: 18,
|
|
width: double.infinity,
|
|
// transform: Matrix4.translationValues(0.0, -25.0, 0.0),
|
|
margin:
|
|
EdgeInsets.only(left: MediaQuery.of(context).size.width / 3.5),
|
|
child: Center(
|
|
child: Row(
|
|
children: [
|
|
Image(
|
|
image: AssetImage("assets/images/silver1.png"),
|
|
),
|
|
Container(
|
|
child: Center(
|
|
child: Text(
|
|
"Silver Coins : ",
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.8,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 5),
|
|
child: Center(
|
|
child: Text(
|
|
silver,
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.8,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|