mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00

changed the method of generating assets to be more declrative when it comes to names of the assets. it now include the file path name e.g (asset in the path "assets/images/home-images/home.png" will be generated as this "String assetsImagesHomeImageshome = "path" ". this will be very helpful in the future when we want to orgnize the assets dir.
73 lines
2.2 KiB
Dart
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 'package:syncrow_app/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.assetsImagesTestDash2,
|
|
fit: BoxFit.contain,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|