Skip to content

Commit

Permalink
feat(ui): show quran reading controls in both portrait & landscape modes
Browse files Browse the repository at this point in the history
- Remove orientation-specific conditional rendering
- Display navigation controls, surah selector and page indicators in all orientations
- Maintain consistent control behavior across screen modes
  • Loading branch information
YassinNouh21 committed Nov 3, 2024
1 parent 263e3a6 commit 8878fe6
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions lib/src/pages/quran/reading/quran_reading_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,18 @@ class _QuranReadingScreenState extends ConsumerState<QuranReadingScreen> {
}

Widget _buildBody(
AsyncValue<QuranReadingState> quranReadingState,
bool isPortrait,
UserPreferencesManager userPrefs,
AutoScrollState autoScrollState,
) {
AsyncValue<QuranReadingState> quranReadingState,
bool isPortrait,
UserPreferencesManager userPrefs,
AutoScrollState autoScrollState,
) {
return quranReadingState.when(
loading: () => _buildLoadingIndicator(),
error: (error, s) => _buildErrorIndicator(error),
data: (state) {
// Initialize the appropriate strategy
final viewStrategy =
autoScrollState.isSinglePageView ? AutoScrollViewStrategy(autoScrollState) : NormalViewStrategy(isPortrait);
autoScrollState.isSinglePageView ? AutoScrollViewStrategy(autoScrollState) : NormalViewStrategy(isPortrait);

// Create focus nodes bundle
final focusNodes = FocusNodes(
Expand All @@ -357,18 +357,16 @@ class _QuranReadingScreenState extends ConsumerState<QuranReadingScreen> {
// Main content
viewStrategy.buildView(state, ref, context),

// Controls overlay
if (!isPortrait) ...[
...viewStrategy.buildControls(
context,
state,
userPrefs,
isPortrait,
focusNodes,
_scrollPageList,
_showPageSelector,
),
],
// Controls overlay - show in both portrait and landscape
...viewStrategy.buildControls(
context,
state,
userPrefs,
isPortrait,
focusNodes,
_scrollPageList,
_showPageSelector,
),
],
);
},
Expand Down

0 comments on commit 8878fe6

Please sign in to comment.