Skip to content

Commit

Permalink
chore(#646): adapt paddings
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Aug 23, 2023
1 parent 15d1de3 commit a12c088
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 38 deletions.
1 change: 1 addition & 0 deletions app/lib/common/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class PharMeTheme {
static final borderColor = Colors.black.withOpacity(.2);

static const smallSpace = 8.0;
static const smallToMediumSpace = 12.0;
static const mediumSpace = 16.0;
static const largeSpace = 32.0;

Expand Down
21 changes: 12 additions & 9 deletions app/lib/common/widgets/drug_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,28 @@ class DrugSearch extends HookWidget {
Row(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.all(PharMeTheme.smallSpace),
child: CupertinoSearchTextField(
controller: searchController,
onChanged: (value) {
context.read<DrugListCubit>().search(query: value);
},
),
child: CupertinoSearchTextField(
controller: searchController,
onChanged: (value) {
context.read<DrugListCubit>().search(query: value);
},
),
),
SizedBox(width: 12),
SizedBox(width: PharMeTheme.smallToMediumSpace),
TooltipIcon(context.l10n.search_page_tooltip_search),
if (showFilter) buildFilter(context),
]
),
SizedBox(height: PharMeTheme.smallSpace),
Expanded(
child: Scrollbar(
thumbVisibility: true,
thickness: PharMeTheme.smallSpace / 2,
child: ListView(
padding: EdgeInsets.only(
right: PharMeTheme.smallSpace * 1.5
// right: 0
),
children: buildDrugList(
context,
state,
Expand Down
3 changes: 2 additions & 1 deletion app/lib/common/widgets/page_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Scaffold pageScaffold({

Scaffold unscrollablePageScaffold({
required Widget body,
double? padding,
String? title,
Widget? barBottom,
List<Widget>? actions,
Expand All @@ -66,7 +67,7 @@ Scaffold unscrollablePageScaffold({
appBar: appBar,
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(PharMeTheme.smallSpace),
padding: EdgeInsets.all(padding ?? PharMeTheme.smallSpace),
child: body,
),
),
Expand Down
26 changes: 12 additions & 14 deletions app/lib/drug_selection/pages/drug_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DrugSelectionPage extends HookWidget {
builder: (context, state) {
return unscrollablePageScaffold(
title: context.l10n.drug_selection_header,
padding: PharMeTheme.mediumSpace,
body: Column(
children: [
_buildDescription(context),
Expand All @@ -32,7 +33,7 @@ class DrugSelectionPage extends HookWidget {
),
);
}
)
),
);
}

Expand All @@ -44,19 +45,16 @@ class DrugSelectionPage extends HookWidget {
}

Widget _buildDescription(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Column(
children: [
Text(
context.l10n.drug_selection_description,
style: PharMeTheme.textTheme.bodyLarge),
SizedBox(height: PharMeTheme.mediumSpace),
Text(
context.l10n.drug_selection_later,
style: PharMeTheme.textTheme.bodyLarge),
]
),
return Column(
children: [
Text(
context.l10n.drug_selection_description,
style: PharMeTheme.textTheme.bodyLarge),
SizedBox(height: PharMeTheme.mediumSpace),
Text(
context.l10n.drug_selection_later,
style: PharMeTheme.textTheme.bodyLarge),
]
);
}

Expand Down
21 changes: 10 additions & 11 deletions app/lib/login/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class LoginPage extends HookWidget {
child: BlocBuilder<LoginPageCubit, LoginPageState>(
builder: (context, state) {
return unscrollablePageScaffold(
padding: PharMeTheme.mediumSpace,
body: Stack(
children: [
Positioned.fill(
Expand All @@ -35,16 +36,13 @@ class LoginPage extends HookWidget {
Positioned(
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(PharMeTheme.smallSpace),
child: state.when(
initial: () =>
_buildInitialScreen(context, dropdownValue),
loadingUserData: CircularProgressIndicator.new,
loadedUserData: () => _buildLoadedScreen(context),
error: (message) =>
_buildErrorScreen(context, message),
),
child: state.when(
initial: () =>
_buildInitialScreen(context, dropdownValue),
loadingUserData: CircularProgressIndicator.new,
loadedUserData: () => _buildLoadedScreen(context),
error: (message) =>
_buildErrorScreen(context, message),
),
),
),
Expand Down Expand Up @@ -162,7 +160,8 @@ class LoginPage extends HookWidget {
children: [
...children,
SizedBox(height: PharMeTheme.mediumSpace),
FullWidthButton(actionText, action ?? () {}), ],
FullWidthButton(actionText, action ?? () {}),
],
);
}
}
10 changes: 7 additions & 3 deletions app/lib/report/pages/gene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class GenePage extends HookWidget {
title: context.l10n.gene_page_headline(phenotype.geneSymbol),
body: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
padding: EdgeInsets.symmetric(
horizontal: PharMeTheme.smallToMediumSpace,
vertical: PharMeTheme.mediumSpace
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -29,7 +32,7 @@ class GenePage extends HookWidget {
tooltip: context.l10n
.gene_page_name_tooltip(phenotype.geneSymbol),
),
SizedBox(height: 12),
SizedBox(height: PharMeTheme.smallToMediumSpace),
RoundedCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -63,9 +66,10 @@ class GenePage extends HookWidget {
],
],
)),
SizedBox(height: 12),
SizedBox(height: PharMeTheme.smallToMediumSpace),
SubHeader(context.l10n.gene_page_affected_drugs,
tooltip: context.l10n.gene_page_affected_drugs_tooltip),
SizedBox(height: PharMeTheme.smallSpace),
...buildDrugList(context, state,
noDrugsMessage: context.l10n.gene_page_no_affected_drugs)
],
Expand Down

0 comments on commit a12c088

Please sign in to comment.