Skip to content

Commit

Permalink
UI fixes V2 (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
itskarmo authored Aug 16, 2023
1 parent 422d1ef commit cd9e987
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
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);
}

0 comments on commit cd9e987

Please sign in to comment.