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