fix: settings style

This commit is contained in:
Matyáš Caras 2024-02-10 16:00:15 +01:00
parent d7a8233f6b
commit 6a25c8289c
Signed by untrusted user who does not match committer: hernik
GPG key ID: 2A3175F98820C5C6
2 changed files with 81 additions and 74 deletions

View file

@ -51,49 +51,52 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
context: c, context: c,
builder: (ctx) => AlertDialog.adaptive( builder: (ctx) => AlertDialog.adaptive(
title: Text(AppLocalizations.of(context).selectType), title: Text(AppLocalizations.of(context).selectType),
content: Column( content: SizedBox(
children: [ height: 80,
SizedBox( child: Column(
width: MediaQuery.of(ctx).size.width, children: [
child: InkWell( SizedBox(
child: Padding( width: MediaQuery.of(ctx).size.width,
padding: const EdgeInsets.all(8), child: InkWell(
child: Text( child: Padding(
AppLocalizations.of(context).barChart, padding: const EdgeInsets.all(8),
textAlign: TextAlign.center, child: Text(
AppLocalizations.of(context).barChart,
textAlign: TextAlign.center,
),
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("yearlygraph", 1);
_yearly = 1;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("yearlygraph", 1);
_yearly = 1;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
), SizedBox(
SizedBox( width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, child: InkWell(
child: InkWell( child: Padding(
child: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: Text(
child: Text( AppLocalizations.of(context).lineChart,
AppLocalizations.of(context).lineChart, textAlign: TextAlign.center,
textAlign: TextAlign.center, ),
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("yearlygraph", 2);
_yearly = 2;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("yearlygraph", 2);
_yearly = 2;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
), ],
], ),
), ),
), ),
), ),
@ -109,49 +112,52 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
context: c, context: c,
builder: (ctx) => AlertDialog.adaptive( builder: (ctx) => AlertDialog.adaptive(
title: Text(AppLocalizations.of(context).selectType), title: Text(AppLocalizations.of(context).selectType),
content: Column( content: SizedBox(
children: [ height: 80,
SizedBox( child: Column(
width: MediaQuery.of(ctx).size.width, children: [
child: InkWell( SizedBox(
child: Padding( width: MediaQuery.of(ctx).size.width,
padding: const EdgeInsets.all(8), child: InkWell(
child: Text( child: Padding(
AppLocalizations.of(context).barChart, padding: const EdgeInsets.all(8),
textAlign: TextAlign.center, child: Text(
AppLocalizations.of(context).barChart,
textAlign: TextAlign.center,
),
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("monthlygraph", 1);
_monthly = 1;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("monthlygraph", 1);
_monthly = 1;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
), SizedBox(
SizedBox( width: MediaQuery.of(ctx).size.width,
width: MediaQuery.of(ctx).size.width, child: InkWell(
child: InkWell( child: Padding(
child: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: Text(
child: Text( AppLocalizations.of(context).lineChart,
AppLocalizations.of(context).lineChart, textAlign: TextAlign.center,
textAlign: TextAlign.center, ),
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("monthlygraph", 2);
_monthly = 2;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
onTap: () async {
final s = await SharedPreferences.getInstance();
await s.setInt("monthlygraph", 2);
_monthly = 2;
if (!ctx.mounted) return;
Navigator.of(ctx).pop();
setState(() {});
},
), ),
), ],
], ),
), ),
), ),
), ),

View file

@ -152,6 +152,7 @@ class _TessdataListViewState extends State<TessdataListView> {
/// so we can show it to the user /// so we can show it to the user
Future<void> loadAllTessdata() async { Future<void> loadAllTessdata() async {
final tessDir = Directory(await FlutterTesseractOcr.getTessdataPath()); final tessDir = Directory(await FlutterTesseractOcr.getTessdataPath());
if (!tessDir.existsSync()) tessDir.createSync(recursive: true);
final d = await TessdataApi.getAvailableData(); final d = await TessdataApi.getAvailableData();
final dataStatus = <Map<String, bool>>[]; final dataStatus = <Map<String, bool>>[];
for (final data in d) { for (final data in d) {