mirror of
https://github.com/Myzel394/quid_faciam_hodie.git
synced 2025-06-19 15:45:26 +02:00
improvements
This commit is contained in:
parent
391be909a7
commit
4b3442e50d
@ -308,6 +308,7 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
|||||||
opacityDuration: DEFAULT_OPACITY_DURATION *
|
opacityDuration: DEFAULT_OPACITY_DURATION *
|
||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
child: ChangeCameraButton(
|
child: ChangeCameraButton(
|
||||||
|
disabled: lockCamera,
|
||||||
onChangeCamera: () {
|
onChangeCamera: () {
|
||||||
final currentCameraIndex = GlobalValuesManager
|
final currentCameraIndex = GlobalValuesManager
|
||||||
.cameras
|
.cameras
|
||||||
@ -348,12 +349,18 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
|||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
opacityDuration: DEFAULT_OPACITY_DURATION *
|
opacityDuration: DEFAULT_OPACITY_DURATION *
|
||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
child: lastPhoto == null
|
child: TodayPhotoButton(
|
||||||
? const TodayPhotoButton()
|
data: lastPhoto == null ? null : lastPhoto![0],
|
||||||
: TodayPhotoButton(
|
type: lastPhoto == null ? null : lastPhoto![1],
|
||||||
data: lastPhoto![0],
|
onLeave: () {
|
||||||
type: lastPhoto![1],
|
controller!.setFlashMode(FlashMode.off);
|
||||||
),
|
},
|
||||||
|
onComeBack: () {
|
||||||
|
if (isTorchEnabled) {
|
||||||
|
controller!.setFlashMode(FlashMode.torch);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -362,7 +369,11 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
expandableContent: Padding(
|
expandableContent: Padding(
|
||||||
padding: const EdgeInsets.all(LARGE_SPACE),
|
padding: const EdgeInsets.only(
|
||||||
|
left: LARGE_SPACE,
|
||||||
|
right: LARGE_SPACE,
|
||||||
|
bottom: MEDIUM_SPACE,
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -403,8 +414,7 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
|||||||
: () {
|
: () {
|
||||||
final newZoomLevelIndex =
|
final newZoomLevelIndex =
|
||||||
((currentZoomLevelIndex + 1) %
|
((currentZoomLevelIndex + 1) %
|
||||||
zoomLevels!.length)
|
zoomLevels!.length);
|
||||||
.toInt();
|
|
||||||
|
|
||||||
controller!
|
controller!
|
||||||
.setZoomLevel(zoomLevels![newZoomLevelIndex]);
|
.setZoomLevel(zoomLevels![newZoomLevelIndex]);
|
||||||
|
@ -3,10 +3,12 @@ import 'package:flutter/services.dart';
|
|||||||
|
|
||||||
class ChangeCameraButton extends StatelessWidget {
|
class ChangeCameraButton extends StatelessWidget {
|
||||||
final VoidCallback onChangeCamera;
|
final VoidCallback onChangeCamera;
|
||||||
|
final bool disabled;
|
||||||
|
|
||||||
const ChangeCameraButton({
|
const ChangeCameraButton({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.onChangeCamera,
|
required this.onChangeCamera,
|
||||||
|
this.disabled = false,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -15,23 +17,30 @@ class ChangeCameraButton extends StatelessWidget {
|
|||||||
enableFeedback: false,
|
enableFeedback: false,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
HapticFeedback.heavyImpact();
|
HapticFeedback.heavyImpact();
|
||||||
onChangeCamera();
|
onChangeCamera();
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Opacity(
|
||||||
alignment: Alignment.center,
|
opacity: disabled ? 0.5 : 1.0,
|
||||||
children: <Widget>[
|
child: Stack(
|
||||||
Icon(
|
alignment: Alignment.center,
|
||||||
Icons.circle,
|
children: <Widget>[
|
||||||
size: 60,
|
Icon(
|
||||||
color: Colors.white.withOpacity(.2),
|
Icons.circle,
|
||||||
),
|
size: 60,
|
||||||
Icon(
|
color: Colors.white.withOpacity(.2),
|
||||||
Icons.camera_alt,
|
),
|
||||||
size: 30,
|
const Icon(
|
||||||
color: Colors.white,
|
Icons.camera_alt,
|
||||||
),
|
size: 30,
|
||||||
],
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,13 @@ import 'raw_memory_display.dart';
|
|||||||
class TodayPhotoButton extends StatelessWidget {
|
class TodayPhotoButton extends StatelessWidget {
|
||||||
final Uint8List? data;
|
final Uint8List? data;
|
||||||
final MemoryType? type;
|
final MemoryType? type;
|
||||||
|
final VoidCallback onLeave;
|
||||||
|
final VoidCallback onComeBack;
|
||||||
|
|
||||||
const TodayPhotoButton({
|
const TodayPhotoButton({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
required this.onLeave,
|
||||||
|
required this.onComeBack,
|
||||||
this.data,
|
this.data,
|
||||||
this.type,
|
this.type,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -20,8 +24,12 @@ class TodayPhotoButton extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
Navigator.pushNamed(context, TimelineScreen.ID);
|
onLeave();
|
||||||
|
|
||||||
|
await Navigator.pushNamed(context, TimelineScreen.ID);
|
||||||
|
|
||||||
|
onComeBack();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 45,
|
width: 45,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user