diff --git a/lib/views/authentication/screens/username.dart b/lib/views/authentication/screens/username.dart index 4c33fc6..54fde6a 100644 --- a/lib/views/authentication/screens/username.dart +++ b/lib/views/authentication/screens/username.dart @@ -80,7 +80,7 @@ class _UsernameInputState extends State { 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 { recognizer: TapGestureRecognizer() ..onTap = () => launchUrl( Uri.parse( - 'https://didvan.app/termsOfUse.html#privacy', + 'https://didvan.app/terms-of-use#privacy', ), ), ), diff --git a/lib/views/home/bookmarks/bookmarks.dart b/lib/views/home/bookmarks/bookmarks.dart index e992040..92790b7 100644 --- a/lib/views/home/bookmarks/bookmarks.dart +++ b/lib/views/home/bookmarks/bookmarks.dart @@ -55,7 +55,7 @@ class _BookmarksState extends State { children: [ MenuOption( onTap: () => _onCategorySelected(5), - title: 'تحلیل‌های رادار', + title: 'رادارهای استراتژیک', icon: DidvanIcons.radar_regular, iconSize: 24, ), diff --git a/lib/views/home/bookmarks/filtered_bookmark/filtered_bookmark.dart b/lib/views/home/bookmarks/filtered_bookmark/filtered_bookmark.dart index ddc0697..01bd404 100644 --- a/lib/views/home/bookmarks/filtered_bookmark/filtered_bookmark.dart +++ b/lib/views/home/bookmarks/filtered_bookmark/filtered_bookmark.dart @@ -37,7 +37,7 @@ class _FilteredBookmarksState extends State { case 4: return 'پادکست‌ها'; case 5: - return 'تحلیل‌های رادار'; + return 'رادارهای استراتژیک'; case 6: return 'سها'; case 7: diff --git a/lib/views/home/home_state.dart b/lib/views/home/home_state.dart index 2b0c1b9..e0514d5 100644 --- a/lib/views/home/home_state.dart +++ b/lib/views/home/home_state.dart @@ -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 = [ diff --git a/lib/views/home/infography/infography_screen.dart b/lib/views/home/infography/infography_screen.dart index 2424e1b..717cf53 100644 --- a/lib/views/home/infography/infography_screen.dart +++ b/lib/views/home/infography/infography_screen.dart @@ -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 { ), enableEmptyState: context.watch().contents.isEmpty, + topPadding: 16, onRetry: context.read().init, state: context.watch(), builder: (context, state) => Expanded( diff --git a/lib/views/home/new_statistic/new_statistic.dart b/lib/views/home/new_statistic/new_statistic.dart index bbfb89f..e9bb535 100644 --- a/lib/views/home/new_statistic/new_statistic.dart +++ b/lib/views/home/new_statistic/new_statistic.dart @@ -76,15 +76,15 @@ class _NewStatisticState extends State { 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 { }).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 { }), 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 { }), child: StatHeader( header: state.contents[5].header, - icon: DidvanIcons.metal_solid, + icon: DidvanIcons.industry_solid, )), SizedBox( height: 100, diff --git a/lib/views/home/new_statistic/new_statistics_state.dart b/lib/views/home/new_statistic/new_statistics_state.dart index c0ccd66..f1a33a7 100644 --- a/lib/views/home/new_statistic/new_statistics_state.dart +++ b/lib/views/home/new_statistic/new_statistics_state.dart @@ -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), diff --git a/lib/views/home/new_statistic/statistics_details/stat_cats_general_screen.dart b/lib/views/home/new_statistic/statistics_details/stat_cats_general_screen.dart index 1c89bea..575a286 100644 --- a/lib/views/home/new_statistic/statistics_details/stat_cats_general_screen.dart +++ b/lib/views/home/new_statistic/statistics_details/stat_cats_general_screen.dart @@ -115,6 +115,7 @@ class _StatGeneralScreenState extends State { ), enableEmptyState: context.watch().contents.isEmpty, + topPadding: 16, placeholder: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/views/home/new_statistic/stock/exchange.dart b/lib/views/home/new_statistic/stock/exchange.dart index 347acc9..c9fd696 100644 --- a/lib/views/home/new_statistic/stock/exchange.dart +++ b/lib/views/home/new_statistic/stock/exchange.dart @@ -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( diff --git a/lib/views/home/new_statistic/stock/metal.dart b/lib/views/home/new_statistic/stock/metal.dart index bb15d1f..85bbc6b 100644 --- a/lib/views/home/new_statistic/stock/metal.dart +++ b/lib/views/home/new_statistic/stock/metal.dart @@ -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( diff --git a/lib/views/home/new_statistic/stock/new_stock.dart b/lib/views/home/new_statistic/stock/new_stock.dart index d2e3546..4cc0b50 100644 --- a/lib/views/home/new_statistic/stock/new_stock.dart +++ b/lib/views/home/new_statistic/stock/new_stock.dart @@ -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 { // 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 { onNewSearch: () => _focusNode.requestFocus(), ), enableEmptyState: context.watch().contents.isEmpty, + topPadding: 16, placeholder: Column( children: [ placeholder2, @@ -148,21 +148,18 @@ class _NewStockState extends State { 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 { } if (state.type == 4) { - log("I AM 4"); return MetalCard(metalContent: state.contents[index]); } return TotalType3Card( diff --git a/lib/views/home/new_statistic/widgets/statistic_cat.dart b/lib/views/home/new_statistic/widgets/statistic_cat.dart index f812a74..6942809 100644 --- a/lib/views/home/new_statistic/widgets/statistic_cat.dart +++ b/lib/views/home/new_statistic/widgets/statistic_cat.dart @@ -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'; diff --git a/lib/views/profile/edit_profile/edit_profile.dart b/lib/views/profile/edit_profile/edit_profile.dart index fd279bd..6117aac 100644 --- a/lib/views/profile/edit_profile/edit_profile.dart +++ b/lib/views/profile/edit_profile/edit_profile.dart @@ -86,9 +86,10 @@ class _EditProfileState extends State { 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 { key: UniqueKey(), title: 'ذخیره تغییرات', onPressed: () { - if (_formKey.currentState!.validate()) { + if (_formKey.currentState!.validate() && + _usernameIsAvailible) { state.editProfile(fullName, username, email); } }, diff --git a/lib/views/profile/profile.dart b/lib/views/profile/profile.dart index dbf4fbc..5550d13 100644 --- a/lib/views/profile/profile.dart +++ b/lib/views/profile/profile.dart @@ -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'), ), ), ], diff --git a/lib/views/widgets/didvan/checkbox.dart b/lib/views/widgets/didvan/checkbox.dart index dfeb454..d606663 100644 --- a/lib/views/widgets/didvan/checkbox.dart +++ b/lib/views/widgets/didvan/checkbox.dart @@ -49,7 +49,7 @@ class _DidvanCheckboxState extends State { widget.onChanged(_value); }, ), - const SizedBox(width: 8), + const SizedBox(width: 4), DidvanText(widget.title), ], ), diff --git a/lib/views/widgets/overview/multitype.dart b/lib/views/widgets/overview/multitype.dart index 07ddb16..0eb788d 100644 --- a/lib/views/widgets/overview/multitype.dart +++ b/lib/views/widgets/overview/multitype.dart @@ -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; }