svg icons replaced,validate msg aligned,bookmark haeding added etc

This commit is contained in:
Kalonkarthik 2025-02-27 17:33:22 +05:30
parent 30db38c60b
commit ca24970c53
12 changed files with 96 additions and 46 deletions

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.1191 21.8809L17.6427 16.4056C19.2299 14.5 20.0214 12.0558 19.8525 9.58143C19.6836 7.10709 18.5672 4.79313 16.7357 3.12091C14.9041 1.4487 12.4984 0.546971 10.0189 0.603321C7.53944 0.65967 5.17715 1.66976 3.42345 3.42345C1.66976 5.17715 0.65967 7.53944 0.603321 10.0189C0.546971 12.4984 1.4487 14.9041 3.12091 16.7357C4.79313 18.5672 7.10709 19.6836 9.58143 19.8525C12.0558 20.0214 14.5 19.2299 16.4056 17.6427L21.8809 23.1191C21.9622 23.2004 22.0588 23.2649 22.165 23.3088C22.2712 23.3528 22.385 23.3755 22.5 23.3755C22.615 23.3755 22.7288 23.3528 22.835 23.3088C22.9413 23.2649 23.0378 23.2004 23.1191 23.1191C23.2004 23.0378 23.2649 22.9413 23.3088 22.835C23.3528 22.7288 23.3755 22.615 23.3755 22.5C23.3755 22.385 23.3528 22.2712 23.3088 22.165C23.2649 22.0588 23.2004 21.9622 23.1191 21.8809ZM2.37501 10.25C2.37501 8.69248 2.83687 7.16993 3.70218 5.87489C4.5675 4.57985 5.79741 3.57049 7.23637 2.97445C8.67534 2.37841 10.2587 2.22246 11.7863 2.52632C13.3139 2.83018 14.7171 3.5802 15.8185 4.68154C16.9198 5.78288 17.6698 7.18607 17.9737 8.71367C18.2775 10.2413 18.1216 11.8247 17.5256 13.2636C16.9295 14.7026 15.9202 15.9325 14.6251 16.7978C13.3301 17.6631 11.8075 18.125 10.25 18.125C8.16214 18.1227 6.16044 17.2923 4.6841 15.8159C3.20775 14.3396 2.37732 12.3379 2.37501 10.25Z" fill="#9EA2A9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.125 3L10.325 11.6637V18.1683L13.925 20V11.6637L21.125 3H3.125Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 237 B

View File

@ -12,5 +12,5 @@ abstract class MiscIconAssetPath {
static const save = '$_basePath/save.png';
static const group = '$_basePath/group.png';
static const search = '$_basePath/search.png';
static const Search = '$_basePath/Search.svg';
}

View File

@ -6,5 +6,6 @@ abstract class UaeNumbersAssetPath {
// static const bookmarksSelectedUae = '$_basePath/bookmarksSelectedUae.png';
// static const shareUae = '$_basePath/share.png';
static const share = '$_basePath/share.svg';
static const filterUae = '$_basePath/filters.png';
static const filterUae = '$_basePath/filters.png';
static const filterCharts = '$_basePath/Filter.svg';
}

View File

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
@ -197,11 +198,13 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
decoration: InputDecoration(
hintText: "Search",
hintStyle: TextStyle(color: Color(0xFF898C81)),
prefixIcon: Image(
image: ExactAssetImage(MiscIconAssetPath.search),
width: 24,
height: 24,
prefixIconConstraints: BoxConstraints(maxWidth: 42, maxHeight: 42),
prefixIcon: Container(
padding: EdgeInsets.only(right: 5),
child: SvgPicture.asset(
MiscIconAssetPath.Search,
semanticsLabel: 'Search',
),
),
// prefixIcon: Image.asset(

View File

@ -242,11 +242,12 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
pathColorWhenOn: Colors.grey.shade300,
pathColorWhenOff: Colors.grey.shade300,
onTap: () {
print('has validated $hasValidated');
final formState = _formKey.currentState;
ref.read(localeProvider.notifier).toggleLocale();
Future.delayed(Duration(milliseconds: 100), () {
if (hasValidated && formState?.validate() == false) {
print('has validated $hasValidated');
formState?.validate();
}
});
@ -583,7 +584,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
child: ElevatedButton(
onPressed: () async {
setState(() {
hasValidated=true;
});
if ((_formKey.currentState?.validate() ?? false)) {
await updatePassword(

View File

@ -216,10 +216,12 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
}
Future<void> _registerUser() async {
setState(() {
hasValidated = true;
});
if (_formKey.currentState?.validate() ?? false) {
if (isChecked) {
setState(() {
hasValidated = true;
isRegistering = true; // Disable the button
});
try {
@ -1111,11 +1113,11 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
?.languageCode ==
'ar'
? 0
: 30.0,
: 40.0,
right: registerLocale
?.languageCode ==
'ar'
? 40
? 45
: 0.0,),
child: Text(
context.translate('Required', 'مطلوب'),

View File

@ -1459,11 +1459,12 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
children: [
Row(
children: [
Image.asset(
UaeNumbersAssetPath.filterUae,
color: Color(0xFF8E8E8E), // Outline color
width: 24, // Slightly larger
height: 24,
SvgPicture.asset(
UaeNumbersAssetPath.filterCharts,
semanticsLabel: 'Filter',
colorFilter:ColorFilter.mode(Color(0xFF8E8E8E),BlendMode.srcIn),
width: 25,
height: 25,
),
SizedBox(width: 8),
Text(
@ -2172,12 +2173,11 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
),
),
SizedBox(width: 10),
Image.asset(
UaeNumbersAssetPath.filterUae,
color: Colors
.white, // Set color to white
width: 21,
height: 21,
SvgPicture.asset(
UaeNumbersAssetPath.filterCharts,
semanticsLabel: 'Filter',
width: 24,
height: 24,
),
],
),

View File

@ -456,6 +456,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
@override
Widget build(BuildContext context) {
final profileLocale = ref.watch(localeProvider);
return PopScope(
canPop: false, // Allow back navigation only if not login screen
onPopInvokedWithResult: (didPop, result) {
@ -790,7 +791,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
),
borderRadius: BorderRadius.circular(8),
),
labelText: 'Select',
labelText: context.translate('Select',' اختيار')
),
icon: Icon(Icons.keyboard_arrow_down_sharp,
color:
@ -916,7 +917,11 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 10.0),
padding: EdgeInsets.only(left: 10.0, right: profileLocale
?.languageCode ==
'ar'
? 15
: 0.0,),
child: Text(
context.translate('Required', 'مطلوب'),
style: TextStyle(

View File

@ -45,7 +45,7 @@ class ThemedFormField extends HookWidget {
final inputDecoration = InputDecoration(
filled: true,
fillColor: Colors.white,
contentPadding: const EdgeInsets.symmetric(vertical: 14),
contentPadding: const EdgeInsets.symmetric(vertical: 14, horizontal: 15),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(

View File

@ -289,9 +289,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
final List<Map<String, dynamic>> tabs = [
{ 'title':AppLocalizations.of(context)!.all_bookmarks, 'color': Colors.black},
{ 'title': AppLocalizations.of(context)!.economy_title, 'color': Colors.black},
{ 'title':AppLocalizations.of(context)!.social_title, 'color': Colors.black},
{ 'title': AppLocalizations.of(context)!.environment_title, 'color': Colors.black},
{ 'title': AppLocalizations.of(context)!.economy_title, 'color': Color(0xFF90B0D5)},
{ 'title':AppLocalizations.of(context)!.social_title, 'color': Color(0xFFAA8E83)},
{ 'title': AppLocalizations.of(context)!.environment_title, 'color': Color(0xFF7DAFBC)},
];
ref.listen<Locale?>(localeProvider, (previous, next) {
@ -408,19 +408,47 @@ class _BookMarkState extends ConsumerState<BookMark> {
)
: Padding(
padding: const EdgeInsets.all(8.0),
child: GridView.builder(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10.0,
mainAxisSpacing: 10.0,
mainAxisExtent: 100,
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: tabs[selectedTabIndex]['color'],
borderRadius: BorderRadius.all(Radius.circular(35))
),
padding: const EdgeInsets.only(
left: 16, bottom: 5, top: 5, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
tabs[selectedTabIndex]['title'],
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 20,
),
),
itemCount: filteredBookmarks.length,
itemBuilder: (context, index) {
return _buildBox(filteredBookmarks[index], context);
},
],
),
),
SizedBox(height: 20,),
Expanded(
child: GridView.builder(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10.0,
mainAxisSpacing: 10.0,
mainAxisExtent: 100,
),
itemCount: filteredBookmarks.length,
itemBuilder: (context, index) {
return _buildBox(filteredBookmarks[index], context);
},
),
),
],
),
),
),
],
@ -661,7 +689,7 @@ class TabBarHeader extends StatelessWidget {
foregroundColor:
MaterialStateProperty.resolveWith((states) {
return selectedIndex == index
? Colors.black
? entry.value['color']
: Colors.grey[700];
}),
),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:intl/intl.dart';
import 'package:pocketbase/pocketbase.dart';
@ -342,11 +343,14 @@ class _ManageUserRouterState extends State<ManageUserRouter> {
decoration: InputDecoration(
hintText: "Search",
hintStyle: TextStyle(color: Color(0xFF898C81)),
prefixIcon: Image(
image: ExactAssetImage(MiscIconAssetPath.search),
width: 24,
height: 24,
color: Color(0xFFAA8E83)),
prefixIconConstraints: BoxConstraints(maxWidth: 42, maxHeight: 42),
prefixIcon: Container(
padding: EdgeInsets.only(right: 5),
child: SvgPicture.asset(
MiscIconAssetPath.Search,
semanticsLabel: 'Search',
),
),
// prefixIcon: Image.asset(
// MiscIconAssetPath.search,