-
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
f5361ce
commit a6d0c4b
Showing
11 changed files
with
175 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:material_leap/material_leap.dart'; | ||
import 'package:phosphor_flutter/phosphor_flutter.dart'; | ||
import 'package:setonix/bloc/editor.dart'; | ||
import 'package:setonix_api/setonix_api.dart'; | ||
|
||
class FiguresEditorPage extends StatelessWidget { | ||
const FiguresEditorPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final cubit = context.read<EditorCubit>(); | ||
return Scaffold( | ||
body: SingleChildScrollView( | ||
child: Center( | ||
child: Container( | ||
constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), | ||
padding: const EdgeInsets.all(4), | ||
child: BlocBuilder<EditorCubit, SetonixData>( | ||
builder: (context, state) { | ||
final figures = state.getFigureItems(); | ||
return Column( | ||
children: figures.map((figure) { | ||
final id = figure.id; | ||
return Dismissible( | ||
key: ValueKey(id), | ||
onDismissed: (direction) { | ||
cubit.removeFigure(id); | ||
}, | ||
child: ListTile( | ||
title: Text(id), | ||
trailing: IconButton( | ||
icon: const Icon(PhosphorIconsLight.trash), | ||
onPressed: () { | ||
cubit.removeFigure(id); | ||
}, | ||
), | ||
), | ||
); | ||
}).toList(), | ||
); | ||
}, | ||
), | ||
), | ||
), | ||
), | ||
floatingActionButton: FloatingActionButton.extended( | ||
onPressed: () async { | ||
final name = await showDialog<String>( | ||
context: context, | ||
builder: (context) => NameDialog( | ||
validator: defaultNameValidator( | ||
context, cubit.state.getFigures().toList()), | ||
)); | ||
if (name == null) return; | ||
cubit.setFigure( | ||
name, FigureDefinition(back: FigureBackDefinition(texture: ''))); | ||
}, | ||
label: Text(AppLocalizations.of(context).create), | ||
icon: const Icon(PhosphorIconsLight.plus), | ||
), | ||
); | ||
} | ||
} |
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,2 +1,3 @@ | ||
* Fix importing of packs | ||
* Rework packs dialog | ||
* Upgrade to flutter 3.27 |
Oops, something went wrong.