TF-1014: add quotas out of storage

This commit is contained in:
ManhNTX
2022-11-10 10:35:00 +07:00
committed by Dat H. Pham
parent 75495e7d1f
commit 181915f071
15 changed files with 262 additions and 152 deletions
@@ -6,15 +6,15 @@ import 'package:tmail_ui_user/features/quotas/presentation/quotas_controller.dar
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
class QuotasFooterWidget extends GetWidget<QuotasController> {
const QuotasFooterWidget({Key? key}) : super(key: key);
const QuotasFooterWidget({Key? key, this.padding}) : super(key: key);
final EdgeInsetsGeometry? padding;
@override
Widget build(BuildContext context) {
return Obx(
() => controller.enableShowQuotas.value
? Container(
color: AppColor.colorBgDesktop,
padding: const EdgeInsets.all(24),
padding: padding ?? const EdgeInsets.all(24),
alignment: Alignment.centerLeft,
child: IntrinsicWidth(
child: Column(
@@ -36,21 +36,23 @@ class QuotasFooterWidget extends GetWidget<QuotasController> {
),
const SizedBox(height: 8),
LinearProgressIndicator(
color: controller.enableShowWarningQuotas ? AppColor.colorProgressQuotasWarning: AppColor.primaryColor,
color: controller.quotasState.value.getColorProgress(),
minHeight: 3,
backgroundColor: AppColor.colorDivider,
value: controller.progressUsedCapacity,
),
const SizedBox(height: 8),
Text(
AppLocalizations.of(context).textQuotasUsed(
controller.quotasState.value.getQuotasFooterText(
context,
controller.usedCapacity.value,
controller.softLimitCapacity.value,
),
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w400,
color: AppColor.loginTextFieldHintColor),
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w400,
color: controller.quotasState.value.getColorQuotasFooterText(),
),
)
],
),
@@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:tmail_ui_user/features/quotas/presentation/quotas_controller.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
class QuotasWarningBannerWidget extends GetWidget<QuotasController> {
const QuotasWarningBannerWidget({Key? key}) : super(key: key);
const QuotasWarningBannerWidget({this.margin ,Key? key}) : super(key: key);
final EdgeInsetsGeometry? margin;
@override
Widget build(BuildContext context) {
@@ -14,36 +14,38 @@ class QuotasWarningBannerWidget extends GetWidget<QuotasController> {
() => controller.enableShowWarningQuotas
? Container(
padding: const EdgeInsets.all(16),
margin: const EdgeInsets.only(left: 12, right: 12, top: 8),
margin: margin ?? const EdgeInsets.only(left: 12, right: 12, top: 8),
decoration: BoxDecoration(
color: AppColor.colorBackgroundQuotasWarning.withOpacity(0.12),
color: controller.quotasState.value.getBackgroundColorWarningBanner(),
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Row(
children: [
SvgPicture.asset(controller.imagePaths.icQuotasWarning),
SvgPicture.asset(controller.quotasState.value.getIconWarningBanner(controller.imagePaths)),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
AppLocalizations.of(context)
.textQuotasWarningTitle(controller.progressUsedCapacity *100),
controller.quotasState.value.getTitleWarningBanner(
context,
controller.progressUsedCapacity,
),
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w700,
color: AppColor.colorTitleQuotasWarning,
fontSize: 17,
fontWeight: FontWeight.w700,
color: AppColor.colorTitleQuotasWarning,
),
),
const SizedBox(height: 8),
Text(
AppLocalizations.of(context)
.textQuotasWarningContent,
controller.quotasState.value.getContentWarningBanner(context),
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w400,
color: AppColor.loginTextFieldHintColor),
fontSize: 15,
fontWeight: FontWeight.w400,
color: AppColor.loginTextFieldHintColor,
),
),
],
),