From 5ba60747a8a99c17d047a637ba2013d15f6239d0 Mon Sep 17 00:00:00 2001 From: efrilm Date: Thu, 1 Oct 2026 02:26:43 +0700 Subject: [PATCH] EnakNews: halaman berita dan detail berita - Filter kategori, berita utama, dan daftar artikel terbaru - Detail artikel dengan sampul, penulis, isi, dan "Baca juga" - Data contoh 8 artikel; artikel tips mengikuti aturan di docs - Jumlah pada AppFilterChip kini opsional Co-Authored-By: Claude Opus 5.5 --- .../components/chip/app_filter_chip.dart | 42 +- .../delegate/filter_bar_delegate.dart | 8 +- .../pages/home/widgets/service_section.dart | 5 +- lib/presentation/pages/news/news_page.dart | 135 ++++ lib/presentation/pages/news/news_ui.dart | 111 +++ .../pages/news_detail/news_detail_page.dart | 269 +++++++ .../news/widgets/news_headline_card.dart | 78 ++ .../pages/news/widgets/news_list_tile.dart | 69 ++ lib/presentation/router/app_router.dart | 4 + lib/presentation/router/app_router.gr.dart | 669 ++++++++++-------- lib/sample/news_sample_data.dart | 187 +++++ 11 files changed, 1251 insertions(+), 326 deletions(-) create mode 100644 lib/presentation/pages/news/news_page.dart create mode 100644 lib/presentation/pages/news/news_ui.dart create mode 100644 lib/presentation/pages/news/pages/news_detail/news_detail_page.dart create mode 100644 lib/presentation/pages/news/widgets/news_headline_card.dart create mode 100644 lib/presentation/pages/news/widgets/news_list_tile.dart create mode 100644 lib/sample/news_sample_data.dart diff --git a/lib/presentation/components/chip/app_filter_chip.dart b/lib/presentation/components/chip/app_filter_chip.dart index c16755a..f3ac1a0 100644 --- a/lib/presentation/components/chip/app_filter_chip.dart +++ b/lib/presentation/components/chip/app_filter_chip.dart @@ -2,18 +2,19 @@ import 'package:flutter/material.dart'; import '../../../common/theme/theme.dart'; -/// Chip filter berbentuk pil dengan jumlah item di sebelah label. +/// Chip filter berbentuk pil, dengan jumlah item di sebelah label bila +/// [count] diisi. class AppFilterChip extends StatelessWidget { const AppFilterChip({ super.key, required this.label, - required this.count, + this.count, required this.isSelected, required this.onTap, }); final String label; - final int count; + final int? count; final bool isSelected; final VoidCallback onTap; @@ -43,23 +44,28 @@ class AppFilterChip extends StatelessWidget { fontWeight: FontWeight.w600, ), ), - const SizedBox(width: 6), - Container( - padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1), - decoration: BoxDecoration( - color: isSelected - ? AppColor.white.withOpacity(0.2) - : AppColor.primary.withOpacity(0.08), - borderRadius: BorderRadius.circular(10), - ), - child: Text( - '$count', - style: AppStyle.xs.copyWith( - color: isSelected ? AppColor.textWhite : AppColor.primary, - fontWeight: FontWeight.w700, + if (count != null) ...[ + const SizedBox(width: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 1, + ), + decoration: BoxDecoration( + color: isSelected + ? AppColor.white.withOpacity(0.2) + : AppColor.primary.withOpacity(0.08), + borderRadius: BorderRadius.circular(10), + ), + child: Text( + '$count', + style: AppStyle.xs.copyWith( + color: isSelected ? AppColor.textWhite : AppColor.primary, + fontWeight: FontWeight.w700, + ), ), ), - ), + ], ], ), ), diff --git a/lib/presentation/components/delegate/filter_bar_delegate.dart b/lib/presentation/components/delegate/filter_bar_delegate.dart index 592dc15..8df9dfb 100644 --- a/lib/presentation/components/delegate/filter_bar_delegate.dart +++ b/lib/presentation/components/delegate/filter_bar_delegate.dart @@ -10,7 +10,7 @@ class FilterBarDelegate extends SliverPersistentHeaderDelegate { required this.values, required this.selected, required this.labelOf, - required this.countOf, + this.countOf, required this.onSelected, this.backgroundColor = AppColor.background, }); @@ -18,7 +18,9 @@ class FilterBarDelegate extends SliverPersistentHeaderDelegate { final List values; final T selected; final String Function(T value) labelOf; - final int Function(T value) countOf; + + /// Kosongkan bila chip tidak perlu menampilkan jumlah. + final int Function(T value)? countOf; final ValueChanged onSelected; final Color backgroundColor; @@ -47,7 +49,7 @@ class FilterBarDelegate extends SliverPersistentHeaderDelegate { final value = values[index]; return AppFilterChip( label: labelOf(value), - count: countOf(value), + count: countOf?.call(value), isSelected: value == selected, onTap: () => onSelected(value), ); diff --git a/lib/presentation/pages/main/pages/home/widgets/service_section.dart b/lib/presentation/pages/main/pages/home/widgets/service_section.dart index 68c1959..5740b8a 100644 --- a/lib/presentation/pages/main/pages/home/widgets/service_section.dart +++ b/lib/presentation/pages/main/pages/home/widgets/service_section.dart @@ -70,10 +70,7 @@ class HomeServiceSection extends StatelessWidget { _HomeMenu( label: 'EnakNews', icon: Assets.icons.enaknewsIcon, - route: ComingSoonRoute( - title: 'EnakNews', - iconPath: Assets.icons.enaknewsIcon.path, - ), + route: const NewsRoute(), ), _HomeMenu( label: 'EnakCommunity', diff --git a/lib/presentation/pages/news/news_page.dart b/lib/presentation/pages/news/news_page.dart new file mode 100644 index 0000000..3b9e505 --- /dev/null +++ b/lib/presentation/pages/news/news_page.dart @@ -0,0 +1,135 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +import '../../../common/theme/theme.dart'; +import '../../../sample/news_sample_data.dart'; +import '../../components/delegate/filter_bar_delegate.dart'; +import '../../router/app_router.gr.dart'; +import 'widgets/news_headline_card.dart'; +import 'widgets/news_list_tile.dart'; + +@RoutePage() +class NewsPage extends StatefulWidget { + const NewsPage({super.key}); + + @override + State createState() => _NewsPageState(); +} + +class _NewsPageState extends State { + /// `null` berarti semua kategori. + static const List _filters = [null, ...NewsCategory.values]; + + NewsCategory? _category; + + /// Terbaru di atas. + final List _articles = newsSamples + ..sort((a, b) => b.publishedAt.compareTo(a.publishedAt)); + + void _open(NewsArticle article) => + context.router.push(NewsDetailRoute(article: article)); + + @override + Widget build(BuildContext context) { + final visible = _articles + .where((a) => _category == null || a.category == _category) + .toList(); + // Berita utama hanya di "Semua"; di kategori lain semua jadi daftar. + final headline = _category == null + ? visible.where((a) => a.isHeadline).firstOrNull + : null; + final rest = visible.where((a) => a != headline).toList(); + + return Scaffold( + backgroundColor: AppColor.background, + appBar: AppBar(title: const Text('EnakNews')), + body: CustomScrollView( + slivers: [ + SliverPersistentHeader( + pinned: true, + delegate: FilterBarDelegate( + values: _filters, + selected: _category, + labelOf: (category) => category?.label ?? 'Semua', + onSelected: (category) => setState(() => _category = category), + ), + ), + if (headline != null) + SliverPadding( + padding: const EdgeInsets.fromLTRB(16, 4, 16, 20), + sliver: SliverToBoxAdapter( + child: NewsHeadlineCard( + article: headline, + onTap: () => _open(headline), + ), + ), + ), + if (visible.isEmpty) + SliverFillRemaining(hasScrollBody: false, child: _buildEmpty()) + else if (rest.isNotEmpty) ...[ + SliverPadding( + padding: const EdgeInsets.fromLTRB(16, 4, 16, 10), + sliver: SliverToBoxAdapter( + child: Text( + _category?.label ?? 'Terbaru', + style: AppStyle.md.copyWith(fontWeight: FontWeight.w700), + ), + ), + ), + SliverPadding( + padding: const EdgeInsets.symmetric(horizontal: 16), + sliver: SliverToBoxAdapter(child: _buildList(rest)), + ), + ], + const SliverToBoxAdapter(child: SizedBox(height: 24)), + ], + ), + ); + } + + Widget _buildList(List articles) { + return Material( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + for (var i = 0; i < articles.length; i++) ...[ + if (i > 0) + const Divider( + height: 1, + indent: 16, + endIndent: 16, + color: AppColor.borderLight, + ), + NewsListTile(article: articles[i], onTap: () => _open(articles[i])), + ], + ], + ), + ); + } + + Widget _buildEmpty() { + return Padding( + padding: const EdgeInsets.fromLTRB(32, 32, 32, 64), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text('📰', style: TextStyle(fontSize: 44)), + const SizedBox(height: 16), + Text( + 'Belum ada berita', + textAlign: TextAlign.center, + style: AppStyle.lg.copyWith(fontWeight: FontWeight.w700), + ), + const SizedBox(height: 6), + Text( + 'Berita terbaru dari outlet akan muncul di sini.', + textAlign: TextAlign.center, + style: AppStyle.sm.copyWith(color: AppColor.textSecondary), + ), + ], + ), + ); + } +} diff --git a/lib/presentation/pages/news/news_ui.dart b/lib/presentation/pages/news/news_ui.dart new file mode 100644 index 0000000..6d11991 --- /dev/null +++ b/lib/presentation/pages/news/news_ui.dart @@ -0,0 +1,111 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +import '../../../common/theme/theme.dart'; +import '../../../sample/news_sample_data.dart'; + +extension NewsCategoryUi on NewsCategory { + Color get color => switch (this) { + NewsCategory.menu => const Color(0xFFD9642A), + NewsCategory.promo => AppColor.primary, + NewsCategory.event => const Color(0xFF7D63C9), + NewsCategory.info => const Color(0xFF3B7BBF), + NewsCategory.tips => const Color(0xFF2F8A5B), + }; + + IconData get icon => switch (this) { + NewsCategory.menu => Icons.restaurant_menu_rounded, + NewsCategory.promo => Icons.local_offer_rounded, + NewsCategory.event => Icons.celebration_rounded, + NewsCategory.info => Icons.campaign_rounded, + NewsCategory.tips => Icons.lightbulb_rounded, + }; +} + +/// "Baru saja" / "5 menit lalu" / "3 jam lalu" / "Kemarin" / "2 hari lalu", +/// lalu tanggal pendek. +String formatNewsTime(DateTime time) { + final diff = DateTime.now().difference(time); + if (diff.inMinutes < 1) return 'Baru saja'; + if (diff.inHours < 1) return '${diff.inMinutes} menit lalu'; + if (diff.inDays < 1) return '${diff.inHours} jam lalu'; + if (diff.inDays == 1) return 'Kemarin'; + if (diff.inDays < 7) return '${diff.inDays} hari lalu'; + return DateFormat('d MMM yyyy', 'id_ID').format(time); +} + +/// "3 jam lalu · 2 menit baca". +String newsMetaLabel(NewsArticle article) => + '${formatNewsTime(article.publishedAt)} · ' + '${article.readMinutes} menit baca'; + +/// Sampul artikel: foto, atau warna kategori dengan ikon bila tidak ada foto. +class NewsCover extends StatelessWidget { + const NewsCover({super.key, required this.article, this.iconSize = 40}); + + final NewsArticle article; + final double iconSize; + + @override + Widget build(BuildContext context) { + final image = article.coverImage; + if (image != null) { + return Image.asset( + image, + fit: BoxFit.cover, + errorBuilder: (_, _, _) => _buildFallback(), + ); + } + return _buildFallback(); + } + + Widget _buildFallback() { + final color = article.category.color; + return DecoratedBox( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [color.withOpacity(0.75), color], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Center( + child: Icon( + article.category.icon, + size: iconSize, + color: AppColor.white.withOpacity(0.9), + ), + ), + ); + } +} + +/// Label kategori berwarna; [onImage] untuk di atas foto sampul. +class NewsCategoryPill extends StatelessWidget { + const NewsCategoryPill({ + super.key, + required this.category, + this.onImage = false, + }); + + final NewsCategory category; + final bool onImage; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: BoxDecoration( + color: onImage ? AppColor.white : category.color.withOpacity(0.1), + borderRadius: BorderRadius.circular(20), + ), + child: Text( + category.label, + style: AppStyle.xs.copyWith( + color: category.color, + fontWeight: FontWeight.w800, + ), + ), + ); + } +} diff --git a/lib/presentation/pages/news/pages/news_detail/news_detail_page.dart b/lib/presentation/pages/news/pages/news_detail/news_detail_page.dart new file mode 100644 index 0000000..8ae419e --- /dev/null +++ b/lib/presentation/pages/news/pages/news_detail/news_detail_page.dart @@ -0,0 +1,269 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +import '../../../../../common/theme/theme.dart'; +import '../../../../../sample/news_sample_data.dart'; +import '../../../../components/assets/assets.gen.dart'; +import '../../../../router/app_router.gr.dart'; +import '../../news_ui.dart'; +import '../../widgets/news_list_tile.dart'; + +@RoutePage() +class NewsDetailPage extends StatefulWidget { + const NewsDetailPage({super.key, required this.article}); + + final NewsArticle article; + + @override + State createState() => _NewsDetailPageState(); +} + +class _NewsDetailPageState extends State { + static const double _expandedHeight = 260; + static const int _relatedCount = 3; + + final _scrollController = ScrollController(); + bool _isCollapsed = false; + + late final List _related = _findRelated(); + + /// Kategori yang sama lebih dulu, lalu yang terbaru. + List _findRelated() { + final current = widget.article; + final others = newsSamples.where((a) => a.id != current.id).toList() + ..sort((a, b) { + final aSame = a.category == current.category; + final bSame = b.category == current.category; + if (aSame != bSame) return aSame ? -1 : 1; + return b.publishedAt.compareTo(a.publishedAt); + }); + return others.take(_relatedCount).toList(); + } + + @override + void initState() { + super.initState(); + _scrollController.addListener(() { + final collapsed = + _scrollController.offset > _expandedHeight - kToolbarHeight - 20; + if (collapsed != _isCollapsed) setState(() => _isCollapsed = collapsed); + }); + } + + @override + void dispose() { + _scrollController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final article = widget.article; + + return Scaffold( + backgroundColor: AppColor.white, + body: CustomScrollView( + controller: _scrollController, + slivers: [ + _buildAppBar(article), + SliverToBoxAdapter(child: _buildBody(article)), + if (_related.isNotEmpty) ...[ + SliverToBoxAdapter( + child: Container( + height: 8, + margin: const EdgeInsets.only(top: 8), + color: AppColor.background, + ), + ), + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.fromLTRB(16, 20, 16, 4), + child: Text( + 'Baca juga', + style: AppStyle.lg.copyWith(fontWeight: FontWeight.w700), + ), + ), + ), + SliverList.separated( + itemCount: _related.length, + separatorBuilder: (_, _) => const Divider( + height: 1, + indent: 16, + endIndent: 16, + color: AppColor.borderLight, + ), + itemBuilder: (context, index) { + final related = _related[index]; + return NewsListTile( + article: related, + onTap: () => + context.router.push(NewsDetailRoute(article: related)), + ); + }, + ), + ], + SliverToBoxAdapter( + child: SizedBox(height: 24 + MediaQuery.paddingOf(context).bottom), + ), + ], + ), + ); + } + + Widget _buildAppBar(NewsArticle article) { + return SliverAppBar( + pinned: true, + expandedHeight: _expandedHeight, + backgroundColor: AppColor.white, + automaticallyImplyLeading: false, + leading: Padding( + padding: const EdgeInsets.only(left: 12), + child: _CircleButton( + icon: Icons.arrow_back_rounded, + onTap: () => context.router.maybePop(), + ), + ), + leadingWidth: 60, + title: AnimatedOpacity( + opacity: _isCollapsed ? 1 : 0, + duration: const Duration(milliseconds: 200), + child: Text(article.category.label), + ), + flexibleSpace: FlexibleSpaceBar( + background: Stack( + fit: StackFit.expand, + children: [ + NewsCover(article: article, iconSize: 72), + DecoratedBox( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [AppColor.black.withOpacity(0.3), Colors.transparent], + ), + ), + ), + ], + ), + ), + // Lengkungan "sheet" di atas foto sampul. + bottom: PreferredSize( + preferredSize: const Size.fromHeight(24), + child: Container( + height: 24, + decoration: const BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.vertical(top: Radius.circular(28)), + ), + ), + ), + ); + } + + Widget _buildBody(NewsArticle article) { + return Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + NewsCategoryPill(category: article.category), + const SizedBox(height: 10), + Text( + article.title, + style: AppStyle.h5.copyWith( + fontWeight: FontWeight.w800, + height: 1.25, + ), + ), + const SizedBox(height: 14), + Row( + children: [ + ClipOval( + child: SizedBox( + width: 32, + height: 32, + // Sudut aset logo berlatar gelap; perbesar supaya yang + // terlihat hanya lingkaran merahnya. + child: Transform.scale( + scale: 1.2, + child: Assets.images.logo.image( + fit: BoxFit.cover, + cacheWidth: (40 * MediaQuery.devicePixelRatioOf(context)) + .round(), + ), + ), + ), + ), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + article.author, + style: AppStyle.sm.copyWith(fontWeight: FontWeight.w700), + ), + Text( + '${DateFormat('d MMMM yyyy', 'id_ID').format(article.publishedAt)}' + ' · ${article.readMinutes} menit baca', + style: AppStyle.xs.copyWith( + color: AppColor.textSecondary, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 16), + const Divider(height: 1, color: AppColor.borderLight), + const SizedBox(height: 16), + Text( + article.summary, + style: AppStyle.lg.copyWith( + fontWeight: FontWeight.w600, + height: 1.5, + ), + ), + for (final paragraph in article.paragraphs) ...[ + const SizedBox(height: 14), + Text( + paragraph, + style: AppStyle.md.copyWith( + color: AppColor.textPrimary.withOpacity(0.85), + height: 1.7, + ), + ), + ], + ], + ), + ); + } +} + +class _CircleButton extends StatelessWidget { + const _CircleButton({required this.icon, required this.onTap}); + + final IconData icon; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return Center( + child: Material( + color: AppColor.white.withOpacity(0.92), + shape: const CircleBorder(), + child: InkWell( + customBorder: const CircleBorder(), + onTap: onTap, + child: SizedBox( + width: 40, + height: 40, + child: Icon(icon, size: 20, color: AppColor.textPrimary), + ), + ), + ), + ); + } +} diff --git a/lib/presentation/pages/news/widgets/news_headline_card.dart b/lib/presentation/pages/news/widgets/news_headline_card.dart new file mode 100644 index 0000000..940f346 --- /dev/null +++ b/lib/presentation/pages/news/widgets/news_headline_card.dart @@ -0,0 +1,78 @@ +import 'package:flutter/material.dart'; + +import '../../../../common/theme/theme.dart'; +import '../../../../sample/news_sample_data.dart'; +import '../news_ui.dart'; + +/// Berita utama: sampul lebar di atas, judul dan ringkasan di bawahnya. +/// +/// Teks tidak ditumpuk di atas foto karena sampul outlet sering berupa +/// banner bertulisan. +class NewsHeadlineCard extends StatelessWidget { + const NewsHeadlineCard({ + super.key, + required this.article, + required this.onTap, + }); + + final NewsArticle article; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return Material( + color: AppColor.white, + borderRadius: BorderRadius.circular(20), + clipBehavior: Clip.antiAlias, + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: 16 / 9, + child: NewsCover(article: article, iconSize: 64), + ), + Padding( + padding: const EdgeInsets.fromLTRB(16, 14, 16, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + NewsCategoryPill(category: article.category), + const SizedBox(height: 8), + Text( + article.title, + maxLines: 3, + overflow: TextOverflow.ellipsis, + style: AppStyle.xl.copyWith( + fontWeight: FontWeight.w800, + height: 1.25, + ), + ), + const SizedBox(height: 6), + Text( + article.summary, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: AppStyle.sm.copyWith( + color: AppColor.textSecondary, + height: 1.4, + ), + ), + const SizedBox(height: 10), + Text( + newsMetaLabel(article), + style: AppStyle.xs.copyWith( + color: AppColor.textSecondary, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/presentation/pages/news/widgets/news_list_tile.dart b/lib/presentation/pages/news/widgets/news_list_tile.dart new file mode 100644 index 0000000..45b840a --- /dev/null +++ b/lib/presentation/pages/news/widgets/news_list_tile.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; + +import '../../../../common/theme/theme.dart'; +import '../../../../sample/news_sample_data.dart'; +import '../news_ui.dart'; + +/// Baris artikel: kategori, judul, dan waktu di kiri, sampul kecil di kanan. +class NewsListTile extends StatelessWidget { + const NewsListTile({super.key, required this.article, required this.onTap}); + + final NewsArticle article; + final VoidCallback onTap; + + static const double _thumbSize = 88; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + article.category.label.toUpperCase(), + style: AppStyle.xs.copyWith( + color: article.category.color, + fontWeight: FontWeight.w800, + letterSpacing: 0.4, + ), + ), + const SizedBox(height: 4), + Text( + article.title, + maxLines: 3, + overflow: TextOverflow.ellipsis, + style: AppStyle.md.copyWith( + fontWeight: FontWeight.w700, + height: 1.3, + ), + ), + const SizedBox(height: 6), + Text( + newsMetaLabel(article), + style: AppStyle.xs.copyWith(color: AppColor.textSecondary), + ), + ], + ), + ), + const SizedBox(width: 12), + ClipRRect( + borderRadius: BorderRadius.circular(12), + child: SizedBox( + width: _thumbSize, + height: _thumbSize, + child: NewsCover(article: article, iconSize: 32), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/presentation/router/app_router.dart b/lib/presentation/router/app_router.dart index bda0db9..0727037 100644 --- a/lib/presentation/router/app_router.dart +++ b/lib/presentation/router/app_router.dart @@ -87,6 +87,10 @@ class AppRouter extends RootStackRouter { AutoRoute(page: PromoRoute.page), AutoRoute(page: PromoDetailRoute.page), + // News + AutoRoute(page: NewsRoute.page), + AutoRoute(page: NewsDetailRoute.page), + // Account AutoRoute(page: AccountMyRoute.page), AutoRoute(page: AddressRoute.page), diff --git a/lib/presentation/router/app_router.gr.dart b/lib/presentation/router/app_router.gr.dart index c0032a9..e641ecf 100644 --- a/lib/presentation/router/app_router.gr.dart +++ b/lib/presentation/router/app_router.gr.dart @@ -10,28 +10,28 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i52; -import 'package:enaklo/domain/wallet/wallet.dart' as _i56; +import 'package:auto_route/auto_route.dart' as _i54; +import 'package:enaklo/domain/wallet/wallet.dart' as _i59; import 'package:enaklo/presentation/pages/account/account_my/account_my_page.dart' as _i1; import 'package:enaklo/presentation/pages/account/address/address_page.dart' as _i2; import 'package:enaklo/presentation/pages/account/payment/payment_page.dart' - as _i32; + as _i34; import 'package:enaklo/presentation/pages/auth/create_password/create_password_page.dart' as _i9; import 'package:enaklo/presentation/pages/auth/login/login_page.dart' as _i19; -import 'package:enaklo/presentation/pages/auth/otp/otp_page.dart' as _i28; +import 'package:enaklo/presentation/pages/auth/otp/otp_page.dart' as _i30; import 'package:enaklo/presentation/pages/auth/password/password_page.dart' - as _i30; -import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i34; + as _i32; +import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i36; import 'package:enaklo/presentation/pages/auth/register/register_page.dart' - as _i42; + as _i44; import 'package:enaklo/presentation/pages/coin/coin_page.dart' as _i4; import 'package:enaklo/presentation/pages/coin/pages/coin_history_page.dart' as _i3; import 'package:enaklo/presentation/pages/coin/pages/product_redeem/product_redeem_page.dart' - as _i38; + as _i40; import 'package:enaklo/presentation/pages/coming_soon/coming_soon_page.dart' as _i5; import 'package:enaklo/presentation/pages/community/community_page.dart' as _i7; @@ -54,11 +54,11 @@ import 'package:enaklo/presentation/pages/main/main_page.dart' as _i20; import 'package:enaklo/presentation/pages/main/pages/home/home_page.dart' as _i18; import 'package:enaklo/presentation/pages/main/pages/order/order_page.dart' - as _i27; + as _i29; import 'package:enaklo/presentation/pages/main/pages/profile/profile_page.dart' - as _i39; + as _i41; import 'package:enaklo/presentation/pages/main/pages/voucher/voucher_page.dart' - as _i47; + as _i49; import 'package:enaklo/presentation/pages/merchant/merchant_page.dart' as _i22; import 'package:enaklo/presentation/pages/merchant/pages/merchant_detail/merchant_detail_page.dart' as _i21; @@ -66,48 +66,52 @@ import 'package:enaklo/presentation/pages/mini_games/ferris_wheel/ferris_wheel_p as _i17; import 'package:enaklo/presentation/pages/mini_games/mistery_box/mistery_box_page.dart' as _i23; -import 'package:enaklo/presentation/pages/notification/notification_page.dart' +import 'package:enaklo/presentation/pages/news/news_page.dart' as _i25; +import 'package:enaklo/presentation/pages/news/pages/news_detail/news_detail_page.dart' as _i24; -import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart' - as _i25; -import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart' +import 'package:enaklo/presentation/pages/notification/notification_page.dart' as _i26; -import 'package:enaklo/presentation/pages/outlet/outlet_page.dart' as _i29; -import 'package:enaklo/presentation/pages/pin/pin_change_page.dart' as _i33; -import 'package:enaklo/presentation/pages/pin/pin_settings_page.dart' as _i35; -import 'package:enaklo/presentation/pages/pin/pin_setup_page.dart' as _i36; -import 'package:enaklo/presentation/pages/point/point_page.dart' as _i37; +import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart' + as _i27; +import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart' + as _i28; +import 'package:enaklo/presentation/pages/outlet/outlet_page.dart' as _i31; +import 'package:enaklo/presentation/pages/pin/pin_change_page.dart' as _i35; +import 'package:enaklo/presentation/pages/pin/pin_settings_page.dart' as _i37; +import 'package:enaklo/presentation/pages/pin/pin_setup_page.dart' as _i38; +import 'package:enaklo/presentation/pages/point/point_page.dart' as _i39; import 'package:enaklo/presentation/pages/promo/pages/promo_detail/promo_detail_page.dart' - as _i40; -import 'package:enaklo/presentation/pages/promo/promo_page.dart' as _i41; -import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i43; -import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i44; + as _i42; +import 'package:enaklo/presentation/pages/promo/promo_page.dart' as _i43; +import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i45; +import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i46; import 'package:enaklo/presentation/pages/voucher/voucher_detail/voucher_detail_page.dart' - as _i46; + as _i48; import 'package:enaklo/presentation/pages/wallet/exchange_page.dart' as _i16; import 'package:enaklo/presentation/pages/wallet/payment_code_page.dart' - as _i31; -import 'package:enaklo/presentation/pages/wallet/transfer_page.dart' as _i45; + as _i33; +import 'package:enaklo/presentation/pages/wallet/transfer_page.dart' as _i47; import 'package:enaklo/presentation/pages/wallet/wallet_expiring_page.dart' - as _i48; + as _i50; import 'package:enaklo/presentation/pages/wallet/wallet_history_page.dart' - as _i49; -import 'package:enaklo/presentation/pages/wallet/wallet_page.dart' as _i50; -import 'package:enaklo/presentation/pages/webview/webview_page.dart' as _i51; -import 'package:enaklo/sample/community_sample_data.dart' as _i54; -import 'package:enaklo/sample/promo_sample_data.dart' as _i57; -import 'package:enaklo/sample/sample_data.dart' as _i55; -import 'package:flutter/material.dart' as _i53; + as _i51; +import 'package:enaklo/presentation/pages/wallet/wallet_page.dart' as _i52; +import 'package:enaklo/presentation/pages/webview/webview_page.dart' as _i53; +import 'package:enaklo/sample/community_sample_data.dart' as _i56; +import 'package:enaklo/sample/news_sample_data.dart' as _i58; +import 'package:enaklo/sample/promo_sample_data.dart' as _i60; +import 'package:enaklo/sample/sample_data.dart' as _i57; +import 'package:flutter/material.dart' as _i55; /// generated route for /// [_i1.AccountMyPage] -class AccountMyRoute extends _i52.PageRouteInfo { - const AccountMyRoute({List<_i52.PageRouteInfo>? children}) +class AccountMyRoute extends _i54.PageRouteInfo { + const AccountMyRoute({List<_i54.PageRouteInfo>? children}) : super(AccountMyRoute.name, initialChildren: children); static const String name = 'AccountMyRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i1.AccountMyPage(); @@ -117,13 +121,13 @@ class AccountMyRoute extends _i52.PageRouteInfo { /// generated route for /// [_i2.AddressPage] -class AddressRoute extends _i52.PageRouteInfo { - const AddressRoute({List<_i52.PageRouteInfo>? children}) +class AddressRoute extends _i54.PageRouteInfo { + const AddressRoute({List<_i54.PageRouteInfo>? children}) : super(AddressRoute.name, initialChildren: children); static const String name = 'AddressRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i2.AddressPage(); @@ -133,13 +137,13 @@ class AddressRoute extends _i52.PageRouteInfo { /// generated route for /// [_i3.CoinHistoryPage] -class CoinHistoryRoute extends _i52.PageRouteInfo { - const CoinHistoryRoute({List<_i52.PageRouteInfo>? children}) +class CoinHistoryRoute extends _i54.PageRouteInfo { + const CoinHistoryRoute({List<_i54.PageRouteInfo>? children}) : super(CoinHistoryRoute.name, initialChildren: children); static const String name = 'CoinHistoryRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i3.CoinHistoryPage(); @@ -149,13 +153,13 @@ class CoinHistoryRoute extends _i52.PageRouteInfo { /// generated route for /// [_i4.CoinPage] -class CoinRoute extends _i52.PageRouteInfo { - const CoinRoute({List<_i52.PageRouteInfo>? children}) +class CoinRoute extends _i54.PageRouteInfo { + const CoinRoute({List<_i54.PageRouteInfo>? children}) : super(CoinRoute.name, initialChildren: children); static const String name = 'CoinRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i4.CoinPage(); @@ -165,12 +169,12 @@ class CoinRoute extends _i52.PageRouteInfo { /// generated route for /// [_i5.ComingSoonPage] -class ComingSoonRoute extends _i52.PageRouteInfo { +class ComingSoonRoute extends _i54.PageRouteInfo { ComingSoonRoute({ - _i53.Key? key, + _i55.Key? key, required String title, String? iconPath, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( ComingSoonRoute.name, args: ComingSoonRouteArgs(key: key, title: title, iconPath: iconPath), @@ -179,7 +183,7 @@ class ComingSoonRoute extends _i52.PageRouteInfo { static const String name = 'ComingSoonRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -195,7 +199,7 @@ class ComingSoonRoute extends _i52.PageRouteInfo { class ComingSoonRouteArgs { const ComingSoonRouteArgs({this.key, required this.title, this.iconPath}); - final _i53.Key? key; + final _i55.Key? key; final String title; @@ -222,11 +226,11 @@ class ComingSoonRouteArgs { /// generated route for /// [_i6.CommunityDetailPage] class CommunityDetailRoute - extends _i52.PageRouteInfo { + extends _i54.PageRouteInfo { CommunityDetailRoute({ - _i53.Key? key, - required _i54.CommunityGroup group, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + required _i56.CommunityGroup group, + List<_i54.PageRouteInfo>? children, }) : super( CommunityDetailRoute.name, args: CommunityDetailRouteArgs(key: key, group: group), @@ -235,7 +239,7 @@ class CommunityDetailRoute static const String name = 'CommunityDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -247,9 +251,9 @@ class CommunityDetailRoute class CommunityDetailRouteArgs { const CommunityDetailRouteArgs({this.key, required this.group}); - final _i53.Key? key; + final _i55.Key? key; - final _i54.CommunityGroup group; + final _i56.CommunityGroup group; @override String toString() { @@ -269,13 +273,13 @@ class CommunityDetailRouteArgs { /// generated route for /// [_i7.CommunityPage] -class CommunityRoute extends _i52.PageRouteInfo { - const CommunityRoute({List<_i52.PageRouteInfo>? children}) +class CommunityRoute extends _i54.PageRouteInfo { + const CommunityRoute({List<_i54.PageRouteInfo>? children}) : super(CommunityRoute.name, initialChildren: children); static const String name = 'CommunityRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i7.CommunityPage(); @@ -286,11 +290,11 @@ class CommunityRoute extends _i52.PageRouteInfo { /// generated route for /// [_i8.CommunityPostDetailPage] class CommunityPostDetailRoute - extends _i52.PageRouteInfo { + extends _i54.PageRouteInfo { CommunityPostDetailRoute({ - _i53.Key? key, - required _i54.CommunityPost post, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + required _i56.CommunityPost post, + List<_i54.PageRouteInfo>? children, }) : super( CommunityPostDetailRoute.name, args: CommunityPostDetailRouteArgs(key: key, post: post), @@ -299,7 +303,7 @@ class CommunityPostDetailRoute static const String name = 'CommunityPostDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -311,9 +315,9 @@ class CommunityPostDetailRoute class CommunityPostDetailRouteArgs { const CommunityPostDetailRouteArgs({this.key, required this.post}); - final _i53.Key? key; + final _i55.Key? key; - final _i54.CommunityPost post; + final _i56.CommunityPost post; @override String toString() { @@ -333,11 +337,11 @@ class CommunityPostDetailRouteArgs { /// generated route for /// [_i9.CreatePasswordPage] -class CreatePasswordRoute extends _i52.PageRouteInfo { +class CreatePasswordRoute extends _i54.PageRouteInfo { CreatePasswordRoute({ - _i53.Key? key, + _i55.Key? key, required String registrationToken, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( CreatePasswordRoute.name, args: CreatePasswordRouteArgs( @@ -349,11 +353,11 @@ class CreatePasswordRoute extends _i52.PageRouteInfo { static const String name = 'CreatePasswordRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i52.WrappedRoute( + return _i54.WrappedRoute( child: _i9.CreatePasswordPage( key: args.key, registrationToken: args.registrationToken, @@ -366,7 +370,7 @@ class CreatePasswordRoute extends _i52.PageRouteInfo { class CreatePasswordRouteArgs { const CreatePasswordRouteArgs({this.key, required this.registrationToken}); - final _i53.Key? key; + final _i55.Key? key; final String registrationToken; @@ -388,13 +392,13 @@ class CreatePasswordRouteArgs { /// generated route for /// [_i10.DrawDetailPage] -class DrawDetailRoute extends _i52.PageRouteInfo { - const DrawDetailRoute({List<_i52.PageRouteInfo>? children}) +class DrawDetailRoute extends _i54.PageRouteInfo { + const DrawDetailRoute({List<_i54.PageRouteInfo>? children}) : super(DrawDetailRoute.name, initialChildren: children); static const String name = 'DrawDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i10.DrawDetailPage(); @@ -404,13 +408,13 @@ class DrawDetailRoute extends _i52.PageRouteInfo { /// generated route for /// [_i11.DrawInfoPage] -class DrawInfoRoute extends _i52.PageRouteInfo { - const DrawInfoRoute({List<_i52.PageRouteInfo>? children}) +class DrawInfoRoute extends _i54.PageRouteInfo { + const DrawInfoRoute({List<_i54.PageRouteInfo>? children}) : super(DrawInfoRoute.name, initialChildren: children); static const String name = 'DrawInfoRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i11.DrawInfoPage(); @@ -420,13 +424,13 @@ class DrawInfoRoute extends _i52.PageRouteInfo { /// generated route for /// [_i12.DrawMyNumberPage] -class DrawMyNumberRoute extends _i52.PageRouteInfo { - const DrawMyNumberRoute({List<_i52.PageRouteInfo>? children}) +class DrawMyNumberRoute extends _i54.PageRouteInfo { + const DrawMyNumberRoute({List<_i54.PageRouteInfo>? children}) : super(DrawMyNumberRoute.name, initialChildren: children); static const String name = 'DrawMyNumberRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i12.DrawMyNumberPage(); @@ -436,13 +440,13 @@ class DrawMyNumberRoute extends _i52.PageRouteInfo { /// generated route for /// [_i13.DrawPage] -class DrawRoute extends _i52.PageRouteInfo { - const DrawRoute({List<_i52.PageRouteInfo>? children}) +class DrawRoute extends _i54.PageRouteInfo { + const DrawRoute({List<_i54.PageRouteInfo>? children}) : super(DrawRoute.name, initialChildren: children); static const String name = 'DrawRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i13.DrawPage(); @@ -452,13 +456,13 @@ class DrawRoute extends _i52.PageRouteInfo { /// generated route for /// [_i14.DrawTodayPage] -class DrawTodayRoute extends _i52.PageRouteInfo { - const DrawTodayRoute({List<_i52.PageRouteInfo>? children}) +class DrawTodayRoute extends _i54.PageRouteInfo { + const DrawTodayRoute({List<_i54.PageRouteInfo>? children}) : super(DrawTodayRoute.name, initialChildren: children); static const String name = 'DrawTodayRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i14.DrawTodayPage(); @@ -468,13 +472,13 @@ class DrawTodayRoute extends _i52.PageRouteInfo { /// generated route for /// [_i15.DrawWinnerPage] -class DrawWinnerRoute extends _i52.PageRouteInfo { - const DrawWinnerRoute({List<_i52.PageRouteInfo>? children}) +class DrawWinnerRoute extends _i54.PageRouteInfo { + const DrawWinnerRoute({List<_i54.PageRouteInfo>? children}) : super(DrawWinnerRoute.name, initialChildren: children); static const String name = 'DrawWinnerRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i15.DrawWinnerPage(); @@ -484,45 +488,45 @@ class DrawWinnerRoute extends _i52.PageRouteInfo { /// generated route for /// [_i16.ExchangePage] -class ExchangeRoute extends _i52.PageRouteInfo { - const ExchangeRoute({List<_i52.PageRouteInfo>? children}) +class ExchangeRoute extends _i54.PageRouteInfo { + const ExchangeRoute({List<_i54.PageRouteInfo>? children}) : super(ExchangeRoute.name, initialChildren: children); static const String name = 'ExchangeRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i16.ExchangePage()); + return _i54.WrappedRoute(child: const _i16.ExchangePage()); }, ); } /// generated route for /// [_i17.FerrisWheelPage] -class FerrisWheelRoute extends _i52.PageRouteInfo { - const FerrisWheelRoute({List<_i52.PageRouteInfo>? children}) +class FerrisWheelRoute extends _i54.PageRouteInfo { + const FerrisWheelRoute({List<_i54.PageRouteInfo>? children}) : super(FerrisWheelRoute.name, initialChildren: children); static const String name = 'FerrisWheelRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i17.FerrisWheelPage()); + return _i54.WrappedRoute(child: const _i17.FerrisWheelPage()); }, ); } /// generated route for /// [_i18.HomePage] -class HomeRoute extends _i52.PageRouteInfo { - const HomeRoute({List<_i52.PageRouteInfo>? children}) +class HomeRoute extends _i54.PageRouteInfo { + const HomeRoute({List<_i54.PageRouteInfo>? children}) : super(HomeRoute.name, initialChildren: children); static const String name = 'HomeRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i18.HomePage(); @@ -532,29 +536,29 @@ class HomeRoute extends _i52.PageRouteInfo { /// generated route for /// [_i19.LoginPage] -class LoginRoute extends _i52.PageRouteInfo { - const LoginRoute({List<_i52.PageRouteInfo>? children}) +class LoginRoute extends _i54.PageRouteInfo { + const LoginRoute({List<_i54.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i19.LoginPage()); + return _i54.WrappedRoute(child: const _i19.LoginPage()); }, ); } /// generated route for /// [_i20.MainPage] -class MainRoute extends _i52.PageRouteInfo { - const MainRoute({List<_i52.PageRouteInfo>? children}) +class MainRoute extends _i54.PageRouteInfo { + const MainRoute({List<_i54.PageRouteInfo>? children}) : super(MainRoute.name, initialChildren: children); static const String name = 'MainRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i20.MainPage(); @@ -564,11 +568,11 @@ class MainRoute extends _i52.PageRouteInfo { /// generated route for /// [_i21.MerchantDetailPage] -class MerchantDetailRoute extends _i52.PageRouteInfo { +class MerchantDetailRoute extends _i54.PageRouteInfo { MerchantDetailRoute({ - _i53.Key? key, - required _i55.MerchantModel merchant, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + required _i57.MerchantModel merchant, + List<_i54.PageRouteInfo>? children, }) : super( MerchantDetailRoute.name, args: MerchantDetailRouteArgs(key: key, merchant: merchant), @@ -577,7 +581,7 @@ class MerchantDetailRoute extends _i52.PageRouteInfo { static const String name = 'MerchantDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -589,9 +593,9 @@ class MerchantDetailRoute extends _i52.PageRouteInfo { class MerchantDetailRouteArgs { const MerchantDetailRouteArgs({this.key, required this.merchant}); - final _i53.Key? key; + final _i55.Key? key; - final _i55.MerchantModel merchant; + final _i57.MerchantModel merchant; @override String toString() { @@ -611,13 +615,13 @@ class MerchantDetailRouteArgs { /// generated route for /// [_i22.MerchantPage] -class MerchantRoute extends _i52.PageRouteInfo { - const MerchantRoute({List<_i52.PageRouteInfo>? children}) +class MerchantRoute extends _i54.PageRouteInfo { + const MerchantRoute({List<_i54.PageRouteInfo>? children}) : super(MerchantRoute.name, initialChildren: children); static const String name = 'MerchantRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i22.MerchantPage(); @@ -627,13 +631,13 @@ class MerchantRoute extends _i52.PageRouteInfo { /// generated route for /// [_i23.MisteryBoxPage] -class MisteryBoxRoute extends _i52.PageRouteInfo { - const MisteryBoxRoute({List<_i52.PageRouteInfo>? children}) +class MisteryBoxRoute extends _i54.PageRouteInfo { + const MisteryBoxRoute({List<_i54.PageRouteInfo>? children}) : super(MisteryBoxRoute.name, initialChildren: children); static const String name = 'MisteryBoxRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { return const _i23.MisteryBoxPage(); @@ -642,44 +646,107 @@ class MisteryBoxRoute extends _i52.PageRouteInfo { } /// generated route for -/// [_i24.NotificationPage] -class NotificationRoute extends _i52.PageRouteInfo { - const NotificationRoute({List<_i52.PageRouteInfo>? children}) +/// [_i24.NewsDetailPage] +class NewsDetailRoute extends _i54.PageRouteInfo { + NewsDetailRoute({ + _i55.Key? key, + required _i58.NewsArticle article, + List<_i54.PageRouteInfo>? children, + }) : super( + NewsDetailRoute.name, + args: NewsDetailRouteArgs(key: key, article: article), + initialChildren: children, + ); + + static const String name = 'NewsDetailRoute'; + + static _i54.PageInfo page = _i54.PageInfo( + name, + builder: (data) { + final args = data.argsAs(); + return _i24.NewsDetailPage(key: args.key, article: args.article); + }, + ); +} + +class NewsDetailRouteArgs { + const NewsDetailRouteArgs({this.key, required this.article}); + + final _i55.Key? key; + + final _i58.NewsArticle article; + + @override + String toString() { + return 'NewsDetailRouteArgs{key: $key, article: $article}'; + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (other is! NewsDetailRouteArgs) return false; + return key == other.key && article == other.article; + } + + @override + int get hashCode => key.hashCode ^ article.hashCode; +} + +/// generated route for +/// [_i25.NewsPage] +class NewsRoute extends _i54.PageRouteInfo { + const NewsRoute({List<_i54.PageRouteInfo>? children}) + : super(NewsRoute.name, initialChildren: children); + + static const String name = 'NewsRoute'; + + static _i54.PageInfo page = _i54.PageInfo( + name, + builder: (data) { + return const _i25.NewsPage(); + }, + ); +} + +/// generated route for +/// [_i26.NotificationPage] +class NotificationRoute extends _i54.PageRouteInfo { + const NotificationRoute({List<_i54.PageRouteInfo>? children}) : super(NotificationRoute.name, initialChildren: children); static const String name = 'NotificationRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i24.NotificationPage(); + return const _i26.NotificationPage(); }, ); } /// generated route for -/// [_i25.OnboardingPage] -class OnboardingRoute extends _i52.PageRouteInfo { - const OnboardingRoute({List<_i52.PageRouteInfo>? children}) +/// [_i27.OnboardingPage] +class OnboardingRoute extends _i54.PageRouteInfo { + const OnboardingRoute({List<_i54.PageRouteInfo>? children}) : super(OnboardingRoute.name, initialChildren: children); static const String name = 'OnboardingRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i25.OnboardingPage(); + return const _i27.OnboardingPage(); }, ); } /// generated route for -/// [_i26.OrderDetailPage] -class OrderDetailRoute extends _i52.PageRouteInfo { +/// [_i28.OrderDetailPage] +class OrderDetailRoute extends _i54.PageRouteInfo { OrderDetailRoute({ - _i53.Key? key, - required _i56.CustomerOrder order, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + required _i59.CustomerOrder order, + List<_i54.PageRouteInfo>? children, }) : super( OrderDetailRoute.name, args: OrderDetailRouteArgs(key: key, order: order), @@ -688,12 +755,12 @@ class OrderDetailRoute extends _i52.PageRouteInfo { static const String name = 'OrderDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i52.WrappedRoute( - child: _i26.OrderDetailPage(key: args.key, order: args.order), + return _i54.WrappedRoute( + child: _i28.OrderDetailPage(key: args.key, order: args.order), ); }, ); @@ -702,9 +769,9 @@ class OrderDetailRoute extends _i52.PageRouteInfo { class OrderDetailRouteArgs { const OrderDetailRouteArgs({this.key, required this.order}); - final _i53.Key? key; + final _i55.Key? key; - final _i56.CustomerOrder order; + final _i59.CustomerOrder order; @override String toString() { @@ -723,29 +790,29 @@ class OrderDetailRouteArgs { } /// generated route for -/// [_i27.OrderPage] -class OrderRoute extends _i52.PageRouteInfo { - const OrderRoute({List<_i52.PageRouteInfo>? children}) +/// [_i29.OrderPage] +class OrderRoute extends _i54.PageRouteInfo { + const OrderRoute({List<_i54.PageRouteInfo>? children}) : super(OrderRoute.name, initialChildren: children); static const String name = 'OrderRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i27.OrderPage()); + return _i54.WrappedRoute(child: const _i29.OrderPage()); }, ); } /// generated route for -/// [_i28.OtpPage] -class OtpRoute extends _i52.PageRouteInfo { +/// [_i30.OtpPage] +class OtpRoute extends _i54.PageRouteInfo { OtpRoute({ - _i53.Key? key, + _i55.Key? key, required String registrationToken, required String phoneNumber, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( OtpRoute.name, args: OtpRouteArgs( @@ -758,12 +825,12 @@ class OtpRoute extends _i52.PageRouteInfo { static const String name = 'OtpRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i52.WrappedRoute( - child: _i28.OtpPage( + return _i54.WrappedRoute( + child: _i30.OtpPage( key: args.key, registrationToken: args.registrationToken, phoneNumber: args.phoneNumber, @@ -780,7 +847,7 @@ class OtpRouteArgs { required this.phoneNumber, }); - final _i53.Key? key; + final _i55.Key? key; final String registrationToken; @@ -806,28 +873,28 @@ class OtpRouteArgs { } /// generated route for -/// [_i29.OutletPage] -class OutletRoute extends _i52.PageRouteInfo { - const OutletRoute({List<_i52.PageRouteInfo>? children}) +/// [_i31.OutletPage] +class OutletRoute extends _i54.PageRouteInfo { + const OutletRoute({List<_i54.PageRouteInfo>? children}) : super(OutletRoute.name, initialChildren: children); static const String name = 'OutletRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i29.OutletPage(); + return const _i31.OutletPage(); }, ); } /// generated route for -/// [_i30.PasswordPage] -class PasswordRoute extends _i52.PageRouteInfo { +/// [_i32.PasswordPage] +class PasswordRoute extends _i54.PageRouteInfo { PasswordRoute({ - _i53.Key? key, + _i55.Key? key, required String phoneNumber, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( PasswordRoute.name, args: PasswordRouteArgs(key: key, phoneNumber: phoneNumber), @@ -836,12 +903,12 @@ class PasswordRoute extends _i52.PageRouteInfo { static const String name = 'PasswordRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i52.WrappedRoute( - child: _i30.PasswordPage(key: args.key, phoneNumber: args.phoneNumber), + return _i54.WrappedRoute( + child: _i32.PasswordPage(key: args.key, phoneNumber: args.phoneNumber), ); }, ); @@ -850,7 +917,7 @@ class PasswordRoute extends _i52.PageRouteInfo { class PasswordRouteArgs { const PasswordRouteArgs({this.key, required this.phoneNumber}); - final _i53.Key? key; + final _i55.Key? key; final String phoneNumber; @@ -871,61 +938,61 @@ class PasswordRouteArgs { } /// generated route for -/// [_i31.PaymentCodePage] -class PaymentCodeRoute extends _i52.PageRouteInfo { - const PaymentCodeRoute({List<_i52.PageRouteInfo>? children}) +/// [_i33.PaymentCodePage] +class PaymentCodeRoute extends _i54.PageRouteInfo { + const PaymentCodeRoute({List<_i54.PageRouteInfo>? children}) : super(PaymentCodeRoute.name, initialChildren: children); static const String name = 'PaymentCodeRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i31.PaymentCodePage()); + return _i54.WrappedRoute(child: const _i33.PaymentCodePage()); }, ); } /// generated route for -/// [_i32.PaymentPage] -class PaymentRoute extends _i52.PageRouteInfo { - const PaymentRoute({List<_i52.PageRouteInfo>? children}) +/// [_i34.PaymentPage] +class PaymentRoute extends _i54.PageRouteInfo { + const PaymentRoute({List<_i54.PageRouteInfo>? children}) : super(PaymentRoute.name, initialChildren: children); static const String name = 'PaymentRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i32.PaymentPage(); + return const _i34.PaymentPage(); }, ); } /// generated route for -/// [_i33.PinChangePage] -class PinChangeRoute extends _i52.PageRouteInfo { - const PinChangeRoute({List<_i52.PageRouteInfo>? children}) +/// [_i35.PinChangePage] +class PinChangeRoute extends _i54.PageRouteInfo { + const PinChangeRoute({List<_i54.PageRouteInfo>? children}) : super(PinChangeRoute.name, initialChildren: children); static const String name = 'PinChangeRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i33.PinChangePage()); + return _i54.WrappedRoute(child: const _i35.PinChangePage()); }, ); } /// generated route for -/// [_i34.PinPage] -class PinRoute extends _i52.PageRouteInfo { +/// [_i36.PinPage] +class PinRoute extends _i54.PageRouteInfo { PinRoute({ - _i53.Key? key, + _i55.Key? key, bool isCreatePin = true, String? title, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( PinRoute.name, args: PinRouteArgs(key: key, isCreatePin: isCreatePin, title: title), @@ -934,13 +1001,13 @@ class PinRoute extends _i52.PageRouteInfo { static const String name = 'PinRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const PinRouteArgs(), ); - return _i34.PinPage( + return _i36.PinPage( key: args.key, isCreatePin: args.isCreatePin, title: args.title, @@ -952,7 +1019,7 @@ class PinRoute extends _i52.PageRouteInfo { class PinRouteArgs { const PinRouteArgs({this.key, this.isCreatePin = true, this.title}); - final _i53.Key? key; + final _i55.Key? key; final bool isCreatePin; @@ -977,28 +1044,28 @@ class PinRouteArgs { } /// generated route for -/// [_i35.PinSettingsPage] -class PinSettingsRoute extends _i52.PageRouteInfo { - const PinSettingsRoute({List<_i52.PageRouteInfo>? children}) +/// [_i37.PinSettingsPage] +class PinSettingsRoute extends _i54.PageRouteInfo { + const PinSettingsRoute({List<_i54.PageRouteInfo>? children}) : super(PinSettingsRoute.name, initialChildren: children); static const String name = 'PinSettingsRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i35.PinSettingsPage(); + return const _i37.PinSettingsPage(); }, ); } /// generated route for -/// [_i36.PinSetupPage] -class PinSetupRoute extends _i52.PageRouteInfo { +/// [_i38.PinSetupPage] +class PinSetupRoute extends _i54.PageRouteInfo { PinSetupRoute({ - _i53.Key? key, - required _i56.PinOtpPurpose purpose, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + required _i59.PinOtpPurpose purpose, + List<_i54.PageRouteInfo>? children, }) : super( PinSetupRoute.name, args: PinSetupRouteArgs(key: key, purpose: purpose), @@ -1007,12 +1074,12 @@ class PinSetupRoute extends _i52.PageRouteInfo { static const String name = 'PinSetupRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i52.WrappedRoute( - child: _i36.PinSetupPage(key: args.key, purpose: args.purpose), + return _i54.WrappedRoute( + child: _i38.PinSetupPage(key: args.key, purpose: args.purpose), ); }, ); @@ -1021,9 +1088,9 @@ class PinSetupRoute extends _i52.PageRouteInfo { class PinSetupRouteArgs { const PinSetupRouteArgs({this.key, required this.purpose}); - final _i53.Key? key; + final _i55.Key? key; - final _i56.PinOtpPurpose purpose; + final _i59.PinOtpPurpose purpose; @override String toString() { @@ -1042,29 +1109,29 @@ class PinSetupRouteArgs { } /// generated route for -/// [_i37.PointPage] -class PointRoute extends _i52.PageRouteInfo { - const PointRoute({List<_i52.PageRouteInfo>? children}) +/// [_i39.PointPage] +class PointRoute extends _i54.PageRouteInfo { + const PointRoute({List<_i54.PageRouteInfo>? children}) : super(PointRoute.name, initialChildren: children); static const String name = 'PointRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i37.PointPage(); + return const _i39.PointPage(); }, ); } /// generated route for -/// [_i38.ProductRedeemPage] -class ProductRedeemRoute extends _i52.PageRouteInfo { +/// [_i40.ProductRedeemPage] +class ProductRedeemRoute extends _i54.PageRouteInfo { ProductRedeemRoute({ - _i53.Key? key, + _i55.Key? key, required _i4.Product product, required _i4.PointCard pointCard, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( ProductRedeemRoute.name, args: ProductRedeemRouteArgs( @@ -1077,11 +1144,11 @@ class ProductRedeemRoute extends _i52.PageRouteInfo { static const String name = 'ProductRedeemRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i38.ProductRedeemPage( + return _i40.ProductRedeemPage( key: args.key, product: args.product, pointCard: args.pointCard, @@ -1097,7 +1164,7 @@ class ProductRedeemRouteArgs { required this.pointCard, }); - final _i53.Key? key; + final _i55.Key? key; final _i4.Product product; @@ -1122,28 +1189,28 @@ class ProductRedeemRouteArgs { } /// generated route for -/// [_i39.ProfilePage] -class ProfileRoute extends _i52.PageRouteInfo { - const ProfileRoute({List<_i52.PageRouteInfo>? children}) +/// [_i41.ProfilePage] +class ProfileRoute extends _i54.PageRouteInfo { + const ProfileRoute({List<_i54.PageRouteInfo>? children}) : super(ProfileRoute.name, initialChildren: children); static const String name = 'ProfileRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i39.ProfilePage()); + return _i54.WrappedRoute(child: const _i41.ProfilePage()); }, ); } /// generated route for -/// [_i40.PromoDetailPage] -class PromoDetailRoute extends _i52.PageRouteInfo { +/// [_i42.PromoDetailPage] +class PromoDetailRoute extends _i54.PageRouteInfo { PromoDetailRoute({ - _i53.Key? key, - required _i57.Promo promo, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + required _i60.Promo promo, + List<_i54.PageRouteInfo>? children, }) : super( PromoDetailRoute.name, args: PromoDetailRouteArgs(key: key, promo: promo), @@ -1152,11 +1219,11 @@ class PromoDetailRoute extends _i52.PageRouteInfo { static const String name = 'PromoDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i40.PromoDetailPage(key: args.key, promo: args.promo); + return _i42.PromoDetailPage(key: args.key, promo: args.promo); }, ); } @@ -1164,9 +1231,9 @@ class PromoDetailRoute extends _i52.PageRouteInfo { class PromoDetailRouteArgs { const PromoDetailRouteArgs({this.key, required this.promo}); - final _i53.Key? key; + final _i55.Key? key; - final _i57.Promo promo; + final _i60.Promo promo; @override String toString() { @@ -1185,28 +1252,28 @@ class PromoDetailRouteArgs { } /// generated route for -/// [_i41.PromoPage] -class PromoRoute extends _i52.PageRouteInfo { - const PromoRoute({List<_i52.PageRouteInfo>? children}) +/// [_i43.PromoPage] +class PromoRoute extends _i54.PageRouteInfo { + const PromoRoute({List<_i54.PageRouteInfo>? children}) : super(PromoRoute.name, initialChildren: children); static const String name = 'PromoRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i41.PromoPage(); + return const _i43.PromoPage(); }, ); } /// generated route for -/// [_i42.RegisterPage] -class RegisterRoute extends _i52.PageRouteInfo { +/// [_i44.RegisterPage] +class RegisterRoute extends _i54.PageRouteInfo { RegisterRoute({ - _i53.Key? key, + _i55.Key? key, required String phoneNumber, - List<_i52.PageRouteInfo>? children, + List<_i54.PageRouteInfo>? children, }) : super( RegisterRoute.name, args: RegisterRouteArgs(key: key, phoneNumber: phoneNumber), @@ -1215,12 +1282,12 @@ class RegisterRoute extends _i52.PageRouteInfo { static const String name = 'RegisterRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i52.WrappedRoute( - child: _i42.RegisterPage(key: args.key, phoneNumber: args.phoneNumber), + return _i54.WrappedRoute( + child: _i44.RegisterPage(key: args.key, phoneNumber: args.phoneNumber), ); }, ); @@ -1229,7 +1296,7 @@ class RegisterRoute extends _i52.PageRouteInfo { class RegisterRouteArgs { const RegisterRouteArgs({this.key, required this.phoneNumber}); - final _i53.Key? key; + final _i55.Key? key; final String phoneNumber; @@ -1250,108 +1317,108 @@ class RegisterRouteArgs { } /// generated route for -/// [_i43.RewardPage] -class RewardRoute extends _i52.PageRouteInfo { - const RewardRoute({List<_i52.PageRouteInfo>? children}) +/// [_i45.RewardPage] +class RewardRoute extends _i54.PageRouteInfo { + const RewardRoute({List<_i54.PageRouteInfo>? children}) : super(RewardRoute.name, initialChildren: children); static const String name = 'RewardRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i43.RewardPage(); + return const _i45.RewardPage(); }, ); } /// generated route for -/// [_i44.SplashPage] -class SplashRoute extends _i52.PageRouteInfo { - const SplashRoute({List<_i52.PageRouteInfo>? children}) +/// [_i46.SplashPage] +class SplashRoute extends _i54.PageRouteInfo { + const SplashRoute({List<_i54.PageRouteInfo>? children}) : super(SplashRoute.name, initialChildren: children); static const String name = 'SplashRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i44.SplashPage(); + return const _i46.SplashPage(); }, ); } /// generated route for -/// [_i45.TransferPage] -class TransferRoute extends _i52.PageRouteInfo { - const TransferRoute({List<_i52.PageRouteInfo>? children}) +/// [_i47.TransferPage] +class TransferRoute extends _i54.PageRouteInfo { + const TransferRoute({List<_i54.PageRouteInfo>? children}) : super(TransferRoute.name, initialChildren: children); static const String name = 'TransferRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i45.TransferPage()); + return _i54.WrappedRoute(child: const _i47.TransferPage()); }, ); } /// generated route for -/// [_i46.VoucherDetailPage] -class VoucherDetailRoute extends _i52.PageRouteInfo { - const VoucherDetailRoute({List<_i52.PageRouteInfo>? children}) +/// [_i48.VoucherDetailPage] +class VoucherDetailRoute extends _i54.PageRouteInfo { + const VoucherDetailRoute({List<_i54.PageRouteInfo>? children}) : super(VoucherDetailRoute.name, initialChildren: children); static const String name = 'VoucherDetailRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i46.VoucherDetailPage(); + return const _i48.VoucherDetailPage(); }, ); } /// generated route for -/// [_i47.VoucherPage] -class VoucherRoute extends _i52.PageRouteInfo { - const VoucherRoute({List<_i52.PageRouteInfo>? children}) +/// [_i49.VoucherPage] +class VoucherRoute extends _i54.PageRouteInfo { + const VoucherRoute({List<_i54.PageRouteInfo>? children}) : super(VoucherRoute.name, initialChildren: children); static const String name = 'VoucherRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i47.VoucherPage(); + return const _i49.VoucherPage(); }, ); } /// generated route for -/// [_i48.WalletExpiringPage] -class WalletExpiringRoute extends _i52.PageRouteInfo { - const WalletExpiringRoute({List<_i52.PageRouteInfo>? children}) +/// [_i50.WalletExpiringPage] +class WalletExpiringRoute extends _i54.PageRouteInfo { + const WalletExpiringRoute({List<_i54.PageRouteInfo>? children}) : super(WalletExpiringRoute.name, initialChildren: children); static const String name = 'WalletExpiringRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return _i52.WrappedRoute(child: const _i48.WalletExpiringPage()); + return _i54.WrappedRoute(child: const _i50.WalletExpiringPage()); }, ); } /// generated route for -/// [_i49.WalletHistoryPage] -class WalletHistoryRoute extends _i52.PageRouteInfo { +/// [_i51.WalletHistoryPage] +class WalletHistoryRoute extends _i54.PageRouteInfo { WalletHistoryRoute({ - _i53.Key? key, - _i56.WalletCurrency initialCurrency = _i56.WalletCurrency.point, - List<_i52.PageRouteInfo>? children, + _i55.Key? key, + _i59.WalletCurrency initialCurrency = _i59.WalletCurrency.point, + List<_i54.PageRouteInfo>? children, }) : super( WalletHistoryRoute.name, args: WalletHistoryRouteArgs( @@ -1363,14 +1430,14 @@ class WalletHistoryRoute extends _i52.PageRouteInfo { static const String name = 'WalletHistoryRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const WalletHistoryRouteArgs(), ); - return _i52.WrappedRoute( - child: _i49.WalletHistoryPage( + return _i54.WrappedRoute( + child: _i51.WalletHistoryPage( key: args.key, initialCurrency: args.initialCurrency, ), @@ -1382,12 +1449,12 @@ class WalletHistoryRoute extends _i52.PageRouteInfo { class WalletHistoryRouteArgs { const WalletHistoryRouteArgs({ this.key, - this.initialCurrency = _i56.WalletCurrency.point, + this.initialCurrency = _i59.WalletCurrency.point, }); - final _i53.Key? key; + final _i55.Key? key; - final _i56.WalletCurrency initialCurrency; + final _i59.WalletCurrency initialCurrency; @override String toString() { @@ -1406,31 +1473,31 @@ class WalletHistoryRouteArgs { } /// generated route for -/// [_i50.WalletPage] -class WalletRoute extends _i52.PageRouteInfo { - const WalletRoute({List<_i52.PageRouteInfo>? children}) +/// [_i52.WalletPage] +class WalletRoute extends _i54.PageRouteInfo { + const WalletRoute({List<_i54.PageRouteInfo>? children}) : super(WalletRoute.name, initialChildren: children); static const String name = 'WalletRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { - return const _i50.WalletPage(); + return const _i52.WalletPage(); }, ); } /// generated route for -/// [_i51.WebViewPage] -class WebViewRoute extends _i52.PageRouteInfo { +/// [_i53.WebViewPage] +class WebViewRoute extends _i54.PageRouteInfo { WebViewRoute({ - _i53.Key? key, + _i55.Key? key, required String title, required String url, bool fullscreen = false, - _i53.Color? backgroundColor, - List<_i52.PageRouteInfo>? children, + _i55.Color? backgroundColor, + List<_i54.PageRouteInfo>? children, }) : super( WebViewRoute.name, args: WebViewRouteArgs( @@ -1445,11 +1512,11 @@ class WebViewRoute extends _i52.PageRouteInfo { static const String name = 'WebViewRoute'; - static _i52.PageInfo page = _i52.PageInfo( + static _i54.PageInfo page = _i54.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i51.WebViewPage( + return _i53.WebViewPage( key: args.key, title: args.title, url: args.url, @@ -1469,7 +1536,7 @@ class WebViewRouteArgs { this.backgroundColor, }); - final _i53.Key? key; + final _i55.Key? key; final String title; @@ -1477,7 +1544,7 @@ class WebViewRouteArgs { final bool fullscreen; - final _i53.Color? backgroundColor; + final _i55.Color? backgroundColor; @override String toString() { diff --git a/lib/sample/news_sample_data.dart b/lib/sample/news_sample_data.dart new file mode 100644 index 0000000..a744cc0 --- /dev/null +++ b/lib/sample/news_sample_data.dart @@ -0,0 +1,187 @@ +import '../presentation/components/assets/assets.gen.dart'; + +// Models +enum NewsCategory { + menu('Menu Baru'), + promo('Promo'), + event('Event'), + info('Info'), + tips('Tips'); + + const NewsCategory(this.label); + + final String label; +} + +class NewsArticle { + final String id; + final String title; + final String summary; + final NewsCategory category; + + /// Path aset sampul; `null` memakai sampul warna kategori. + final String? coverImage; + final DateTime publishedAt; + final int readMinutes; + final String author; + final List paragraphs; + final bool isHeadline; + + const NewsArticle({ + required this.id, + required this.title, + required this.summary, + required this.category, + required this.publishedAt, + required this.readMinutes, + required this.paragraphs, + this.coverImage, + this.author = 'Tim Enaklo', + this.isHeadline = false, + }); +} + +// Sample Data +DateTime _hoursAgo(int hours) => + DateTime.now().subtract(Duration(hours: hours)); +DateTime _daysAgo(int days) => DateTime.now().subtract(Duration(days: days)); + +/// Getter, bukan `final`, supaya perubahan data langsung terbaca saat hot +/// reload (variabel global yang sudah terisi tidak diisi ulang). +List get newsSamples => [ + NewsArticle( + id: 'n1', + title: 'Sup Ikan Woku Kemangi, Menu Baru Andalan Woku Pedas', + summary: + 'Kuah woku khas Manado dengan kemangi segar, hadir mulai minggu ini.', + category: NewsCategory.menu, + coverImage: Assets.images.woku.path, + publishedAt: _hoursAgo(3), + readMinutes: 3, + isHeadline: true, + paragraphs: [ + 'Woku Pedas menambah menu andalan baru: Sup Ikan Woku Kemangi. Ikan ' + 'segar dimasak dalam kuah bumbu woku, lalu ditaburi daun kemangi ' + 'tepat sebelum disajikan.', + 'Level pedasnya bisa dipilih dari 1 sampai 5. Untuk yang baru pertama ' + 'mencoba, tim dapur menyarankan level 2 supaya aroma rempahnya tetap ' + 'terasa.', + 'Menu ini tersedia untuk dine-in dan take away. Jangan lupa sebutkan ' + 'nomor HP akunmu ke kasir supaya EnakPoint dari pembelian ini masuk.', + ], + ), + NewsArticle( + id: 'n2', + title: 'Double EnakPoint Tiap Akhir Pekan, Begini Cara Dapatnya', + summary: 'Belanja Sabtu dan Minggu di outlet mana pun dapat EnakPoint 2x.', + category: NewsCategory.promo, + publishedAt: _hoursAgo(20), + readMinutes: 2, + paragraphs: [ + 'Selama bulan ini, setiap belanja pada hari Sabtu dan Minggu mendapat ' + 'EnakPoint dua kali lipat dari biasanya, di semua outlet.', + 'Tidak perlu klaim. Cukup sebutkan nomor HP akunmu ke kasir sebelum ' + 'membayar, dan EnakPoint 2x masuk otomatis setelah pesanan lunas.', + 'Bonus maksimal 5.000 EnakPoint per transaksi. Detail lengkap dan promo ' + 'lainnya bisa kamu cek di EnakPromo.', + ], + ), + NewsArticle( + id: 'n3', + title: 'Tumulu Coffee Kini Buka Lebih Pagi, Mulai Pukul 07.00', + summary: 'Ngopi sebelum berangkat kerja sekarang bisa langsung di Tumulu.', + category: NewsCategory.info, + coverImage: Assets.images.tumulu.path, + publishedAt: _daysAgo(1), + readMinutes: 2, + paragraphs: [ + 'Mulai minggu ini Tumulu Coffee buka pukul 07.00, satu jam lebih pagi ' + 'dari sebelumnya. Jam tutup tetap pukul 22.00.', + 'Selama jam 07.00 sampai 09.00, tersedia paket sarapan kopi susu dan ' + 'roti bakar untuk kamu yang terburu-buru.', + ], + ), + NewsArticle( + id: 'n4', + title: 'Ramen Night di Ramenmulu, Sabtu Ini', + summary: 'Nonton bareng, live akustik, dan ramen edisi terbatas.', + category: NewsCategory.event, + coverImage: Assets.images.ramenmulu.path, + publishedAt: _daysAgo(2), + readMinutes: 3, + paragraphs: [ + 'Ramenmulu menggelar Ramen Night hari Sabtu mulai pukul 18.00. Ada ' + 'nonton bareng, live musik akustik, dan ramen kuah miso edisi ' + 'terbatas.', + 'Tempat duduk terbatas dan tidak bisa dipesan lebih dulu, jadi datang ' + 'lebih awal supaya kebagian meja.', + 'Anggota komunitas Ramen Lovers di EnakCommunity sudah ramai membahas ' + 'acara ini. Yuk ikut gabung obrolannya.', + ], + ), + NewsArticle( + id: 'n5', + title: 'Cheesecake Karamel Jadi Dessert Baru di Tumulu Coffee', + summary: 'Lembut, tidak terlalu manis, dan pas ditemani kopi hitam.', + category: NewsCategory.menu, + coverImage: Assets.images.onboarding2.path, + publishedAt: _daysAgo(4), + readMinutes: 2, + paragraphs: [ + 'Tumulu Coffee menghadirkan dessert baru: Cheesecake Karamel. Lapisan ' + 'keju yang lembut dipadukan dengan saus karamel dan remahan biskuit ' + 'cokelat.', + 'Rasa manisnya dibuat ringan supaya cocok dinikmati bersama kopi hitam ' + 'atau americano.', + ], + ), + NewsArticle( + id: 'n6', + title: 'Cara Bayar Pakai EnakPoint di Kasir', + summary: 'Cukup tunjukkan kode bayar. PIN tidak pernah diketik di kasir.', + category: NewsCategory.tips, + publishedAt: _daysAgo(5), + readMinutes: 3, + paragraphs: [ + 'EnakPoint bisa langsung dipakai untuk membayar di kasir. Setiap 1 ' + 'EnakPoint setara potongan Rp 1.', + 'Tekan tombol Bayar di tengah menu bawah, lalu masukkan PIN kamu. ' + 'Aplikasi akan menampilkan kode angka dan QR.', + 'Tunjukkan kode itu ke kasir. Kasir yang memilih berapa EnakPoint yang ' + 'dipakai. Kode berlaku 2 menit dan hanya bisa dipakai sekali.', + 'PIN hanya dimasukkan di aplikasi, tidak pernah di mesin kasir. Jangan ' + 'berikan PIN kamu kepada siapa pun, termasuk petugas outlet.', + ], + ), + NewsArticle( + id: 'n7', + title: 'EnakPoint Bisa Kedaluwarsa, Begini Cara Mengeceknya', + summary: 'Pakai saldo sebelum hangus. Cek tanggalnya di halaman EnakPoint.', + category: NewsCategory.tips, + publishedAt: _daysAgo(6), + readMinutes: 2, + paragraphs: [ + 'Outlet bisa mengatur masa berlaku untuk EnakPoint dan EnakCoin. Saldo ' + 'yang sudah lewat masa berlakunya akan hangus.', + 'Buka halaman EnakPoint & EnakCoin untuk melihat saldo terdekat yang ' + 'akan kedaluwarsa, lengkap dengan tanggalnya.', + 'Tanggal kedaluwarsa berarti saldo masih bisa dipakai sampai pukul ' + '23.59 WIB pada tanggal tersebut.', + ], + ), + NewsArticle( + id: 'n8', + title: 'Bakso 343 Rayakan Ulang Tahun ke-5', + summary: 'Lima tahun menemani makan siang, ada kejutan untuk pelanggan.', + category: NewsCategory.event, + coverImage: Assets.images.bakso343.path, + publishedAt: _daysAgo(9), + readMinutes: 2, + paragraphs: [ + 'Bakso 343 genap berusia lima tahun. Berawal dari satu gerobak, kini ' + 'jadi salah satu tenant favorit di Enaklo.', + 'Selama pekan ulang tahun, setiap pelanggan yang makan di tempat ' + 'mendapat es teh gratis selama persediaan masih ada.', + ], + ), +];