-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a44c7e
commit f84e725
Showing
15 changed files
with
234 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,76 @@ | ||
import 'dart:ffi'; | ||
|
||
import 'package:asp/asp.dart'; | ||
import 'package:file_selector/file_selector.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:gap/gap.dart'; | ||
import 'package:localization/localization.dart'; | ||
|
||
import '../../../interactor/actions/config_action.dart'; | ||
import '../../../interactor/atoms/config_atom.dart'; | ||
|
||
class CoverSettingsWidget extends StatelessWidget { | ||
const CoverSettingsWidget({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
final theme = Theme.of(context); | ||
return RxBuilder( | ||
builder: (context) { | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'cover'.i18n(), | ||
style: theme.textTheme.titleMedium, | ||
), | ||
const Gap(12), | ||
SwitchListTile( | ||
value: gameConfigState.value.enableIGDB, | ||
onChanged: (v) { | ||
saveConfig(gameConfigState.value.copyWith(enableIGDB: v)); | ||
}, | ||
title: const Text('IGDB'), | ||
), | ||
const Gap(18), | ||
Text( | ||
'import_covers'.i18n(), | ||
style: theme.textTheme.titleMedium, | ||
), | ||
const Gap(12), | ||
Padding( | ||
padding: const EdgeInsets.only(right: 20), | ||
child: TextFormField( | ||
key: Key(beautifyPath(gameConfigState.value.coverFolder ?? '')), | ||
decoration: InputDecoration( | ||
border: const OutlineInputBorder(), | ||
labelText: 'folder'.i18n(), | ||
suffixIcon: const Icon(Icons.folder), | ||
), | ||
initialValue: | ||
beautifyPath(gameConfigState.value.coverFolder ?? ''), | ||
readOnly: true, | ||
onTap: () async { | ||
final selectedDirectory = await getDirectoryPath(); | ||
|
||
if (selectedDirectory != null) { | ||
saveConfig( | ||
gameConfigState.value.copyWith( | ||
coverFolder: selectedDirectory, | ||
), | ||
); | ||
} | ||
}, | ||
), | ||
), | ||
const Gap(12), | ||
Text( | ||
'import_covers_description'.i18n(), | ||
style: theme.textTheme.titleSmall, | ||
), | ||
], | ||
); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.