From d2b16244bfb7a579a16e7ceb58e93a7c14b2f01f Mon Sep 17 00:00:00 2001 From: mohamadmahdi jebeli Date: Thu, 17 Jul 2025 09:45:42 +0330 Subject: [PATCH] v 4.0.1 --- .vscode/launch.json | 15 --------- lib/utils/date_time.dart | 10 +++--- lib/views/home/home.dart | 32 +++++++++---------- .../home/new_statistic/new_statistic.dart | 8 +++-- pubspec.yaml | 2 +- 5 files changed, 27 insertions(+), 40 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 2ba986f..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:8080", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file diff --git a/lib/utils/date_time.dart b/lib/utils/date_time.dart index 57cb924..b5fd991 100644 --- a/lib/utils/date_time.dart +++ b/lib/utils/date_time.dart @@ -159,24 +159,24 @@ class DateTimeUtils { double interval = seconds / 31536000; if (interval > 1) { - return "منتشر شده در ${interval.floor()} سال پیش"; + return "در ${interval.floor()} سال پیش"; } interval = seconds / 2592000; if (interval > 1) { - return "منتشر شده در ${interval.floor()} ماه پیش"; + return "در ${interval.floor()} ماه پیش"; } interval = seconds / 86400; if (interval > 1) { if (interval.floor() == 1) return 'دیروز'; - return "منتشر شده در ${interval.floor()} روز پیش"; + return "در ${interval.floor()} روز پیش"; } interval = seconds / 3600; if (interval > 1) { - return "منتشر شده در ${interval.floor()} ساعت پیش"; + return "در ${interval.floor()} ساعت پیش"; } interval = seconds / 60; if (interval > 1) { - return "منتشر شده در ${interval.floor()} دقیقه پیش"; + return "در ${interval.floor()} دقیقه پیش"; } return 'هم اکنون'; // return seconds.floor().toString() + " ثانیه پیش"; diff --git a/lib/views/home/home.dart b/lib/views/home/home.dart index 3192715..7f8cd4f 100644 --- a/lib/views/home/home.dart +++ b/lib/views/home/home.dart @@ -152,10 +152,9 @@ class _HomeState extends State _tabController = TabController(length: 4, vsync: this, initialIndex: 0); state.tabController = _tabController; - // این قسمت را اضافه یا جایگزین کنید _tabController.addListener(() { state.currentPageIndex = _tabController.index; - if (_tabController.index == 2) { + if (_tabController.index == 3) { // Changed from 2 to 3 for Houshan tab // با هر بار ورود به تب هوشان، لیست چت‌ها ریست می‌شود final historyState = context.read(); historyState.chats.clear(); @@ -184,21 +183,21 @@ class _HomeState extends State } PreferredSizeWidget getAppBar() { - PreferredSizeWidget result = const LogoAppBar(); - if (context.watch().tabController.index == 2) { - result = HoshanAppBar( - onBack: () { - final state = context.read(); - if (state.page == 1) { - state.goToAi(); - } - }, - ); + // Show HoshanAppBar only for AI section (index 3) + if (context.watch().tabController.index == 3) { + return HoshanAppBar( + onBack: () { + final state = context.read(); + if (state.page == 1) { + state.goToAi(); + } + }, + ); + } + // For all other tabs (home, categories, statistics), show LogoAppBar + return const LogoAppBar(); } - return result; - } - @override Widget build(BuildContext context) { return Scaffold( @@ -229,7 +228,7 @@ class _HomeState extends State confrimTitle: 'بله', dismissTitle: 'خیر', )); - } else if (context.read().tabController.index == 2) { + } else if (context.read().tabController.index == 3) { // Changed from 2 to 3 switch (context.read().page) { case 1: context.read().goToAi(); @@ -259,6 +258,7 @@ class _HomeState extends State MainPage(), CategoriesPage(), NewStatistic(), + // AiSection(), ], ), ), diff --git a/lib/views/home/new_statistic/new_statistic.dart b/lib/views/home/new_statistic/new_statistic.dart index 4a2298f..0069c16 100644 --- a/lib/views/home/new_statistic/new_statistic.dart +++ b/lib/views/home/new_statistic/new_statistic.dart @@ -47,7 +47,8 @@ class _NewStatisticState extends State { children: [ Center( child: Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16), + padding: + const EdgeInsets.symmetric(horizontal: 12, vertical: 16), color: Theme.of(context).colorScheme.background, child: DidvanText( 'دسته‌بندی‌های کلان', @@ -97,7 +98,8 @@ class _NewStatisticState extends State { itemsInStatics(context, state, 1, DidvanIcons.currency_solid), itemsInStatics(context, state, 2, DidvanIcons.bitcoin_solid), itemsInStatics(context, state, 3, DidvanIcons.metal_solid), - itemsInStatics(context, state, 4, DidvanIcons.commodity_solid), + itemsInStatics( + context, state, 4, DidvanIcons.commodity_solid), itemsInStatics(context, state, 5, DidvanIcons.industry_solid, hasDivider: false), const SizedBox( @@ -363,4 +365,4 @@ class StatHeader extends StatelessWidget { ) ]); } -} +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 3a1e4ef..5786330 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.0.3+5000 +version: 4.0.1+6000 environment: sdk: ">=2.19.0 <3.0.0"