Skip to content

Commit

Permalink
remove print
Browse files Browse the repository at this point in the history
  • Loading branch information
YassinNouh21 committed Jan 9, 2025
1 parent 242d452 commit 68720de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
8 changes: 4 additions & 4 deletions lib/src/helpers/AppDate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class AppDateTime {
static final DateTime _initialRealTime = DateTime.now();
static final DateTime _initialDebugTime = DateTime(
_initialRealTime.year,
_initialRealTime.month,
_initialRealTime.day,
13,
48,
11,
1,
00,
-20,
00,
);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/helpers/riverpod_logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RiverpodLogger extends ProviderObserver {
Object? newValue,
ProviderContainer container,
) {
print('''
log('''
{
"provider": "${provider.name ?? provider.runtimeType}",
"newValue": "$newValue",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class AutoScrollNotifier extends AutoDisposeNotifier<AutoScrollState> {
}

void setScrollController(ScrollController controller) {
print('Setting scroll controller...');
scrollController = controller;
}

Expand Down Expand Up @@ -89,8 +88,6 @@ class AutoScrollNotifier extends AutoDisposeNotifier<AutoScrollState> {
await Future.delayed(Duration(milliseconds: 100));
_startScrolling();
} catch (e, stackTrace) {
print('Auto-scroll initialization error: $e');
print('Stacktrace: $stackTrace');

// Fallback state reset
state = state.copyWith(
Expand All @@ -112,13 +109,11 @@ class AutoScrollNotifier extends AutoDisposeNotifier<AutoScrollState> {

// Validate initial state
if (!state.isPlaying) {
print('Auto-scroll not started: state is not playing');
return;
}

// Additional safety checks
if (scrollController == null) {
print('ScrollController is null');
return;
}

Expand All @@ -131,7 +126,6 @@ class AutoScrollNotifier extends AutoDisposeNotifier<AutoScrollState> {

// Prevent infinite attempts
if (scrollAttempts > maxScrollAttempts) {
print('Max scroll attempts reached. Stopping auto-scroll.');
timer.cancel();
state = state.copyWith(isPlaying: false);
return;
Expand All @@ -145,10 +139,8 @@ class AutoScrollNotifier extends AutoDisposeNotifier<AutoScrollState> {
final delta = state.autoScrollSpeed;

// Detailed logging for debugging
print('Max Scroll: $maxScroll, Current Scroll: $currentScroll, Delta: $delta');

if (currentScroll >= maxScroll) {
print('Reached max scroll. Stopping auto-scroll.');
stopAutoScroll();
timer.cancel();
return;
Expand All @@ -165,15 +157,10 @@ class AutoScrollNotifier extends AutoDisposeNotifier<AutoScrollState> {
state = state.copyWith(currentPage: newPage);
}
} catch (e, stackTrace) {
print('Error during auto-scroll: $e');
print('Stacktrace: $stackTrace');
timer.cancel();
state = state.copyWith(isPlaying: false);
}
} else {
print('ScrollController does not have clients or content dimensions');
print('HasClients: ${scrollController.hasClients}');
print('HasContentDimensions: ${scrollController.position.hasContentDimensions}');
}
});
}
Expand Down

0 comments on commit 68720de

Please sign in to comment.