mirror of
https://github.com/Myzel394/quid_faciam_hodie.git
synced 2025-06-19 07:35:26 +02:00
added sheet indicator
This commit is contained in:
parent
171633c907
commit
e0afe288b3
@ -15,6 +15,7 @@ import 'package:share_location/widgets/animate_in_builder.dart';
|
|||||||
import 'package:share_location/widgets/camera_button.dart';
|
import 'package:share_location/widgets/camera_button.dart';
|
||||||
import 'package:share_location/widgets/change_camera_button.dart';
|
import 'package:share_location/widgets/change_camera_button.dart';
|
||||||
import 'package:share_location/widgets/fade_and_move_in_animation.dart';
|
import 'package:share_location/widgets/fade_and_move_in_animation.dart';
|
||||||
|
import 'package:share_location/widgets/sheet_indicator.dart';
|
||||||
import 'package:share_location/widgets/today_photo_button.dart';
|
import 'package:share_location/widgets/today_photo_button.dart';
|
||||||
import 'package:share_location/widgets/uploading_photo.dart';
|
import 'package:share_location/widgets/uploading_photo.dart';
|
||||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||||
@ -292,64 +293,74 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
|||||||
topRight: Radius.circular(LARGE_SPACE),
|
topRight: Radius.circular(LARGE_SPACE),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.all(LARGE_SPACE),
|
children: <Widget>[
|
||||||
child: Row(
|
const Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
padding: EdgeInsets.symmetric(vertical: MEDIUM_SPACE),
|
||||||
children: <Widget>[
|
child: SheetIndicator(),
|
||||||
FadeAndMoveInAnimation(
|
),
|
||||||
translationDuration: DEFAULT_TRANSLATION_DURATION *
|
Padding(
|
||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
padding: const EdgeInsets.all(LARGE_SPACE),
|
||||||
opacityDuration: DEFAULT_OPACITY_DURATION *
|
child: Row(
|
||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
child: ChangeCameraButton(
|
children: <Widget>[
|
||||||
onChangeCamera: () {
|
FadeAndMoveInAnimation(
|
||||||
final currentCameraIndex = GlobalValuesManager.cameras
|
translationDuration: DEFAULT_TRANSLATION_DURATION *
|
||||||
.indexOf(controller!.description);
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
final availableCameras =
|
opacityDuration: DEFAULT_OPACITY_DURATION *
|
||||||
GlobalValuesManager.cameras.length;
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
|
child: ChangeCameraButton(
|
||||||
|
onChangeCamera: () {
|
||||||
|
final currentCameraIndex = GlobalValuesManager
|
||||||
|
.cameras
|
||||||
|
.indexOf(controller!.description);
|
||||||
|
final availableCameras =
|
||||||
|
GlobalValuesManager.cameras.length;
|
||||||
|
|
||||||
onNewCameraSelected(
|
onNewCameraSelected(
|
||||||
GlobalValuesManager.cameras[
|
GlobalValuesManager.cameras[
|
||||||
(currentCameraIndex + 1) % availableCameras],
|
(currentCameraIndex + 1) %
|
||||||
);
|
availableCameras],
|
||||||
},
|
);
|
||||||
),
|
},
|
||||||
),
|
),
|
||||||
FadeAndMoveInAnimation(
|
),
|
||||||
child: CameraButton(
|
FadeAndMoveInAnimation(
|
||||||
disabled: lockCamera,
|
child: CameraButton(
|
||||||
active: isRecording,
|
disabled: lockCamera,
|
||||||
onVideoBegin: () async {
|
active: isRecording,
|
||||||
setState(() {
|
onVideoBegin: () async {
|
||||||
isRecording = true;
|
setState(() {
|
||||||
});
|
isRecording = true;
|
||||||
|
});
|
||||||
|
|
||||||
if (controller!.value.isRecordingVideo) {
|
if (controller!.value.isRecordingVideo) {
|
||||||
// A recording has already started, do nothing.
|
// A recording has already started, do nothing.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await controller!.startVideoRecording();
|
await controller!.startVideoRecording();
|
||||||
},
|
},
|
||||||
onVideoEnd: takeVideo,
|
onVideoEnd: takeVideo,
|
||||||
onPhotoShot: takePhoto,
|
onPhotoShot: takePhoto,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
FadeAndMoveInAnimation(
|
||||||
|
translationDuration: DEFAULT_TRANSLATION_DURATION *
|
||||||
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
|
opacityDuration: DEFAULT_OPACITY_DURATION *
|
||||||
|
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
||||||
|
child: lastPhoto == null
|
||||||
|
? const TodayPhotoButton()
|
||||||
|
: TodayPhotoButton(
|
||||||
|
data: lastPhoto![0],
|
||||||
|
type: lastPhoto![1],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
FadeAndMoveInAnimation(
|
),
|
||||||
translationDuration: DEFAULT_TRANSLATION_DURATION *
|
],
|
||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
|
||||||
opacityDuration: DEFAULT_OPACITY_DURATION *
|
|
||||||
SECONDARY_BUTTONS_DURATION_MULTIPLIER,
|
|
||||||
child: lastPhoto == null
|
|
||||||
? const TodayPhotoButton()
|
|
||||||
: TodayPhotoButton(
|
|
||||||
data: lastPhoto![0],
|
|
||||||
type: lastPhoto![1],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
expandableContent: Padding(
|
expandableContent: Padding(
|
||||||
@ -392,8 +403,6 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
final newZoomLevelIndex =
|
final newZoomLevelIndex =
|
||||||
((currentZoomLevel + 1) % zoomLevels.length).toInt();
|
((currentZoomLevel + 1) % zoomLevels.length).toInt();
|
||||||
print(newZoomLevelIndex);
|
|
||||||
print(zoomLevels);
|
|
||||||
|
|
||||||
controller!.setZoomLevel(zoomLevels[newZoomLevelIndex]);
|
controller!.setZoomLevel(zoomLevels[newZoomLevelIndex]);
|
||||||
|
|
||||||
|
17
lib/widgets/sheet_indicator.dart
Normal file
17
lib/widgets/sheet_indicator.dart
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SheetIndicator extends StatelessWidget {
|
||||||
|
const SheetIndicator({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: 100,
|
||||||
|
height: 5,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white24,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user