Skip to content

Commit

Permalink
Add version info to home
Browse files Browse the repository at this point in the history
  • Loading branch information
duddu committed Oct 22, 2023
1 parent 536927c commit be47b8e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 38 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.7
1.9.8
2 changes: 0 additions & 2 deletions lib/constants/locale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const String title = 'Sourdoc';
const String appBarHomeActionButtonTooltip = 'Open Help page';
const String formIntro =
'Change these settings, and the ingredients and fermentation values will automatically update.';
const String formIntroLarge =
'Change the following settings, and the ingredients and fermentation values below will automatically update.';
const String headerIngredients = 'Ingredients';
const String headerFermentation = 'Fermentation';
const String headerBakerFormulaDifference =
Expand Down
2 changes: 1 addition & 1 deletion lib/constants/style.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

const double contentLateralPadding = 25;
const double contentMaxWidth = 565;
const double contentMaxWidth = 590;
const double mobileMaxScreenWidth = 480;

bool isMobileScreenWidth(BuildContext context) {
Expand Down
70 changes: 39 additions & 31 deletions lib/widgets/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:sourdoc/widgets/calculator_form.dart';
import 'package:sourdoc/widgets/centered_container.dart';
import 'package:sourdoc/widgets/variable_with_label.dart';
import 'package:sourdoc/widgets/header.dart';
import 'package:sourdoc/widgets/version_info.dart';

class HomePage extends StatelessWidget {
const HomePage({super.key});
Expand Down Expand Up @@ -56,37 +57,44 @@ class HomePageListView extends StatelessWidget {

@override
Widget build(BuildContext context) {
return ListView(
primary: true,
padding: const EdgeInsets.only(bottom: 25),
children: [
CenteredContainer(
decoration: BoxDecoration(
color: Theme.of(context)
.colorScheme
.inversePrimary
.withAlpha(170)),
padding: const EdgeInsets.symmetric(vertical: 10),
child: Text(
style.isMobileScreenWidth(context)
? locale.formIntro
: locale.formIntroLarge,
textAlign: TextAlign.start,
style: Theme.of(context).textTheme.bodyMedium,
)),
Card(
margin: EdgeInsets.zero,
semanticContainer: false,
shape: const RoundedRectangleBorder(),
child: CenteredContainer(
padding: const EdgeInsets.symmetric(vertical: 12),
child: ChangeNotifierProvider(
create: (context) => TemperatureUnitModel(),
child: const CalculatorForm()))),
const CenteredContainer(child: IngredientsValues()),
const CenteredContainer(child: FermentationValues()),
],
);
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: ListView(
primary: true,
padding: const EdgeInsets.only(bottom: 25),
children: [
CenteredContainer(
decoration: BoxDecoration(
color: Theme.of(context)
.colorScheme
.inversePrimary
.withAlpha(170)),
padding: const EdgeInsets.symmetric(vertical: 10),
child: Text(
locale.formIntro,
textAlign: TextAlign.start,
style: Theme.of(context).textTheme.bodyMedium,
)),
Card(
margin: EdgeInsets.zero,
semanticContainer: false,
shape: const RoundedRectangleBorder(),
child: CenteredContainer(
padding: const EdgeInsets.symmetric(vertical: 12),
child: ChangeNotifierProvider(
create: (context) => TemperatureUnitModel(),
child: const CalculatorForm()))),
const CenteredContainer(child: IngredientsValues()),
const CenteredContainer(child: FermentationValues()),
],
)),
if (MediaQuery.of(context).size.height >
(style.isMobileScreenWidth(context) ? 880 : 770))
getVersionInfoContainer(context)
]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/version_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ CenteredContainer getVersionInfoContainer(BuildContext context) =>
Border(top: BorderSide(width: 1, color: Colors.grey.shade300)),
),
padding: EdgeInsets.fromLTRB(0, 18, 0,
Theme.of(context).platform == TargetPlatform.iOS ? 25 : 18),
Theme.of(context).platform == TargetPlatform.iOS ? 26 : 18),
child: const VersionInfo());
2 changes: 1 addition & 1 deletion web/download-release-asset.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Download Sourdoc release asset</title>
<script>
const version = '1.9.7';
const version = '1.9.8';
const build = new URLSearchParams(window.location.search).get('build');
window.location.href = 'https://github.com/duddu/sourdoc/releases/download/v' + version + '/' + build + '-sourdoc-v' + version + '.tgz';
</script>
Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ZS2J7KXZ0Q"></script>
<script defer src="gtm-gtag.js"></script>
<script>
const serviceWorkerVersion = '1.9.7';
const serviceWorkerVersion = '1.9.8';
</script>
<script defer src="flutter.js"></script>
</head>
Expand Down

0 comments on commit be47b8e

Please sign in to comment.