-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
e6e4190
commit 866e14f
Showing
11 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:page_view_dot_indicator/page_view_dot_indicator.dart'; | ||
import 'package:survey/resource/dimens.dart'; | ||
|
||
class HomeSurveysIndicatorsWidget extends StatelessWidget { | ||
final int surveysAmount; | ||
final ValueNotifier<int> currentSurveysPage; | ||
|
||
const HomeSurveysIndicatorsWidget({ | ||
Key? key, | ||
required this.surveysAmount, | ||
required this.currentSurveysPage, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ValueListenableBuilder( | ||
valueListenable: currentSurveysPage, | ||
builder: (context, int currentSurveysPage, child) => | ||
_buildSurveysIndicator(currentSurveysPage, surveysAmount), | ||
); | ||
} | ||
|
||
Widget _buildSurveysIndicator(int currentSurveysPage, int surveysAmount) { | ||
if (currentSurveysPage > surveysAmount) { | ||
this.currentSurveysPage.value = surveysAmount - 1; | ||
return const SizedBox(); | ||
} else { | ||
return Column( | ||
children: [ | ||
const Expanded(child: const SizedBox.shrink()), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: Dimens.space15), | ||
child: PageViewDotIndicator( | ||
currentItem: currentSurveysPage, | ||
count: surveysAmount, | ||
selectedColor: Colors.white, | ||
unselectedColor: Colors.white.withOpacity(0.2), | ||
size: const Size( | ||
Dimens.homeSurveysIndicatorsSize, | ||
Dimens.homeSurveysIndicatorsSize, | ||
), | ||
unselectedSize: const Size( | ||
Dimens.homeSurveysIndicatorsSize, | ||
Dimens.homeSurveysIndicatorsSize, | ||
), | ||
margin: const EdgeInsets.symmetric(horizontal: Dimens.space5), | ||
padding: EdgeInsets.zero, | ||
alignment: Alignment.centerLeft, | ||
fadeEdges: false, | ||
), | ||
), | ||
const SizedBox(height: Dimens.space170), | ||
], | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...et/text_input_forgot_password_widget.dart → ...in_text_input_forgot_password_widget.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters