v 4.0.1
This commit is contained in:
parent
0aec835d8a
commit
d2b16244bf
|
|
@ -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}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -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() + " ثانیه پیش";
|
||||||
|
|
|
||||||
|
|
@ -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,21 +183,21 @@ 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) {
|
||||||
state.goToAi();
|
state.goToAi();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
// For all other tabs (home, categories, statistics), show LogoAppBar
|
||||||
|
return const LogoAppBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -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(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
@ -363,4 +365,4 @@ class StatHeader extends StatelessWidget {
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue