fix some isuues

This commit is contained in:
Amir Hossein Mousavi 2024-04-14 00:56:18 +03:30
parent dfe506bb01
commit dd04590128
16 changed files with 35 additions and 40 deletions

View File

@ -80,7 +80,7 @@ class _UsernameInputState extends State<UsernameInput> {
recognizer: TapGestureRecognizer()
..onTap = () => launchUrl(
Uri.parse(
'https://didvan.app/termsOfUse.html#conditions',
'https://didvan.app/terms-of-use#conditions',
),
),
),
@ -94,7 +94,7 @@ class _UsernameInputState extends State<UsernameInput> {
recognizer: TapGestureRecognizer()
..onTap = () => launchUrl(
Uri.parse(
'https://didvan.app/termsOfUse.html#privacy',
'https://didvan.app/terms-of-use#privacy',
),
),
),

View File

@ -55,7 +55,7 @@ class _BookmarksState extends State<Bookmarks> {
children: [
MenuOption(
onTap: () => _onCategorySelected(5),
title: 'تحلیل‌های رادار',
title: 'رادارهای استراتژیک',
icon: DidvanIcons.radar_regular,
iconSize: 24,
),

View File

@ -37,7 +37,7 @@ class _FilteredBookmarksState extends State<FilteredBookmarks> {
case 4:
return 'پادکست‌ها';
case 5:
return 'تحلیل‌های رادار';
return 'رادارهای استراتژیک';
case 6:
return 'سها';
case 7:

View File

@ -136,7 +136,7 @@ class HomeState extends CoreProvier {
CategoryData(id: 2, label: 'دنیای فولاد'),
CategoryData(id: 3, label: 'ویدیوکست'),
CategoryData(id: 4, label: 'پادکست'),
CategoryData(id: 5, label: 'تحلیل‌های راداری'),
CategoryData(id: 5, label: 'رادارهای استراتژیک'),
CategoryData(id: 6, label: 'سها'),
];
@ -182,6 +182,11 @@ class HomeState extends CoreProvier {
asset: Assets.risk,
link: 'https://risk.didvan.app/',
),
MenuItemType(
label: 'اینفوگرافی',
asset: Assets.infography,
link: Routes.infography,
),
MenuItemType(
label: 'ویدیوکست',
asset: Assets.videocast,
@ -192,11 +197,6 @@ class HomeState extends CoreProvier {
asset: Assets.podcast,
link: Routes.podcasts,
),
MenuItemType(
label: 'اینفوگرافی',
asset: Assets.infography,
link: Routes.infography,
),
];
categories = [

View File

@ -12,7 +12,6 @@ import 'package:didvan/views/widgets/didvan/checkbox.dart';
import 'package:didvan/views/widgets/didvan/divider.dart';
import 'package:didvan/views/widgets/didvan/text.dart';
import 'package:didvan/views/widgets/item_title.dart';
import 'package:didvan/views/widgets/overview/news.dart';
import 'package:didvan/views/widgets/search_field.dart';
import 'package:didvan/views/widgets/shimmer_placeholder.dart';
import 'package:didvan/views/widgets/state_handlers/empty_result.dart';
@ -192,6 +191,7 @@ class _InfographyScreenState extends State<InfographyScreen> {
),
enableEmptyState:
context.watch<InfographyScreenState>().contents.isEmpty,
topPadding: 16,
onRetry: context.read<InfographyScreenState>().init,
state: context.watch<InfographyScreenState>(),
builder: (context, state) => Expanded(

View File

@ -76,15 +76,15 @@ class _NewStatisticState extends State<NewStatistic> {
child: Column(
children: [
placeholder,
SizedBox(
const SizedBox(
height: 8,
),
placeholder,
SizedBox(
const SizedBox(
height: 8,
),
placeholder,
SizedBox(
const SizedBox(
height: 8,
),
placeholder,
@ -182,7 +182,7 @@ class _NewStatisticState extends State<NewStatistic> {
}).then((value) => _reset()),
child: StatHeader(
header: state.contents[3].header,
icon: DidvanIcons.commodity_solid,
icon: DidvanIcons.metal_solid,
),
),
SizedBox(
@ -208,7 +208,7 @@ class _NewStatisticState extends State<NewStatistic> {
}),
child: StatHeader(
header: state.contents[4].header,
icon: DidvanIcons.industry_solid,
icon: DidvanIcons.commodity_solid,
)),
SizedBox(
height: 100,
@ -233,7 +233,7 @@ class _NewStatisticState extends State<NewStatistic> {
}),
child: StatHeader(
header: state.contents[5].header,
icon: DidvanIcons.metal_solid,
icon: DidvanIcons.industry_solid,
)),
SizedBox(
height: 100,

View File

@ -42,7 +42,7 @@ class NewStatisticState extends CoreProvier {
label: "ارزهای دیجیتال", asset: Assets.cryptoStatCat, id: 2),
StatMenuItemType(label: "فلزات پایه", asset: Assets.metalStatCat, id: 3),
StatMenuItemType(
label: "کامودیتی ها", asset: Assets.commodityStatCat, id: 4),
label: "کامودیتیها", asset: Assets.commodityStatCat, id: 4),
StatMenuItemType(label: "صنعت فولاد", asset: Assets.steelStatCat, id: 5),
StatMenuItemType(
label: "بازار سرمایه", asset: Assets.stockStatCat, id: 6),
@ -60,7 +60,7 @@ class NewStatisticState extends CoreProvier {
label: "ارزهای دیجیتال", asset: Assets.cryptoStatCat, id: 2),
StatMenuItemType(label: "فلزات پایه", asset: Assets.metalStatCat, id: 3),
StatMenuItemType(
label: "کامودیتی ها", asset: Assets.commodityStatCat, id: 4),
label: "کامودیتیها", asset: Assets.commodityStatCat, id: 4),
StatMenuItemType(label: "صنعت فولاد", asset: Assets.steelStatCat, id: 5),
StatMenuItemType(
label: "بازار سرمایه", asset: Assets.stockStatCat, id: 6),

View File

@ -115,6 +115,7 @@ class _StatGeneralScreenState extends State<StatGeneralScreen> {
),
enableEmptyState:
context.watch<StatGeneralScreenState>().contents.isEmpty,
topPadding: 16,
placeholder: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@ -14,8 +14,6 @@ class ExchangeCard extends StatelessWidget {
? Theme.of(context).colorScheme.success
: Theme.of(context).colorScheme.error;
bool get _hasDiff => exchangeContent.data.d != '0';
@override
Widget build(BuildContext context) {
return Padding(

View File

@ -14,8 +14,6 @@ class MetalCard extends StatelessWidget {
? Theme.of(context).colorScheme.success
: Theme.of(context).colorScheme.error;
bool get _hasDiff => metalContent.data.d != '0';
@override
Widget build(BuildContext context) {
return Padding(

View File

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:developer';
import 'package:didvan/config/theme_data.dart';
import 'package:didvan/views/home/new_statistic/stock/exchange.dart';
@ -105,14 +104,14 @@ class _NewStockState extends State<NewStock> {
// Here, default theme colors are used for activeBgColor, activeFgColor, inactiveBgColor and inactiveFgColor
ToggleSwitch(
borderWidth: 1,
activeBgColor: [Theme.of(context).colorScheme.surface],
activeBgColor: [Theme.of(context).colorScheme.primary],
radiusStyle: true,
borderColor: [Colors.grey.shade600],
borderColor: [Theme.of(context).colorScheme.border],
centerText: true,
activeFgColor: Theme.of(context).colorScheme.title,
inactiveBgColor: Theme.of(context).colorScheme.secondCTA,
inactiveFgColor: Theme.of(context).colorScheme.disabledText,
dividerColor: Colors.grey.shade500,
activeFgColor: Theme.of(context).colorScheme.onPrimary,
inactiveBgColor: Theme.of(context).colorScheme.surface,
inactiveFgColor: Theme.of(context).colorScheme.text,
dividerColor: Theme.of(context).colorScheme.border,
initialLabelIndex: value,
customTextStyles: const [TextStyle(fontWeight: FontWeight.w500)],
minWidth: 90,
@ -136,6 +135,7 @@ class _NewStockState extends State<NewStock> {
onNewSearch: () => _focusNode.requestFocus(),
),
enableEmptyState: context.watch<NewStockState>().contents.isEmpty,
topPadding: 16,
placeholder: Column(
children: [
placeholder2,
@ -148,21 +148,18 @@ class _NewStockState extends State<NewStock> {
itemCount: state.length,
itemBuilder: (context, index) {
if (state.type == 1) {
log("I AM 1");
return ExchangeCard(
exchangeContent: state.contents[index],
);
}
if (state.type == 2) {
log("I AM 2");
return ExchangeCard(
exchangeContent: state.contents[index],
);
}
if (state.type == 3) {
log("I AM 3");
return Column(
children: [
if (index <= (state.length_type3! - 1))
@ -176,7 +173,6 @@ class _NewStockState extends State<NewStock> {
}
if (state.type == 4) {
log("I AM 4");
return MetalCard(metalContent: state.contents[index]);
}
return TotalType3Card(

View File

@ -3,7 +3,7 @@ import 'package:didvan/config/theme_data.dart';
import 'package:didvan/routes/routes.dart';
import 'package:didvan/views/home/new_statistic/new_statistics_state.dart';
import 'package:didvan/views/widgets/didvan/text.dart';
import 'package:didvan/views/widgets/state_handlers/state_handler.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';

View File

@ -86,9 +86,10 @@ class _EditProfileState extends State<EditProfile> {
hintText: 'انتخاب نام کاربری (اختیاری)',
onChanged: _onUsernameChanged,
initialValue: state.user.username,
acceptSpace: false,
),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DidvanText(
'نام کاربری می‌تواند شامل کاراکترهای کوچک و بزرگ انگلیسی و اعداد باشد.',
style: Theme.of(context).textTheme.labelSmall,
@ -151,7 +152,8 @@ class _EditProfileState extends State<EditProfile> {
key: UniqueKey(),
title: 'ذخیره تغییرات',
onPressed: () {
if (_formKey.currentState!.validate()) {
if (_formKey.currentState!.validate() &&
_usernameIsAvailible) {
state.editProfile(fullName, username, email);
}
},

View File

@ -114,7 +114,7 @@ class ProfilePage extends StatelessWidget {
icon: DidvanIcons.alert_regular,
title: 'حریم خصوصی',
onTap: () => launchUrl(
Uri.parse('https://didvan.app/termsOfUse.html#privacy'),
Uri.parse('https://didvan.app/terms-of-use#privacy'),
),
),
],

View File

@ -49,7 +49,7 @@ class _DidvanCheckboxState extends State<DidvanCheckbox> {
widget.onChanged(_value);
},
),
const SizedBox(width: 8),
const SizedBox(width: 4),
DidvanText(widget.title),
],
),

View File

@ -76,7 +76,7 @@ class MultitypeOverview extends StatelessWidget {
case 'delphi':
return DidvanIcons.saha_light;
case 'infography':
return DidvanIcons.info_circle_light;
return DidvanIcons.infography_regular;
default:
return DidvanIcons.radar_light;
}