add promotion/detail

This commit is contained in:
Phuoc Nguyen
2025-10-24 14:42:14 +07:00
parent fbeaa3c9e8
commit 338d26a38a
12 changed files with 1681 additions and 122 deletions

View File

@@ -0,0 +1,30 @@
/// Provider: Current Page Index Provider
///
/// Manages the state of the current bottom navigation page index.
library;
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'current_page_provider.g.dart';
/// Current Page Index Notifier
///
/// Manages which page is currently displayed in the bottom navigation.
/// Pages:
/// - 0: Home
/// - 1: Loyalty
/// - 2: Promotions
/// - 3: Notifications
/// - 4: Account
@riverpod
class CurrentPageIndex extends _$CurrentPageIndex {
@override
int build() => 0;
/// Set the current page index
void setIndex(int index) {
if (index >= 0 && index <= 4) {
state = index;
}
}
}