This commit is contained in:
mohamadmahdi jebeli 2025-07-17 09:45:42 +03:30
parent 0aec835d8a
commit d2b16244bf
5 changed files with 27 additions and 40 deletions

15
.vscode/launch.json vendored
View File

@ -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}"
}
]
}

View File

@ -159,24 +159,24 @@ class DateTimeUtils {
double interval = seconds / 31536000; double interval = seconds / 31536000;
if (interval > 1) { if (interval > 1) {
return "منتشر شده در ${interval.floor()} سال پیش"; return "در ${interval.floor()} سال پیش";
} }
interval = seconds / 2592000; interval = seconds / 2592000;
if (interval > 1) { if (interval > 1) {
return "منتشر شده در ${interval.floor()} ماه پیش"; return "در ${interval.floor()} ماه پیش";
} }
interval = seconds / 86400; interval = seconds / 86400;
if (interval > 1) { if (interval > 1) {
if (interval.floor() == 1) return 'دیروز'; if (interval.floor() == 1) return 'دیروز';
return "منتشر شده در ${interval.floor()} روز پیش"; return "در ${interval.floor()} روز پیش";
} }
interval = seconds / 3600; interval = seconds / 3600;
if (interval > 1) { if (interval > 1) {
return "منتشر شده در ${interval.floor()} ساعت پیش"; return "در ${interval.floor()} ساعت پیش";
} }
interval = seconds / 60; interval = seconds / 60;
if (interval > 1) { if (interval > 1) {
return "منتشر شده در ${interval.floor()} دقیقه پیش"; return "در ${interval.floor()} دقیقه پیش";
} }
return 'هم اکنون'; return 'هم اکنون';
// return seconds.floor().toString() + " ثانیه پیش"; // return seconds.floor().toString() + " ثانیه پیش";

View File

@ -152,10 +152,9 @@ class _HomeState extends State<Home>
_tabController = TabController(length: 4, vsync: this, initialIndex: 0); _tabController = TabController(length: 4, vsync: this, initialIndex: 0);
state.tabController = _tabController; state.tabController = _tabController;
// این قسمت را اضافه یا جایگزین کنید
_tabController.addListener(() { _tabController.addListener(() {
state.currentPageIndex = _tabController.index; state.currentPageIndex = _tabController.index;
if (_tabController.index == 2) { if (_tabController.index == 3) { // Changed from 2 to 3 for Houshan tab
// با هر بار ورود به تب هوشان، لیست چتها ریست میشود // با هر بار ورود به تب هوشان، لیست چتها ریست میشود
final historyState = context.read<HistoryAiChatState>(); final historyState = context.read<HistoryAiChatState>();
historyState.chats.clear(); historyState.chats.clear();
@ -184,9 +183,9 @@ class _HomeState extends State<Home>
} }
PreferredSizeWidget getAppBar() { PreferredSizeWidget getAppBar() {
PreferredSizeWidget result = const LogoAppBar(); // Show HoshanAppBar only for AI section (index 3)
if (context.watch<HomeState>().tabController.index == 2) { if (context.watch<HomeState>().tabController.index == 3) {
result = HoshanAppBar( return HoshanAppBar(
onBack: () { onBack: () {
final state = context.read<AiState>(); final state = context.read<AiState>();
if (state.page == 1) { if (state.page == 1) {
@ -195,8 +194,8 @@ class _HomeState extends State<Home>
}, },
); );
} }
// For all other tabs (home, categories, statistics), show LogoAppBar
return result; return const LogoAppBar();
} }
@override @override
@ -229,7 +228,7 @@ class _HomeState extends State<Home>
confrimTitle: 'بله', confrimTitle: 'بله',
dismissTitle: 'خیر', dismissTitle: 'خیر',
)); ));
} else if (context.read<HomeState>().tabController.index == 2) { } else if (context.read<HomeState>().tabController.index == 3) { // Changed from 2 to 3
switch (context.read<AiState>().page) { switch (context.read<AiState>().page) {
case 1: case 1:
context.read<AiState>().goToAi(); context.read<AiState>().goToAi();
@ -259,6 +258,7 @@ class _HomeState extends State<Home>
MainPage(), MainPage(),
CategoriesPage(), CategoriesPage(),
NewStatistic(), NewStatistic(),
// AiSection(),
], ],
), ),
), ),

View File

@ -47,7 +47,8 @@ class _NewStatisticState extends State<NewStatistic> {
children: [ children: [
Center( Center(
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16), padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
color: Theme.of(context).colorScheme.background, color: Theme.of(context).colorScheme.background,
child: DidvanText( child: DidvanText(
'دسته‌بندی‌های کلان', 'دسته‌بندی‌های کلان',
@ -97,7 +98,8 @@ class _NewStatisticState extends State<NewStatistic> {
itemsInStatics(context, state, 1, DidvanIcons.currency_solid), itemsInStatics(context, state, 1, DidvanIcons.currency_solid),
itemsInStatics(context, state, 2, DidvanIcons.bitcoin_solid), itemsInStatics(context, state, 2, DidvanIcons.bitcoin_solid),
itemsInStatics(context, state, 3, DidvanIcons.metal_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, itemsInStatics(context, state, 5, DidvanIcons.industry_solid,
hasDivider: false), hasDivider: false),
const SizedBox( const SizedBox(

View File

@ -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. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.0.3+5000 version: 4.0.1+6000
environment: environment:
sdk: ">=2.19.0 <3.0.0" sdk: ">=2.19.0 <3.0.0"