Files
syncrow-app/lib/features/dashboard/view/widgets/consumption.dart
Mohammad Salameh 481fe1c0f3 replaced Gap Class with the appropriate SizedBox
removed the Gap dependency
2024-03-02 15:52:28 +03:00

73 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart';
import 'package:syncrow_app/features/shared_widgets/united_text.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
import '../../../../generated/assets.dart';
class Consumption extends StatelessWidget {
const Consumption({
super.key,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(right: 20, left: 20, top: 10, bottom: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
constraints: const BoxConstraints(
minHeight: 80,
maxHeight: 100,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const CardTitle(
title: StringsManager.ACConsumption,
),
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
UnitedText(
value: "2",
valueSize: MediaQuery.sizeOf(context).height.ceil() > 680
? 35
: 24,
valueWeight: FontWeight.normal,
unit: "Units",
),
const SizedBox(width: 30),
UnitedText(
value: "${MediaQuery.sizeOf(context).height.ceil()}",
valueSize: MediaQuery.sizeOf(context).height.ceil() > 680
? 35
: 24,
valueWeight: FontWeight.normal,
unit: "kWh",
),
],
),
const Spacer(),
],
),
//TODO: Replace with actual pie chart
SizedBox.square(
dimension: 60,
child: Image.asset(
Assets.imagesTestDash2,
fit: BoxFit.contain,
),
)
],
),
);
}
}