Skip to content

Commit

Permalink
Merge pull request #9 from QuantumPhysique/fix_issue8
Browse files Browse the repository at this point in the history
Fix issue8
  • Loading branch information
braniii authored Dec 20, 2023
2 parents 13f5a2f + c1de65a commit 96a51b3
Show file tree
Hide file tree
Showing 25 changed files with 108 additions and 98 deletions.
5 changes: 5 additions & 0 deletions app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ android {
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
externalNativeBuild {
ndkBuild {
arguments "LOCAL_LDFLAGS += -Wl,--build-id=none"
}
}
}

signingConfigs {
Expand Down
1 change: 1 addition & 0 deletions app/lib/core/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
///
///
///
library;
import 'package:flutter/widgets.dart';

/// Class for custom icons
Expand Down
5 changes: 5 additions & 0 deletions app/lib/core/interpolation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ class Interpolation {

/// interpolate Measurements
List<Measurement> interpolate(InterpolFunc interpolFunc){
// do not interpolate if empty
if (measures.isEmpty) {
return <Measurement>[];
}

final int dateFrom = measures.first.dateInMs - extrapolationRange;
final int dateTo = measures.last.dateInMs + extrapolationRange;
return <Measurement>[
Expand Down
1 change: 1 addition & 0 deletions app/lib/core/measurementDatabase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ class MeasurementDatabase {
(List<Measurement> current, List<Measurement> next) =>
current.length > next.length ? current : next
);
return null;
}

/// return string for export
Expand Down
8 changes: 4 additions & 4 deletions app/lib/core/theme.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'dart:math' as math;
import 'dart:ui';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter/material.dart';

import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:trale/core/icons.dart';

import 'package:trale/core/traleNotifier.dart';
import 'package:trale/main.dart';

Expand Down
8 changes: 5 additions & 3 deletions app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Future<void> main() async {
return runApp(
ChangeNotifierProvider<TraleNotifier>.value(
value: traleNotifier,
child: TraleMainApp(),
child: const TraleMainApp(),
),
);
}
Expand All @@ -37,8 +37,9 @@ Future<void> main() async {
class TraleApp extends MaterialApp {
/// Constructor
TraleApp({
super.key,
required this.traleNotifier,
Map<String, WidgetBuilder> routes = const <String, WidgetBuilder>{},
super.routes,
required this.light,
required this.dark,
required this.amoled,
Expand All @@ -48,7 +49,6 @@ class TraleApp extends MaterialApp {
? amoled.themeData
: dark.themeData,
themeMode: traleNotifier.themeMode,
routes: routes,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
locale: traleNotifier.locale,
Expand All @@ -63,6 +63,8 @@ class TraleApp extends MaterialApp {


class TraleMainApp extends StatelessWidget {
const TraleMainApp({super.key});

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
Expand Down
6 changes: 4 additions & 2 deletions app/lib/pages/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ final List<ThirdPartyLicence> tpls = <ThirdPartyLicence>[

/// about screen widget class
class About extends StatefulWidget {
const About({super.key});

@override
_About createState() => _About();
}
Expand Down Expand Up @@ -326,7 +328,7 @@ class _About extends State<About> {
maxLines: 1,
),
),
for (ThirdPartyLicence tpl in tplsAssets)
for (final ThirdPartyLicence tpl in tplsAssets)
tpl.toListTile(context),
Padding(
padding: EdgeInsets.fromLTRB(
Expand All @@ -341,7 +343,7 @@ class _About extends State<About> {
maxLines: 1,
),
),
for (ThirdPartyLicence tpl in tpls)
for (final ThirdPartyLicence tpl in tpls)
tpl.toListTile(context),
],
);
Expand Down
4 changes: 3 additions & 1 deletion app/lib/pages/faq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Future<void> _launchURL(String url) async {
/// ListTile for changing Amoled settings
class OnBoardingListTile extends StatelessWidget {
/// constructor
const OnBoardingListTile({Key? key}) : super(key: key);
const OnBoardingListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -108,6 +108,8 @@ class FAQEntry {

/// about screen widget class
class FAQ extends StatefulWidget {
const FAQ({super.key});

@override
_FAQ createState() => _FAQ();
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'package:trale/widget/floatingActionButton.dart';
/// home scaffold
class Home extends StatefulWidget {
/// constructor
const Home({Key? key}) : super(key: key);
const Home({super.key});
@override

/// create state
Expand Down
14 changes: 7 additions & 7 deletions app/lib/pages/onBoarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:trale/widget/iconHero.dart';
/// Page shown on the very first opening of the app
class OnBoardingPage extends StatefulWidget {
///
const OnBoardingPage({Key? key}) : super(key: key);
const OnBoardingPage({super.key});

@override
_OnBoardingPageState createState() => _OnBoardingPageState();
Expand All @@ -40,8 +40,8 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
Widget build(BuildContext context) {

final PageDecoration pageDecoration = PageDecoration(
titleTextStyle: Theme.of(context).textTheme.headline4!,
bodyTextStyle: Theme.of(context).textTheme.bodyText1!,
titleTextStyle: Theme.of(context).textTheme.headlineMedium!,
bodyTextStyle: Theme.of(context).textTheme.bodyLarge!,
titlePadding: EdgeInsets.symmetric(
horizontal: 2 * TraleTheme.of(context)!.padding,
vertical: TraleTheme.of(context)!.padding,
Expand Down Expand Up @@ -81,7 +81,7 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
horizontal: 2 * TraleTheme.of(context)!.padding),
child: Text(
AppLocalizations.of(context)!.onBoarding2,
style: Theme.of(context).textTheme.bodyText1!,
style: Theme.of(context).textTheme.bodyLarge!,
textAlign: TextAlign.center,
),
),
Expand Down Expand Up @@ -109,7 +109,7 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
horizontal: 2 * TraleTheme.of(context)!.padding),
child: Text(
AppLocalizations.of(context)!.onBoarding3,
style: Theme.of(context).textTheme.bodyText1!,
style: Theme.of(context).textTheme.bodyLarge!,
textAlign: TextAlign.center,
),
),
Expand All @@ -134,7 +134,7 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
nextFlex: 1,
skip: Text(
AppLocalizations.of(context)!.skip,
style: Theme.of(context).textTheme.bodyText1!,
style: Theme.of(context).textTheme.bodyLarge!,
overflow: TextOverflow.ellipsis,
),
next: Icon(
Expand All @@ -143,7 +143,7 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
),
done: Text(
AppLocalizations.of(context)!.startApp,
style: Theme.of(context).textTheme.bodyText1!,
style: Theme.of(context).textTheme.bodyLarge!,
overflow: TextOverflow.ellipsis,
),
curve: Curves.fastLinearToSlowEaseIn,
Expand Down
28 changes: 15 additions & 13 deletions app/lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'package:trale/widget/customSliverAppBar.dart';
/// ListTile for changing Amoled settings
class ExportListTile extends StatelessWidget {
/// constructor
const ExportListTile({Key? key}) : super(key: key);
const ExportListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -144,7 +144,7 @@ class ExportListTile extends StatelessWidget {
/// ListTile for importing
class ImportListTile extends StatelessWidget {
/// constructor
const ImportListTile({Key? key}) : super(key: key);
const ImportListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -281,7 +281,7 @@ class ImportListTile extends StatelessWidget {
/// ListTile for changing Amoled settings
class ResetListTile extends StatelessWidget {
/// constructor
const ResetListTile({Key? key}) : super(key: key);
const ResetListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -374,7 +374,7 @@ class ResetListTile extends StatelessWidget {
/// ListTile for changing Amoled settings
class AmoledListTile extends StatelessWidget {
/// constructor
const AmoledListTile({Key? key}) : super(key: key);
const AmoledListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -406,7 +406,7 @@ class AmoledListTile extends StatelessWidget {
/// ListTile for changing Language settings
class LanguageListTile extends StatelessWidget {
/// constructor
const LanguageListTile({Key? key}) : super(key: key);
const LanguageListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -448,7 +448,7 @@ class LanguageListTile extends StatelessWidget {
/// ListTile for changing units settings
class UnitsListTile extends StatelessWidget {
/// constructor
const UnitsListTile({Key? key}) : super(key: key);
const UnitsListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -492,7 +492,7 @@ class UnitsListTile extends StatelessWidget {
/// ListTile for changing dark mode settings
class DarkModeListTile extends StatelessWidget {
/// constructor
const DarkModeListTile({Key? key}) : super(key: key);
const DarkModeListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -554,7 +554,7 @@ class DarkModeListTile extends StatelessWidget {
/// ListTile for changing interpolation settings
class InterpolationListTile extends StatelessWidget {
/// constructor
const InterpolationListTile({Key? key}) : super(key: key);
const InterpolationListTile({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -593,7 +593,7 @@ class InterpolationListTile extends StatelessWidget {
/// ListTile for changing interpolation settings
class ThemeSelection extends StatelessWidget {
/// constructor
const ThemeSelection({Key? key}) : super(key: key);
const ThemeSelection({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -654,8 +654,8 @@ class ThemeSelection extends StatelessWidget {
AutoSizeText(
ctheme.name,
style: isDark
? ctheme.dark(context).themeData.textTheme.overline
: ctheme.light(context).themeData.textTheme.overline,
? ctheme.dark(context).themeData.textTheme.labelSmall
: ctheme.light(context).themeData.textTheme.labelSmall,
maxLines: 1,
),
Divider(
Expand Down Expand Up @@ -711,6 +711,8 @@ class ThemeSelection extends StatelessWidget {

/// about screen widget class
class Settings extends StatefulWidget {
const Settings({super.key});

@override
_Settings createState() => _Settings();
}
Expand Down Expand Up @@ -746,7 +748,7 @@ class _Settings extends State<Settings> {
padding: padding,
child: AutoSizeText(
AppLocalizations.of(context)!.userSettings.inCaps,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
maxLines: 1,
),
),
Expand All @@ -760,7 +762,7 @@ class _Settings extends State<Settings> {
padding: padding,
child: AutoSizeText(
AppLocalizations.of(context)!.dangerzone.inCaps,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
maxLines: 1,
),
),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/pages/splash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:trale/pages/onBoarding.dart';
/// splash scaffold
class Splash extends StatefulWidget {
/// constructor
const Splash({Key? key}) : super(key: key);
const Splash({super.key});
@override

/// create state
Expand Down
4 changes: 2 additions & 2 deletions app/lib/widget/animate_in_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:flutter/material.dart';

class AnimateInEffect extends StatefulWidget {
const AnimateInEffect({
Key? key,
super.key,
required this.child,
this.intervalStart = 0,
this.durationInMilliseconds = 1000,
this.delayInMilliseconds = 0,
this.keepAlive = false,
}) : super(key: key);
});

final Widget child;
final double intervalStart;
Expand Down
6 changes: 3 additions & 3 deletions app/lib/widget/appDrawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ NavigationDrawer appDrawer (
Navigator.of(context).pop();
Navigator.of(context).push<dynamic>(
SlideRoute(
page: Settings(),
page: const Settings(),
direction: TransitionDirection.left,
)
);
Expand All @@ -165,7 +165,7 @@ NavigationDrawer appDrawer (
Navigator.of(context).pop();
Navigator.of(context).push<dynamic>(
SlideRoute(
page: FAQ(),
page: const FAQ(),
direction: TransitionDirection.left,
)
);
Expand All @@ -188,7 +188,7 @@ NavigationDrawer appDrawer (
Navigator.of(context).pop();
Navigator.of(context).push<dynamic>(
SlideRoute(
page: About(),
page: const About(),
direction: TransitionDirection.left,
)
);
Expand Down
4 changes: 2 additions & 2 deletions app/lib/widget/fade_in_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:flutter/material.dart';

class FadeInEffect extends StatefulWidget {
const FadeInEffect({
Key? key,
super.key,
required this.child,
this.intervalStart = 0,
this.durationInMilliseconds = 1000,
this.delayInMilliseconds = 0,
this.keepAlive = false,
}) : super(key: key);
});

final Widget child;
final double intervalStart;
Expand Down
Loading

0 comments on commit 96a51b3

Please sign in to comment.