some changes
This commit is contained in:
parent
6bd7c870ea
commit
a5ac5b8c82
|
|
@ -91,7 +91,11 @@ class RouteGenerator {
|
|||
);
|
||||
case Routes.podcasts:
|
||||
return _createRoute(
|
||||
Podcasts(viewPodcasts: settings.arguments as bool?),
|
||||
const Podcasts(viewPodcasts: true),
|
||||
);
|
||||
case Routes.videocasts:
|
||||
return _createRoute(
|
||||
const Podcasts(),
|
||||
);
|
||||
case Routes.radars:
|
||||
return _createRoute(
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ class Routes {
|
|||
static const String radars = '/radars';
|
||||
static const String news = '/news';
|
||||
static const String podcasts = '/podcasts';
|
||||
static const String videocasts = '/videocasts';
|
||||
static const String aboutUs = '/about-us';
|
||||
static const String authenticaion = '/authentication';
|
||||
static const String profile = '/profile';
|
||||
|
|
|
|||
|
|
@ -185,12 +185,12 @@ class HomeState extends CoreProvier {
|
|||
MenuItemType(
|
||||
label: 'ویدئوکست',
|
||||
asset: Assets.videocast,
|
||||
link: Routes.podcasts,
|
||||
link: Routes.videocasts,
|
||||
),
|
||||
MenuItemType(
|
||||
label: 'پادکست',
|
||||
asset: Assets.podcast,
|
||||
link: '${Routes.podcasts}/audio',
|
||||
link: Routes.podcasts,
|
||||
),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,16 @@ class _MainPageSection extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
int _maxSublistCount() {
|
||||
int max = 1;
|
||||
for (var i = 0; i < list.contents.length; i++) {
|
||||
if (list.contents[i].subtitles.length > max) {
|
||||
max = list.contents[i].subtitles.length;
|
||||
}
|
||||
}
|
||||
return max - 1;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final icon = _generateIcon();
|
||||
|
|
@ -136,7 +146,8 @@ class _MainPageSection extends StatelessWidget {
|
|||
),
|
||||
if (list.type != 'podcast')
|
||||
DidvanSlider(
|
||||
height: 260,
|
||||
height: 260 +
|
||||
(_maxSublistCount() - (list.type == 'radar' ? 1 : 0)) * 20,
|
||||
itemCount: list.contents.length,
|
||||
viewportFraction: 0.65,
|
||||
itemBuilder: (context, index, realIndex) => Padding(
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ class MainPageState extends CoreProvier {
|
|||
{
|
||||
link = Routes.studioDetails;
|
||||
args = {
|
||||
type: 'podcast',
|
||||
id: 'id',
|
||||
'type': 'podcast',
|
||||
'id': id,
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/constants/app_icons.dart';
|
||||
import 'package:didvan/models/home_page_content/content.dart';
|
||||
|
|
@ -40,6 +42,11 @@ class _MainPageGeneralItemState extends State<MainPageGeneralItem> {
|
|||
} else {
|
||||
return DidvanIcons.timer_light;
|
||||
}
|
||||
case 'startup':
|
||||
if (index == 0) {
|
||||
return DidvanIcons.location_light;
|
||||
}
|
||||
return DidvanIcons.puzzle_light;
|
||||
default:
|
||||
return DidvanIcons.puzzle_light;
|
||||
}
|
||||
|
|
@ -62,6 +69,7 @@ class _MainPageGeneralItemState extends State<MainPageGeneralItem> {
|
|||
} else {
|
||||
return '${widget.content.subtitles[index]} دقیقه';
|
||||
}
|
||||
case 'startup':
|
||||
default:
|
||||
return widget.content.subtitles[index];
|
||||
}
|
||||
|
|
@ -165,7 +173,13 @@ class _MainPageGeneralItemState extends State<MainPageGeneralItem> {
|
|||
Column(
|
||||
children: [
|
||||
for (int i = 0;
|
||||
i < widget.content.subtitles.length;
|
||||
i <
|
||||
min(
|
||||
widget.content.subtitles.length,
|
||||
widget.type == 'radar'
|
||||
? 2
|
||||
: widget.content.subtitles.length,
|
||||
);
|
||||
i++)
|
||||
_subtitleItem(i, context)
|
||||
],
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ class MainCategories extends StatelessWidget {
|
|||
state.currentPageIndex = 1;
|
||||
state.tabController.animateTo(1);
|
||||
} else {
|
||||
Navigator.of(context).pushNamed(
|
||||
link.contains('audio') ? link.replaceAll('/audio', '') : link,
|
||||
arguments: link.contains('audio') ? true : null,
|
||||
);
|
||||
Navigator.of(context).pushNamed(link);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue