Skip to content

Commit

Permalink
Merge pull request #13 from p0dyakov/refactor
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
p0dyakov committed Dec 8, 2022
2 parents 1b19ffd + d6ec8e9 commit 71de48b
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 86 deletions.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<uses-sdk tools:overrideLibrary="io.github.edufolly.flutterbluetoothserial"/>
<application
android:label="photo_editor"
android:label="Photo Editor"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
Expand Down
Empty file.
Empty file.
161 changes: 80 additions & 81 deletions lib/src/feature/editor/page/editor_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class _EditorPageState extends State<EditorPage> {
child: Center(
child: Image.memory(
image,
filterQuality: FilterQuality.none,
filterQuality: FilterQuality.medium,
),
),
),
Expand All @@ -102,87 +102,86 @@ class _EditorPageState extends State<EditorPage> {
),
),
bottomNavigationBar: state.when(
loadFailure: (_) => const SizedBox(),
loading: () => const SizedBox(),
loadSuccess: (image, brightnessValue, contrastValue) =>
Container(
height: 200,
padding: const EdgeInsets.symmetric(
horizontal: kDefaultPadding,),
color: Colors.black.withOpacity(0.7),
child: Column(
children: [
Row(
children: [
EditorIconButtonWidget(
operation: BitmapFlip.vertical(),
icon: Icons.flip,
angle: 1.57,
),
EditorIconButtonWidget(
operation: BitmapFlip.horizontal(),
icon: Icons.flip,
),
EditorIconButtonWidget(
operation: BitmapRotate.rotateClockwise(),
icon: Icons.rotate_left,
),
],
),
SliderWidget(
max: 150,
min: 50,
icon: Icons.contrast_outlined,
value: contrastValue,
onChangeEnd: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeImageSettings(
BitmapContrast(value / 100),
),
),
onChanged: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeContrastValue(value),
),
),
SliderWidget(
min: -150,
max: 150,
icon: Icons.brightness_7_outlined,
value: brightnessValue,
onChangeEnd: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeImageSettings(
BitmapBrightness(value / 100),
),
),
onChanged: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeBrightnessValue(value),
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
EditorTextButtonWidget(
onPressed: () =>
AutoRouter.of(context).pop(),
text: 'Cancel',
),
EditorTextButtonWidget(
onPressed: () =>
BlocProvider.of<EditorBloc>(context)
.add(
const EditorEvent.saveToGallery(),
),
text: 'Save',
),
],
)
],
loadFailure: (_) => const SizedBox(),
loading: () => const SizedBox(),
loadSuccess: (image, brightnessValue, contrastValue) =>
Container(
height: 200,
padding: const EdgeInsets.symmetric(
horizontal: kDefaultPadding,
),
color: Colors.black.withOpacity(0.7),
child: Column(
children: [
Row(
children: [
EditorIconButtonWidget(
operation: BitmapFlip.vertical(),
icon: Icons.flip,
angle: 1.57,
),
EditorIconButtonWidget(
operation: BitmapFlip.horizontal(),
icon: Icons.flip,
),
EditorIconButtonWidget(
operation: BitmapRotate.rotateClockwise(),
icon: Icons.rotate_left,
),
],
),
SliderWidget(
max: 150,
min: 50,
icon: Icons.contrast_outlined,
value: contrastValue,
onChangeEnd: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeImageSettings(
BitmapContrast(value / 100),
),
),
),),
onChanged: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeContrastValue(value),
),
),
SliderWidget(
min: -150,
max: 150,
icon: Icons.brightness_7_outlined,
value: brightnessValue,
onChangeEnd: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeImageSettings(
BitmapBrightness(value / 100),
),
),
onChanged: (double value) =>
BlocProvider.of<EditorBloc>(context).add(
EditorEvent.changeBrightnessValue(value),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
EditorTextButtonWidget(
onPressed: () => AutoRouter.of(context).pop(),
text: 'Cancel',
),
EditorTextButtonWidget(
onPressed: () =>
BlocProvider.of<EditorBloc>(context).add(
const EditorEvent.saveToGallery(),
),
text: 'Save',
),
],
)
],
),
),
),
),
),
),
Expand Down
3 changes: 0 additions & 3 deletions lib/src/feature/editor/repository/editor_repository.dart

This file was deleted.

This file was deleted.

0 comments on commit 71de48b

Please sign in to comment.