Commit c55a40c
Changed files (2)
lib
screens
lib/screens/home.dart
@@ -22,13 +22,7 @@ class AppHome extends StatelessWidget {
@override
Widget build(BuildContext context) {
final localizations = AppLocalizations.of(context)!;
- EdgeInsets padding;
- if (MediaQuery.of(context).size.width < 1000) {
- padding = const EdgeInsets.only(left: 10, right: 10, bottom: 15, top: 30);
- } else {
- padding = const EdgeInsets.all(80);
- }
-
+ //
// direct use of settings possible as no listening is required
if (_appStart && Provider.of<Settings>(context, listen: false).startWithAddMeasurementPage) {
SchedulerBinding.instance.addPostFrameCallback((_) {
@@ -40,20 +34,20 @@ class AppHome extends StatelessWidget {
return Scaffold(
body: OrientationBuilder(
builder: (context, orientation) {
- if (orientation == Orientation.landscape && MediaQuery.of(context).size.height < 500) {
+ if (orientation == Orientation.landscape) {
return MeasurementGraph(
height: MediaQuery.of(context).size.height,
);
}
return Center(
child: Container(
- padding: padding,
+ // TODO: utilize more of the screen width
+ padding: const EdgeInsets.only(left: 10, right: 10, bottom: 15, top: 30),
child: Consumer<Settings>(
builder: (context, settings, child) {
return Column(children: [
const MeasurementGraph(),
Expanded(
- flex: 50,
child: (settings.useLegacyList) ?
LegacyMeasurementsList(context) :
const MeasurementList()
lib/screens/statistics.dart
@@ -89,7 +89,7 @@ class StatisticsPage extends StatelessWidget {
// Time-Resolved Metrics
Statistic(
caption: Text(AppLocalizations.of(context)!.timeResolvedMetrics),
- child: (() {
+ child: () {
final data = analyzer.allAvgsRelativeToDaytime;
const opacity = 0.5;
return SizedBox(
@@ -133,7 +133,7 @@ class StatisticsPage extends StatelessWidget {
),
),
);
- })(),
+ }(),
),
],
);
@@ -161,6 +161,9 @@ class StatisticsPage extends StatelessWidget {
class Statistic extends StatelessWidget {
final Widget caption;
final Widget child;
+ /// Reduce the padding at the sites, which allows putting it in rows.
+ ///
+ /// TODO: should not depend on property and padding should be added outside of Statistic
final bool smallEdges;
const Statistic({super.key, required this.caption, required this.child, this.smallEdges = false});