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