Skip to content

Commit

Permalink
fix carousel index
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Jun 14, 2024
1 parent c573f67 commit 8f25757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/screen/exhibition_details/exhibition_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _ExhibitionDetailPageState extends State<ExhibitionDetailPage>

late final PageController _controller;
int _currentIndex = 0;
late int _carouselIndex;
int _carouselIndex = 0;

@override
void initState() {
Expand All @@ -52,7 +52,6 @@ class _ExhibitionDetailPageState extends State<ExhibitionDetailPage>
_exBloc.add(GetExhibitionDetailEvent(
widget.payload.exhibitions[widget.payload.index].id));
_controller = PageController();
_carouselIndex = 0;
}

@override
Expand Down Expand Up @@ -196,6 +195,7 @@ class _ExhibitionDetailPageState extends State<ExhibitionDetailPage>
viewportFraction: 0.76,
enableInfiniteScroll: false,
enlargeCenterPage: true,
initialPage: _carouselIndex,
onPageChanged: (index, reason) {
_carouselIndex = index;
final controllingDevice =
Expand Down

0 comments on commit 8f25757

Please sign in to comment.