-
Notifications
You must be signed in to change notification settings - Fork 6
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
f341dc7
commit 36160b6
Showing
8 changed files
with
186 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -744,6 +744,13 @@ jobs: | |
- uses: subosito/[email protected] | ||
with: | ||
flutter-version-file: app/pubspec.yaml | ||
- name: Build nessesary files | ||
working-directory: ./ | ||
run: | | ||
cd tools | ||
dart pub get | ||
cd .. | ||
dart run tools/generate.dart | ||
- name: 📦 Get dependencies | ||
run: | | ||
flutter pub get | ||
|
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,48 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:material_leap/material_leap.dart'; | ||
import 'package:setonix/pages/editor/navigation.dart'; | ||
|
||
class GeneralEditorPage extends StatelessWidget { | ||
final String name; | ||
|
||
const GeneralEditorPage({super.key, required this.name}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return EditorScaffold( | ||
currentPage: EditorPage.general, | ||
body: SingleChildScrollView( | ||
child: Center( | ||
child: ConstrainedBox( | ||
constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), | ||
child: Column( | ||
children: [ | ||
TextField( | ||
decoration: InputDecoration( | ||
labelText: AppLocalizations.of(context).name, | ||
filled: true, | ||
), | ||
), | ||
TextField( | ||
decoration: InputDecoration( | ||
labelText: AppLocalizations.of(context).version, | ||
filled: true, | ||
), | ||
), | ||
TextField( | ||
decoration: InputDecoration( | ||
labelText: AppLocalizations.of(context).description, | ||
border: OutlineInputBorder(), | ||
), | ||
minLines: 3, | ||
maxLines: 5, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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,87 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:material_leap/material_leap.dart'; | ||
import 'package:phosphor_flutter/phosphor_flutter.dart'; | ||
|
||
enum EditorPage { | ||
general, | ||
figures, | ||
decks, | ||
backgrounds, | ||
translations; | ||
|
||
IconGetter get icon => switch (this) { | ||
EditorPage.general => PhosphorIcons.house, | ||
EditorPage.figures => PhosphorIcons.cube, | ||
EditorPage.decks => PhosphorIcons.stack, | ||
EditorPage.backgrounds => PhosphorIcons.image, | ||
EditorPage.translations => PhosphorIcons.translate, | ||
}; | ||
|
||
String getLocalizedName(BuildContext context) { | ||
final loc = AppLocalizations.of(context); | ||
return switch (this) { | ||
EditorPage.general => loc.general, | ||
EditorPage.figures => loc.figures, | ||
EditorPage.decks => loc.decks, | ||
EditorPage.backgrounds => loc.backgrounds, | ||
EditorPage.translations => loc.translations, | ||
}; | ||
} | ||
} | ||
|
||
class EditorNavigatorView extends StatelessWidget { | ||
final EditorPage currentPage; | ||
|
||
const EditorNavigatorView({ | ||
super.key, | ||
required this.currentPage, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return NavigationRail( | ||
destinations: EditorPage.values | ||
.map((e) => NavigationRailDestination( | ||
icon: Icon(e.icon(PhosphorIconsStyle.light)), | ||
label: Text(e.getLocalizedName(context)), | ||
selectedIcon: Icon(e.icon(PhosphorIconsStyle.fill)), | ||
)) | ||
.toList(), | ||
selectedIndex: currentPage.index, | ||
labelType: NavigationRailLabelType.all, | ||
); | ||
} | ||
} | ||
|
||
class EditorScaffold extends StatelessWidget { | ||
final EditorPage currentPage; | ||
final Widget body; | ||
|
||
const EditorScaffold({ | ||
super.key, | ||
required this.currentPage, | ||
required this.body, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final width = MediaQuery.sizeOf(context).width; | ||
final isMobile = width < LeapBreakpoints.medium; | ||
final navigator = EditorNavigatorView(currentPage: currentPage); | ||
return Row( | ||
children: [ | ||
if (!isMobile) navigator, | ||
Expanded( | ||
child: Scaffold( | ||
appBar: AppBar( | ||
title: Text(currentPage.getLocalizedName(context)), | ||
), | ||
drawer: isMobile ? navigator : null, | ||
body: body, | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
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