working on responsiveness.

This commit is contained in:
Faris Armoush
2025-05-04 16:50:28 +03:00
parent cd54574279
commit 464f7b7347
3 changed files with 41 additions and 45 deletions

View File

@ -27,7 +27,7 @@ class PowerClampEnergyDataWidget extends StatelessWidget {
),
),
const SizedBox(height: 6),
Text(
SelectableText(
const Uuid().v6(),
style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.blackColor,
@ -73,7 +73,7 @@ class PowerClampEnergyDataWidget extends StatelessWidget {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
SelectableText(
'Smart Power Clamp',
style: context.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w700,

View File

@ -17,15 +17,14 @@ class PowerClampEnergyStatusWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: secondarySection.copyWith(boxShadow: const []),
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
for (var index = 0; index < status.length; index++) ...[
Expanded(child: _buildItem(context, status[index])),
_buildDivider(context),
],
],
children: List.generate(
status.length * 2 - 1,
(index) => index.isEven
? Expanded(child: _buildItem(context, status[index ~/ 2]))
: _buildDivider(),
),
),
);
}
@ -39,7 +38,7 @@ class PowerClampEnergyStatusWidget extends StatelessWidget {
height: 18,
width: 18,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 14),
contentPadding: const EdgeInsets.symmetric(horizontal: 20),
title: Text(
item.title,
style: context.textTheme.bodySmall?.copyWith(
@ -71,25 +70,23 @@ class PowerClampEnergyStatusWidget extends StatelessWidget {
);
}
Widget _buildDivider(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: ColorsManager.greyColor.withValues(alpha: 0.5),
width: 1,
),
),
Widget _buildDivider() {
return Container(
height: 1,
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
color: ColorsManager.blackColor.withValues(alpha: 0.1),
offset: const Offset(0, -1),
color: Color.fromARGB(20, 0, 0, 0),
offset: Offset(0, 1),
blurRadius: 1,
),
BoxShadow(
color: Color.fromARGB(30, 0, 0, 0),
offset: Offset(0, -2),
blurRadius: 3,
spreadRadius: 1,
),
],
),
child: const SizedBox(height: 1),
);
}
}

View File

@ -13,7 +13,6 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
return Container(
width: double.infinity,
decoration: secondarySection.copyWith(boxShadow: const []),
padding: const EdgeInsetsDirectional.symmetric(vertical: 14),
child: Row(
children: List.generate(5, (index) {
if (index case 1 || 3) return _separatorBuilder();
@ -23,6 +22,7 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
child: Column(
spacing: 4,
children: [
const SizedBox(height: 8),
Expanded(
flex: 2,
child: FittedBox(
@ -66,6 +66,7 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
title: 'Power Factor',
value: '0.8',
),
const SizedBox(height: 8),
],
),
),
@ -89,26 +90,24 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
decoration: containerWhiteDecoration.copyWith(
boxShadow: const [],
),
padding: const EdgeInsetsDirectional.all(6),
padding: const EdgeInsetsDirectional.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
spacing: 10,
children: [
Expanded(
flex: 2,
child: SvgPicture.asset(
iconPath,
height: 24,
width: 24,
child: FittedBox(
fit: BoxFit.scaleDown,
child: SvgPicture.asset(iconPath),
),
),
Expanded(
flex: 4,
flex: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4,
mainAxisSize: MainAxisSize.min,
spacing: 4,
children: [
Expanded(
child: FittedBox(
@ -125,6 +124,7 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
),
),
Expanded(
flex: 2,
child: FittedBox(
alignment: AlignmentDirectional.centerStart,
fit: BoxFit.scaleDown,
@ -146,8 +146,8 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
color: ColorsManager.textPrimaryColor.withValues(
alpha: 0.83,
),
fontWeight: FontWeight.w400,
fontSize: 12,
fontWeight: FontWeight.w700,
fontSize: 8,
),
),
],
@ -167,19 +167,18 @@ class PowerClampPhasesDataWidget extends StatelessWidget {
Widget _separatorBuilder() {
return Container(
height: double.infinity,
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: ColorsManager.blackColor.withValues(alpha: 0.1),
width: 0.5,
),
),
width: 1,
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
color: ColorsManager.blackColor.withValues(alpha: 0.1),
offset: const Offset(2, 0),
blurRadius: 8,
spreadRadius: 2,
color: Color.fromARGB(20, 0, 0, 0),
offset: Offset(1, 0),
blurRadius: 1,
),
BoxShadow(
color: Color.fromARGB(30, 0, 0, 0),
offset: Offset(-2, 0),
blurRadius: 1,
),
],
),