Skip to content

Commit

Permalink
fix button styles, add license info
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinschumacher committed Dec 28, 2024
1 parent 78bcb53 commit ff93994
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 4,180 deletions.
5 changes: 5 additions & 0 deletions assets/docs/info_de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Super Simple Scan ist eine einfach zu verwendende, funktionale App zum Scannen von Dokumenten.

Quellcode: https://github.com/merlinschumacher/supersimplescan

Diese App greift weder auf Ihre persönlichen Daten zu, noch speichert oder teilt sie diese und wird ohne jegliche Gewährleistung oder Haftung bereitgestellt.
4 changes: 1 addition & 3 deletions assets/docs/info_en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Super Simple Scan is an easy-to-use, no-frills document scanning app.

Source code: https://github.com/merlinschumacher/supersimplescan.
Source code: https://github.com/merlinschumacher/supersimplescan

The application doesn't access, store or share any personal data and comes withour any warranty or liability.

© Merlin Schumacher
12 changes: 11 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"@@locale": "de",
"appName": "Super Simple Scan",
"scanStartButton": "Scan starten",
"scanResultTitle": "Scan-Ergebnis",
"enterFileNamePrompt": "Geben Sie einen Titel für das Dokument ein",
Expand All @@ -18,5 +19,14 @@
}
}
},
"infoPageText": "Super Simple Scan ist eine einfach zu verwendende, funktionale App zum Scannen von Dokumenten.\nQuellcode: <a href='https://github.com/merlinschumacher/supersimplescan'>https://github.com/merlinschumacher/supersimplescan</a>\n&copy; Merlin Schumacher.\nDiese App greift weder auf Ihre persönlichen Daten zu, noch speichert oder teilt sie diese."
"infoPageTextFile": "info_de.md",
"aboutDialogLegalese": "© 2024 - {year} Merlin Schumacher",
"@aboutDialogLegalese": {
"placeholders": {
"year": {
"type": "DateTime",
"format": "y"
}
}
}
}
15 changes: 12 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,17 @@
}
},
"infoPageTextFile": "info_en.md",
"infoPageText": "Super Simple Scan is an easy-to-use, no-frills document scanning app.\nSource code: <a href='https://github.com/merlinschumacher/supersimplescan'>https://github.com/merlinschumacher/supersimplescan</a>\n&copy; Merlin Schumacher.\nThe application doesn't access, store or share any personal data.",
"@infoPageText": {
"description": "The body text of the info page"
"@infoPageTextFile": {
"description": "The name of the file with the app information for this language."
},
"aboutDialogLegalese": "© 2024 - {year} Merlin Schumacher",
"@aboutDialogLegalese": {
"description": "The legal disclaimer in the about dialog",
"placeholders": {
"year": {
"type": "DateTime",
"format": "y"
}
}
}
}
33 changes: 20 additions & 13 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,18 @@ void main() {
class SuperSimpleScan extends StatelessWidget {
const SuperSimpleScan({super.key});

static final _defaultLightColorScheme =
ColorScheme.fromSwatch(primarySwatch: Colors.blue);

static final _defaultDarkColorScheme = ColorScheme.fromSwatch(
primarySwatch: Colors.blue, brightness: Brightness.dark);

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return DynamicColorBuilder(builder: (lightColorScheme, darkColorScheme) {
return DynamicColorBuilder(builder: (lightDynamic, darkDynamic) {
final ColorScheme lightColorScheme =
_generateColorScheme(lightDynamic?.primary);
final ColorScheme darkColorScheme =
_generateColorScheme(darkDynamic?.primary, Brightness.dark);
return MaterialApp(
title: 'Super Simple Scan',
theme: ThemeData(
colorScheme: lightColorScheme ?? _defaultLightColorScheme,
),
darkTheme: ThemeData(
colorScheme: darkColorScheme ?? _defaultDarkColorScheme,
),
theme: ThemeData(colorScheme: lightColorScheme),
darkTheme: ThemeData(colorScheme: darkColorScheme),
themeMode: ThemeMode.system,
localizationsDelegates: [
AppLocalizations.delegate,
Expand All @@ -47,4 +41,17 @@ class SuperSimpleScan extends StatelessWidget {
);
});
}

// Workaround for https://github.com/material-foundation/flutter-packages/issues/582
ColorScheme _generateColorScheme(Color? primaryColor,
[Brightness? brightness]) {
final Color seedColor = primaryColor ?? Colors.blue;

final ColorScheme newScheme = ColorScheme.fromSeed(
seedColor: seedColor,
brightness: brightness ?? Brightness.light,
);

return newScheme.harmonized();
}
}
Loading

0 comments on commit ff93994

Please sign in to comment.