ui: stats icon fixed

This commit is contained in:
Osama Asif 2023-06-11 01:20:56 +05:00
parent 0f40aa7cc1
commit e08001b44c
10 changed files with 29 additions and 13 deletions

View File

@ -0,0 +1,3 @@
<svg width="18" height="21" viewBox="0 0 18 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.5 20.5C1.1 20.5 0.75 20.35 0.45 20.05C0.15 19.75 0 19.4 0 19V3.5C0 3.1 0.15 2.75 0.45 2.45C0.75 2.15 1.1 2 1.5 2H3.125V1.3C3.125 1.07333 3.20167 0.883333 3.355 0.73C3.50833 0.576667 3.69833 0.5 3.925 0.5C4.15875 0.5 4.35469 0.576667 4.51283 0.73C4.67094 0.883333 4.75 1.07333 4.75 1.3V2H13.25V1.3C13.25 1.07333 13.3267 0.883333 13.48 0.73C13.6333 0.576667 13.8233 0.5 14.05 0.5C14.2838 0.5 14.4797 0.576667 14.6378 0.73C14.7959 0.883333 14.875 1.07333 14.875 1.3V2H16.5C16.9 2 17.25 2.15 17.55 2.45C17.85 2.75 18 3.1 18 3.5V19C18 19.4 17.85 19.75 17.55 20.05C17.25 20.35 16.9 20.5 16.5 20.5H1.5ZM1.5 19H16.5V8.25H1.5V19ZM1.5 6.75H16.5V3.5H1.5V6.75ZM9 12.5C8.71667 12.5 8.47917 12.4042 8.2875 12.2125C8.09583 12.0208 8 11.7833 8 11.5C8 11.2167 8.09583 10.9792 8.2875 10.7875C8.47917 10.5958 8.71667 10.5 9 10.5C9.28333 10.5 9.52083 10.5958 9.7125 10.7875C9.90417 10.9792 10 11.2167 10 11.5C10 11.7833 9.90417 12.0208 9.7125 12.2125C9.52083 12.4042 9.28333 12.5 9 12.5ZM5 12.5C4.71667 12.5 4.47917 12.4042 4.2875 12.2125C4.09583 12.0208 4 11.7833 4 11.5C4 11.2167 4.09583 10.9792 4.2875 10.7875C4.47917 10.5958 4.71667 10.5 5 10.5C5.28333 10.5 5.52083 10.5958 5.7125 10.7875C5.90417 10.9792 6 11.2167 6 11.5C6 11.7833 5.90417 12.0208 5.7125 12.2125C5.52083 12.4042 5.28333 12.5 5 12.5ZM13 12.5C12.7167 12.5 12.4792 12.4042 12.2875 12.2125C12.0958 12.0208 12 11.7833 12 11.5C12 11.2167 12.0958 10.9792 12.2875 10.7875C12.4792 10.5958 12.7167 10.5 13 10.5C13.2833 10.5 13.5208 10.5958 13.7125 10.7875C13.9042 10.9792 14 11.2167 14 11.5C14 11.7833 13.9042 12.0208 13.7125 12.2125C13.5208 12.4042 13.2833 12.5 13 12.5ZM9 16.5C8.71667 16.5 8.47917 16.4042 8.2875 16.2125C8.09583 16.0208 8 15.7833 8 15.5C8 15.2167 8.09583 14.9792 8.2875 14.7875C8.47917 14.5958 8.71667 14.5 9 14.5C9.28333 14.5 9.52083 14.5958 9.7125 14.7875C9.90417 14.9792 10 15.2167 10 15.5C10 15.7833 9.90417 16.0208 9.7125 16.2125C9.52083 16.4042 9.28333 16.5 9 16.5ZM5 16.5C4.71667 16.5 4.47917 16.4042 4.2875 16.2125C4.09583 16.0208 4 15.7833 4 15.5C4 15.2167 4.09583 14.9792 4.2875 14.7875C4.47917 14.5958 4.71667 14.5 5 14.5C5.28333 14.5 5.52083 14.5958 5.7125 14.7875C5.90417 14.9792 6 15.2167 6 15.5C6 15.7833 5.90417 16.0208 5.7125 16.2125C5.52083 16.4042 5.28333 16.5 5 16.5ZM13 16.5C12.7167 16.5 12.4792 16.4042 12.2875 16.2125C12.0958 16.0208 12 15.7833 12 15.5C12 15.2167 12.0958 14.9792 12.2875 14.7875C12.4792 14.5958 12.7167 14.5 13 14.5C13.2833 14.5 13.5208 14.5958 13.7125 14.7875C13.9042 14.9792 14 15.2167 14 15.5C14 15.7833 13.9042 16.0208 13.7125 16.2125C13.5208 16.4042 13.2833 16.5 13 16.5Z" fill="#F07D7D"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="19" viewBox="0 0 16 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 18.5C5.76667 18.5 3.875 17.725 2.325 16.175C0.775 14.625 0 12.7333 0 10.5C0 8.56665 0.595833 6.69165 1.7875 4.87499C2.97917 3.05832 4.61667 1.50832 6.7 0.224987C6.98333 0.0416539 7.27083 0.0374872 7.5625 0.212487C7.85417 0.387487 8 0.649987 8 0.999987V2.79999C8 3.36665 8.19583 3.84165 8.5875 4.22499C8.97917 4.60832 9.45833 4.79999 10.025 4.79999C10.325 4.79999 10.6042 4.73749 10.8625 4.61249C11.1208 4.48749 11.35 4.29999 11.55 4.04999C11.6833 3.89999 11.8333 3.79582 12 3.73749C12.1667 3.67915 12.325 3.69999 12.475 3.79999C13.575 4.54999 14.4375 5.51665 15.0625 6.69999C15.6875 7.88332 16 9.14999 16 10.5C16 12.7333 15.225 14.625 13.675 16.175C12.125 17.725 10.2333 18.5 8 18.5ZM1.5 10.5C1.5 11.55 1.7375 12.5375 2.2125 13.4625C2.6875 14.3875 3.35 15.1583 4.2 15.775C4.13333 15.575 4.08333 15.3708 4.05 15.1625C4.01667 14.9542 4 14.75 4 14.55C4 14.0167 4.1 13.5167 4.3 13.05C4.5 12.5833 4.79167 12.1583 5.175 11.775L8 8.99999L10.825 11.775C11.2083 12.1583 11.5 12.5833 11.7 13.05C11.9 13.5167 12 14.0167 12 14.55C12 14.75 11.9833 14.9542 11.95 15.1625C11.9167 15.3708 11.8667 15.575 11.8 15.775C12.65 15.1583 13.3125 14.3875 13.7875 13.4625C14.2625 12.5375 14.5 11.55 14.5 10.5C14.5 9.59999 14.3083 8.72082 13.925 7.86249C13.5417 7.00415 12.9917 6.21665 12.275 5.49999C11.925 5.74999 11.5583 5.94582 11.175 6.08749C10.7917 6.22915 10.4083 6.29999 10.025 6.29999C9.00833 6.29999 8.16667 5.95415 7.5 5.26249C6.83333 4.57082 6.5 3.69999 6.5 2.64999V2.14999C4.96667 3.24999 3.75 4.55415 2.85 6.06249C1.95 7.57082 1.5 9.04999 1.5 10.5ZM8 11.1L6.225 12.85C5.99167 13.0833 5.8125 13.3417 5.6875 13.625C5.5625 13.9083 5.5 14.2167 5.5 14.55C5.5 15.2333 5.74167 15.8125 6.225 16.2875C6.70833 16.7625 7.3 17 8 17C8.7 17 9.29167 16.7625 9.775 16.2875C10.2583 15.8125 10.5 15.2333 10.5 14.55C10.5 14.2167 10.4375 13.9083 10.3125 13.625C10.1875 13.3417 10.0083 13.0833 9.775 12.85L8 11.1Z" fill="#F0E57D"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="21" viewBox="0 0 16 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.9 19H12.1V15.8226C12.1 14.6575 11.7042 13.6542 10.9125 12.8125C10.1208 11.9708 9.15 11.55 8 11.55C6.85 11.55 5.87917 11.9708 5.0875 12.8125C4.29583 13.6542 3.9 14.6575 3.9 15.8226V19ZM15.25 20.5H0.75C0.5375 20.5 0.359375 20.4277 0.215625 20.2831C0.071875 20.1385 0 19.9594 0 19.7456C0 19.5319 0.071875 19.3542 0.215625 19.2125C0.359375 19.0708 0.5375 19 0.75 19H2.4V15.825C2.4 14.6583 2.70417 13.5875 3.3125 12.6125C3.92083 11.6375 4.76667 10.9333 5.85 10.5C4.76667 10.0667 3.92083 9.35833 3.3125 8.375C2.70417 7.39167 2.4 6.31667 2.4 5.15V2H0.75C0.5375 2 0.359375 1.92771 0.215625 1.78312C0.071875 1.63852 0 1.45936 0 1.24562C0 1.03187 0.071875 0.854167 0.215625 0.7125C0.359375 0.570833 0.5375 0.5 0.75 0.5H15.25C15.4625 0.5 15.6406 0.572292 15.7844 0.716875C15.9281 0.861475 16 1.04064 16 1.25438C16 1.46813 15.9281 1.64583 15.7844 1.7875C15.6406 1.92917 15.4625 2 15.25 2H13.6V5.15C13.6 6.31667 13.2917 7.39167 12.675 8.375C12.0583 9.35833 11.2167 10.0667 10.15 10.5C11.2333 10.9333 12.0792 11.6375 12.6875 12.6125C13.2958 13.5875 13.6 14.6583 13.6 15.825V19H15.25C15.4625 19 15.6406 19.0723 15.7844 19.2169C15.9281 19.3615 16 19.5406 16 19.7544C16 19.9681 15.9281 20.1458 15.7844 20.2875C15.6406 20.4292 15.4625 20.5 15.25 20.5Z" fill="#917DF0"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,3 @@
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.45 14.2L13.5 10.975C13.6833 10.8583 13.775 10.7 13.775 10.5C13.775 10.3 13.6833 10.1417 13.5 10.025L8.45 6.8C8.26667 6.66667 8.075 6.65417 7.875 6.7625C7.675 6.87083 7.575 7.04167 7.575 7.275V13.725C7.575 13.9583 7.675 14.1292 7.875 14.2375C8.075 14.3458 8.26667 14.3333 8.45 14.2ZM10 20.5C8.63333 20.5 7.34167 20.2375 6.125 19.7125C4.90833 19.1875 3.84583 18.4708 2.9375 17.5625C2.02917 16.6542 1.3125 15.5917 0.7875 14.375C0.2625 13.1583 0 11.8667 0 10.5C0 9.11667 0.2625 7.81667 0.7875 6.6C1.3125 5.38333 2.02917 4.325 2.9375 3.425C3.84583 2.525 4.90833 1.8125 6.125 1.2875C7.34167 0.7625 8.63333 0.5 10 0.5C11.3833 0.5 12.6833 0.7625 13.9 1.2875C15.1167 1.8125 16.175 2.525 17.075 3.425C17.975 4.325 18.6875 5.38333 19.2125 6.6C19.7375 7.81667 20 9.11667 20 10.5C20 11.8667 19.7375 13.1583 19.2125 14.375C18.6875 15.5917 17.975 16.6542 17.075 17.5625C16.175 18.4708 15.1167 19.1875 13.9 19.7125C12.6833 20.2375 11.3833 20.5 10 20.5ZM10 19C12.3667 19 14.375 18.1708 16.025 16.5125C17.675 14.8542 18.5 12.85 18.5 10.5C18.5 8.13333 17.675 6.125 16.025 4.475C14.375 2.825 12.3667 2 10 2C7.65 2 5.64583 2.825 3.9875 4.475C2.32917 6.125 1.5 8.13333 1.5 10.5C1.5 12.85 2.32917 14.8542 3.9875 16.5125C5.64583 18.1708 7.65 19 10 19Z" fill="#9BF07D"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,3 @@
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.75 11.75C18.4167 11.75 18.125 11.625 17.875 11.375C17.625 11.125 17.5 10.8333 17.5 10.5C17.5 10.1667 17.625 9.875 17.875 9.625C18.125 9.375 18.4167 9.25 18.75 9.25C19.0833 9.25 19.375 9.375 19.625 9.625C19.875 9.875 20 10.1667 20 10.5C20 10.8333 19.875 11.125 19.625 11.375C19.375 11.625 19.0833 11.75 18.75 11.75ZM1.25 11.75C0.916667 11.75 0.625 11.625 0.375 11.375C0.125 11.125 0 10.8333 0 10.5C0 10.1667 0.125 9.875 0.375 9.625C0.625 9.375 0.916667 9.25 1.25 9.25C1.58333 9.25 1.875 9.375 2.125 9.625C2.375 9.875 2.5 10.1667 2.5 10.5C2.5 10.8333 2.375 11.125 2.125 11.375C1.875 11.625 1.58333 11.75 1.25 11.75ZM10 20.5C9.66667 20.5 9.375 20.375 9.125 20.125C8.875 19.875 8.75 19.5833 8.75 19.25C8.75 18.9167 8.875 18.625 9.125 18.375C9.375 18.125 9.66667 18 10 18C10.3333 18 10.625 18.125 10.875 18.375C11.125 18.625 11.25 18.9167 11.25 19.25C11.25 19.5833 11.125 19.875 10.875 20.125C10.625 20.375 10.3333 20.5 10 20.5ZM13.15 7.325C13 7.175 12.925 6.99583 12.925 6.7875C12.925 6.57917 13 6.4 13.15 6.25L16.375 3.025C16.525 2.875 16.7 2.80417 16.9 2.8125C17.1 2.82083 17.275 2.9 17.425 3.05C17.575 3.2 17.65 3.37917 17.65 3.5875C17.65 3.79583 17.575 3.975 17.425 4.125L14.2 7.35C14.05 7.5 13.875 7.57083 13.675 7.5625C13.475 7.55417 13.3 7.475 13.15 7.325ZM5.8 7.325L2.55 4.1C2.4 3.95 2.32917 3.775 2.3375 3.575C2.34583 3.375 2.425 3.2 2.575 3.05C2.725 2.9 2.90417 2.825 3.1125 2.825C3.32083 2.825 3.5 2.9 3.65 3.05L6.875 6.275C7.025 6.425 7.1 6.6 7.1 6.8C7.1 7 7.025 7.175 6.875 7.325C6.725 7.475 6.54583 7.55 6.3375 7.55C6.12917 7.55 5.95 7.475 5.8 7.325ZM16.375 17.9L13.125 14.675C12.975 14.525 12.9042 14.35 12.9125 14.15C12.9208 13.95 13 13.775 13.15 13.625C13.3 13.475 13.4792 13.4 13.6875 13.4C13.8958 13.4 14.075 13.475 14.225 13.625L17.45 16.85C17.6 17 17.675 17.175 17.675 17.375C17.675 17.575 17.6 17.75 17.45 17.9C17.3 18.05 17.1208 18.125 16.9125 18.125C16.7042 18.125 16.525 18.05 16.375 17.9ZM2.55 17.925C2.4 17.775 2.325 17.5958 2.325 17.3875C2.325 17.1792 2.4 17 2.55 16.85L5.8 13.6C5.95 13.45 6.125 13.3792 6.325 13.3875C6.525 13.3958 6.7 13.475 6.85 13.625C7 13.775 7.075 13.9542 7.075 14.1625C7.075 14.3708 7 14.55 6.85 14.7L3.6 17.95C3.45 18.1 3.275 18.1708 3.075 18.1625C2.875 18.1542 2.7 18.075 2.55 17.925ZM10 3C9.66667 3 9.375 2.875 9.125 2.625C8.875 2.375 8.75 2.08333 8.75 1.75C8.75 1.41667 8.875 1.125 9.125 0.875C9.375 0.625 9.66667 0.5 10 0.5C10.3333 0.5 10.625 0.625 10.875 0.875C11.125 1.125 11.25 1.41667 11.25 1.75C11.25 2.08333 11.125 2.375 10.875 2.625C10.625 2.875 10.3333 3 10 3Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,4 +1,5 @@
class AssetConstants {
static const String rootPath = 'assets/images';
static const String dalle = 'assets/images/dalle.png';
static const String join = 'assets/images/join.png';
static const String icLogo = 'assets/images/ic_logo.svg';

View File

@ -8,7 +8,7 @@ part 'stats_model.g.dart';
@freezed
abstract class StatsModel with _$StatsModel {
const factory StatsModel({
@Default([]) List<MiniStatsModel> mini,
required MiniStatsModel mini,
@Default([]) List<AllStatsModel> all,
}) = _StatsModel;

View File

@ -12,6 +12,7 @@ class RowItemWidget extends StatelessWidget {
this.onTap,
this.isTrailingIcon = true,
this.titleStyle,
this.iconSize = 14,
});
final String title;
@ -21,6 +22,7 @@ class RowItemWidget extends StatelessWidget {
final void Function()? onTap;
final bool isTrailingIcon;
final TextStyle? titleStyle;
final double iconSize;
@override
Widget build(BuildContext context) {
var border = Border(
@ -52,7 +54,7 @@ class RowItemWidget extends StatelessWidget {
children: [
SvgPicture.asset(
leadingIcon,
height: 14,
height: iconSize,
),
width16,
Column(

View File

@ -32,7 +32,11 @@ class StatsBottomSheetWidget extends ConsumerWidget {
onTap: () => ref.refresh(remoteStatsProvider),
),
),
loading: () => CircularProgressIndicator(),
loading: () => Expanded(
child: Center(
child: CircularProgressIndicator(),
),
),
),
],
);
@ -53,7 +57,8 @@ class StatsBottomSheetWidget extends ConsumerWidget {
var all = stats.all[index];
return RowItemWidget(
leadingIcon: getLeadingIconPath('ic_help'),
leadingIcon: getLeadingIconPath(all.icon),
iconSize: 20,
title: all.title,
subTitle: all.subtitle,
isShowUnderline: index < stats.all.length - 1,
@ -67,14 +72,6 @@ class StatsBottomSheetWidget extends ConsumerWidget {
}
String getLeadingIconPath(String path) {
if (path == 'ic_help') {
return AssetConstants.icHelpCircle;
} else if (path == 'ic_email') {
return AssetConstants.icHelpCircle;
} else if (path == 'ic_medito') {
return AssetConstants.icMedito;
}
return AssetConstants.icMedito;
return '${AssetConstants.rootPath}/$path.svg';
}
}

View File

@ -15,6 +15,7 @@ class HomeHeaderWidget extends StatelessWidget {
});
final String? streakCount;
final List<HomeMenuModel> homeMenuModel;
@override
Widget build(BuildContext context) {
return Padding(