Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes/UI fixes v2 #272

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions admin/lib/presentation/widgets/base/customization_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import 'package:flutter/material.dart';

abstract class CustomizationTab extends StatelessWidget {
final String title;
final bool showToolTip;

const CustomizationTab({
required this.title,
this.showToolTip = false,
super.key,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ChoiceButtonsCustomizationTab extends CustomizationTab {
required this.onChange,
required super.title,
required this.editable,
super.showToolTip = true,
super.key,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class _QuestionSettingsTabBarState extends State<QuestionSettingsTabBar>
fontWeight: SurveyFonts.weightMedium,
),
tabs: [
for (final tab in widget.tabs) Tab(text: tab.title),
for (final tab in widget.tabs)
tab.showToolTip
? Tooltip(message: tab.title, child: Tab(text: tab.title))
: Tab(text: tab.title),
],
),
Expanded(
Expand Down
7 changes: 4 additions & 3 deletions core/lib/src/presentation/survey/survey_controller.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:survey_sdk/survey_sdk.dart';

/// This controller need to navigation on survey and save answer.
/// Function [onNext] navigate to next page and save answer on last page.
Expand All @@ -15,7 +16,7 @@ class SurveyController {

void onNext() {
_pageController.nextPage(
duration: const Duration(seconds: 1),
duration: SurveyDurations.panelSwitchingDuration,
curve: Curves.linear,
);
}
Expand All @@ -26,7 +27,7 @@ class SurveyController {
if (_pageController.hasClients && _pageController.page != null) {
_pageController.animateToPage(
index,
duration: const Duration(milliseconds: 500),
duration: SurveyDurations.animateToSpecificPageDuration,
curve: Curves.easeOutCubic,
);
}
Expand All @@ -36,7 +37,7 @@ class SurveyController {
/// user to navigate back within the survey.
void onBack() {
_pageController.previousPage(
duration: const Duration(seconds: 1),
duration: SurveyDurations.panelSwitchingDuration,
curve: Curves.linear,
);
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/src/presentation/utils/survey_durations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ class SurveyDurations {
static const Duration questionBottomButton = Duration(milliseconds: 200);
static const Duration customizationItemDuration = _iosAnimationDuration;
static const Duration panelSwitchingDuration = _iosAnimationDuration;
static const Duration animateToSpecificPageDuration =
Duration(milliseconds: 500);

static const Duration _iosAnimationDuration = Duration(milliseconds: 350);
}