-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
22 changed files
with
881 additions
and
123 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'tenka_repositories_dialog.dart'; |
115 changes: 115 additions & 0 deletions
115
lib/ui/pages/modules/components/tenka_repositories_dialog.dart
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 |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import 'package:kazahana/core/exports.dart'; | ||
import 'package:kazahana/ui/exports.dart'; | ||
import 'package:kazahana/ui/pages/modules/provider.dart'; | ||
|
||
class ModulesPageTenkaRepositoriesDialog extends StatefulWidget { | ||
const ModulesPageTenkaRepositoriesDialog({ | ||
required this.provider, | ||
super.key, | ||
}); | ||
|
||
final ModulesPageProvider provider; | ||
|
||
@override | ||
State<ModulesPageTenkaRepositoriesDialog> createState() => | ||
_ModulesPageTenkaRepositoriesDialogState(); | ||
} | ||
|
||
class _ModulesPageTenkaRepositoriesDialogState | ||
extends State<ModulesPageTenkaRepositoriesDialog> { | ||
late TextEditingController textEditingController; | ||
bool showTextInput = false; | ||
bool hasTextInput = false; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
textEditingController = TextEditingController(); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
super.dispose(); | ||
textEditingController.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(final BuildContext context) => Dialog( | ||
child: SingleChildScrollView( | ||
child: Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: HorizontalBodyPadding.paddingValue(context), | ||
vertical: context.r.scale(0.5), | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
context.t.tenkaRepositories, | ||
style: Theme.of(context).textTheme.headlineSmall, | ||
), | ||
...TenkaManager.allStoresIterable().map( | ||
(final String x) => ListTile( | ||
title: Text(x), | ||
trailing: IconButton( | ||
onPressed: () { | ||
widget.provider.uninstallTenkaStore(x); | ||
}, | ||
icon: const Icon(Icons.close), | ||
), | ||
), | ||
), | ||
if (showTextInput) | ||
LayoutBuilder( | ||
builder: ( | ||
final BuildContext context, | ||
final BoxConstraints constraints, | ||
) => | ||
SizedBox( | ||
width: constraints.minWidth, | ||
child: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
TextField( | ||
controller: textEditingController, | ||
onChanged: (final String text) { | ||
setState(() { | ||
hasTextInput = text.isNotEmpty; | ||
}); | ||
}, | ||
), | ||
IconButton( | ||
onPressed: () { | ||
if (hasTextInput) { | ||
widget.provider.installTenkaStore( | ||
textEditingController.text); | ||
} | ||
textEditingController.text = ''; | ||
showTextInput = false; | ||
}, | ||
icon: | ||
Icon(hasTextInput ? Icons.check : Icons.close), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
TextButton( | ||
onPressed: () { | ||
setState(() { | ||
showTextInput = !showTextInput; | ||
}); | ||
}, | ||
child: Text(context.t.add), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} |
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,5 +1,7 @@ | ||
export 'animations.dart'; | ||
export 'placeholders.dart'; | ||
export 'relative_scale.dart'; | ||
export 'themer.dart'; | ||
export 'text_theme.dart'; | ||
export 'theme.dart'; | ||
export 'themes.dart'; | ||
export 'translations.dart'; |
Oops, something went wrong.