Skip to content

Commit

Permalink
chore 🔧: rename _getScrollOffset methods to _getSelectedWeekScrollOff…
Browse files Browse the repository at this point in the history
…set and _getSelectedMonthScrollOffset
  • Loading branch information
krolmic committed Oct 15, 2024
1 parent 7dde9e8 commit bfcc622
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tracking_flutter/lib/graph/view/widgets/months_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _MonthsSelectionState extends State<_MonthsSelection> {
super.initState();

scrollController = ScrollController(
initialScrollOffset: _getScrollOffset(),
initialScrollOffset: _getSelectedMonthScrollOffset(),
);

WidgetsBinding.instance.addPostFrameCallback((_) {
Expand All @@ -56,7 +56,7 @@ class _MonthsSelectionState extends State<_MonthsSelection> {
}

void _scrollToSelectedMonth() {
final scrollOffset = _getScrollOffset();
final scrollOffset = _getSelectedMonthScrollOffset();

if (scrollController.hasClients &&
scrollOffset != scrollController.offset) {
Expand Down Expand Up @@ -162,7 +162,7 @@ class _MonthsSelectionState extends State<_MonthsSelection> {
);
}

double _getScrollOffset() {
double _getSelectedMonthScrollOffset() {
final selectedMonthIndex = widget.selectedMonth - 1;
return math
.max(
Expand Down
6 changes: 3 additions & 3 deletions tracking_flutter/lib/graph/view/widgets/weeks_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _WeeksSelectionState extends State<_WeeksSelection> {
super.initState();

scrollController = ScrollController(
initialScrollOffset: _getScrollOffset(),
initialScrollOffset: _getSelectedWeekScrollOffset(),
);

WidgetsBinding.instance.addPostFrameCallback((_) {
Expand All @@ -55,7 +55,7 @@ class _WeeksSelectionState extends State<_WeeksSelection> {
}

void _scrollToSelectedWeek() {
final scrollOffset = _getScrollOffset();
final scrollOffset = _getSelectedWeekScrollOffset();

if (scrollController.hasClients) {
scrollController.animateTo(
Expand Down Expand Up @@ -159,7 +159,7 @@ class _WeeksSelectionState extends State<_WeeksSelection> {
);
}

double _getScrollOffset() {
double _getSelectedWeekScrollOffset() {
final selectedWeekIndex = widget.selectedWeek - 1;
return math
.max(
Expand Down

0 comments on commit bfcc622

Please sign in to comment.