44
55import 'package:_pub_shared/search/search_form.dart' ;
66import 'package:_pub_shared/search/tags.dart' ;
7+ import 'package:pub_dev/frontend/request_context.dart' ;
78
89import '../../../../package/models.dart' ;
910import '../../../../service/youtube/backend.dart' ;
@@ -20,6 +21,7 @@ d.Node landingPageNode({
2021 List <PackageView >? mostPopularPackages,
2122 List <PackageView >? topFlutterPackages,
2223 List <PackageView >? topDartPackages,
24+ List <PackageView >? trendingPackages,
2325 List <PkgOfWeekVideo >? topPoWVideos,
2426}) {
2527 return d.fragment ([
@@ -34,7 +36,23 @@ d.Node landingPageNode({
3436 viewAllEvent: 'landing-flutter-favorites-view-all' ,
3537 viewAllTitle: 'Search Flutter Favorites packages' ,
3638 ),
37- if (_isNotEmptyList (mostPopularPackages))
39+ if (requestContext.experimentalFlags.showTrending &&
40+ _isNotEmptyList (trendingPackages))
41+ _block (
42+ shortId: 'mp' ,
43+ image: d.Image .decorative (
44+ src: staticUrls.getAssetUrl ('/static/img/landing-01.webp' ),
45+ width: 351 ,
46+ height: 240 ,
47+ ),
48+ title: 'Trending packages' ,
49+ info: d.text ('Some of the packages trending in the last 30 days' ),
50+ content: miniListNode ('most-trending' , trendingPackages! ),
51+ viewAllUrl: urls.listingByTrending (),
52+ viewAllEvent: 'landing-trending-view-all' ,
53+ viewAllTitle: 'Search trending packages' ,
54+ )
55+ else if (_isNotEmptyList (mostPopularPackages))
3856 _block (
3957 shortId: 'mp' ,
4058 image: d.Image .decorative (
0 commit comments