Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from langx:bug-about-me-card-beyond
Browse files Browse the repository at this point in the history
fix about me card beyond height limit
  • Loading branch information
xuelink authored Jun 25, 2024
2 parents 7080b42 + 7166130 commit 76a6825
Showing 1 changed file with 132 additions and 130 deletions.
262 changes: 132 additions & 130 deletions lib/components/profile_about_me_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,143 +36,145 @@ class ProfileAboutMeCard extends StatelessWidget {
Color verifiedColor =
(verifiedemail) ? const Color(0xFF2DD55B) : Colors.red;

return SizedBox(
height: 550,
width: MediaQuery.of(context).size.width,
child: Card(
elevation: 5.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.0),
),
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.start,
return LayoutBuilder(
builder: (context, constraints) {
double cardHeight =
constraints.maxHeight > 550 ? 550 : constraints.maxHeight;
return SizedBox(
height: cardHeight,
width: MediaQuery.of(context).size.width,
child: Card(
elevation: 5.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.0),
),
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
const Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(
'About Me',
style: TextStyle(fontSize: 25),
),
),
],
),
const SizedBox(height: 3),
const Align(
alignment: Alignment.centerLeft,
child: Text(
'About Me',
style: TextStyle(fontSize: 25),
'Personal Information',
style: TextStyle(
fontSize: 15,
color: Color(0xFF737373),
),
),
),
],
),
const SizedBox(height: 3),
const Align(
alignment: Alignment.centerLeft,
child: Text(
'Personal Information',
style: TextStyle(
fontSize: 15,
color: Color(0xFF737373),
Expanded(
child: ListView(
children: [
ListTile(
leading: const InfoSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
aboutMeText,
style: const TextStyle(
fontSize: 15,
color: Color(0xFF737373),
),
),
),
ListTile(
leading: const CountrySvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
country,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const GenderSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
gender,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const CalendarSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
"$age years old",
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const ClockSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
"Registered $registeredNum months ago",
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const AtSignSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
userID,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: ShieldSvg(
color: verifiedColor,
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
verifiedText,
style: const TextStyle(fontSize: 15),
),
),
],
),
),
),
),
ListTile(
leading: const InfoSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
aboutMeText,
style:
const TextStyle(fontSize: 15, color: Color(0xFF737373)),
),
),
ListTile(
leading: const CountrySvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
country,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const GenderSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
gender,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const GenderSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
gender,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const CalendarSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
"$age years old",
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const ClockSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
" Registered $registeredNum months ago ",
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: const AtSignSvg(
color: Color(0xFFFBC02D),
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
userID,
style: const TextStyle(fontSize: 15),
),
),
ListTile(
leading: ShieldSvg(
color: verifiedColor,
fill: 'none',
widht: 20,
height: 20,
),
title: Text(
verifiedText,
style: const TextStyle(fontSize: 15),
),
],
),
],
),
),
),
),
);
},
);
}
}

0 comments on commit 76a6825

Please sign in to comment.