Skip to content

Commit

Permalink
refactor(app, reports, common): Move warning level to common
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianWagner2 committed Jul 25, 2022
1 parent feb8395 commit f79bfe9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions app/lib/common/models/module.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export 'cpic_lookup_response.dart';
export 'medication/guideline.dart';
export 'medication/medication.dart';
export 'medication/warning_level.dart';
export 'metadata.dart';
export 'userdata/diplotype.dart';
export 'userdata/userdata.dart';
3 changes: 1 addition & 2 deletions app/lib/common/pages/medications/medication.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import '../../../reports/models/warning_level.dart';
import '../../l10n.dart';
import '../../models/medication/medication.dart';
import '../../models/module.dart';
import '../../theme.dart';
import '../../utilities/module.dart';
import '../../utilities/pdf_utils.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';

import '../../../../reports/models/warning_level.dart';
import '../../../l10n.dart';
import '../../../models/module.dart';
import '../../../theme.dart';
Expand Down
1 change: 0 additions & 1 deletion app/lib/reports/pages/cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:http/http.dart';

import '../../common/models/medication/cached_medications.dart';
import '../../common/module.dart';
import '../models/warning_level.dart';

part 'cubit.freezed.dart';

Expand Down
47 changes: 23 additions & 24 deletions app/lib/reports/pages/reports.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../../common/module.dart';
import '../models/warning_level.dart';
import 'cubit.dart';

class ReportsPage extends StatelessWidget {
Expand Down Expand Up @@ -154,29 +153,29 @@ class ReportCard extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(children: [
Icon(
warningLevel == WarningLevel.danger
? Icons.dangerous_rounded
: Icons.warning_amber,
),
SizedBox(width: 12),
Text(
medicationName,
style: PharmeTheme.textTheme.titleMedium,
),
]),
if (medicationIndication.isNotNullOrBlank) ...[
SizedBox(height: 12),
Text(
medicationIndication!,
style: PharmeTheme.textTheme.titleSmall,
),
]
],
),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(children: [
Icon(
warningLevel == WarningLevel.danger
? Icons.dangerous_rounded
: Icons.warning_amber,
),
SizedBox(width: 12),
Text(
medicationName,
style: PharmeTheme.textTheme.titleMedium,
),
]),
if (medicationIndication.isNotNullOrBlank) ...[
SizedBox(height: 12),
Text(
medicationIndication!,
style: PharmeTheme.textTheme.titleSmall,
),
]
],
),
),
Icon(Icons.arrow_forward_ios),
],
Expand Down

0 comments on commit f79bfe9

Please sign in to comment.