Skip to content

Commit

Permalink
style: study type indicator in study design
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimozkn committed Jul 27, 2024
1 parent 192ac2b commit 1b42862
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/screens/app_onboarding/loading_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _LoadingScreenState extends State<LoadingScreen> {
}
} catch (exception) {
debugPrint(
"Could not login and retrieve the study subject: $exception");
"Could not login and retrieve the study subject: $exception",);
if (exception is SocketException) {
subject = await Cache.loadSubject();
StudyULogger.info("Offline mode with cached subject: $subject");
Expand Down
13 changes: 13 additions & 0 deletions designer_v2/lib/features/study/study_scaffold.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:studyu_core/core.dart';
import 'package:studyu_designer_v2/common_views/action_popup_menu.dart';
import 'package:studyu_designer_v2/common_views/async_value_widget.dart';
import 'package:studyu_designer_v2/common_views/layout_single_column.dart';
Expand All @@ -18,6 +19,7 @@ import 'package:studyu_designer_v2/features/study/study_page_view.dart';
import 'package:studyu_designer_v2/features/study/study_status_badge.dart';
import 'package:studyu_designer_v2/localization/app_translation.dart';
import 'package:studyu_designer_v2/repositories/model_repository.dart';
import 'package:studyu_designer_v2/theme.dart';
import 'package:studyu_designer_v2/utils/model_action.dart';

abstract class IStudyAppBarViewModel
Expand Down Expand Up @@ -141,6 +143,17 @@ class _StudyScaffoldState extends ConsumerState<StudyScaffold> {
softWrap: false,
),
),
if (state.studyType != StudyType.standalone)
const SizedBox(width: 8.0)
else
const SizedBox.shrink(),
if (state.studyType != StudyType.standalone)
Text(
"(${state.studyType == StudyType.subStudy ? tr.study_type_substudy : tr.study_type_template})",
style: ThemeConfig.bodyTextMuted(theme),
)
else
const SizedBox.shrink(),
if (state.isSyncIndicatorVisible)
const SizedBox(width: 8.0)
else
Expand Down
3 changes: 3 additions & 0 deletions designer_v2/lib/localization/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
"modify_query": "Modify your query",
"studies_empty": "You don't have any studies yet",
"studies_empty_description": "Build your own study from scratch or create a new draft copy from an already published study!",
"study_type_standalone": "Standalone",
"study_type_template": "Template",
"study_type_substudy": "Subtrial",
"@__________________STUDYPAGE__________________": {},
"navlink_learn": "Learn",
"navlink_study_design": "Design",
Expand Down

0 comments on commit 1b42862

Please sign in to comment.