Release 4.8.0 - 2024-05-26
This commit is contained in:
@ -3,11 +3,13 @@ import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
|
||||
class CustomCameraView extends StatefulWidget {
|
||||
final Function(String) onImageCaptured;
|
||||
final Destination? destination;
|
||||
|
||||
const CustomCameraView({Key? key, required this.onImageCaptured}) : super(key: key);
|
||||
const CustomCameraView({Key? key, required this.onImageCaptured, required this.destination}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CustomCameraViewState createState() => _CustomCameraViewState();
|
||||
@ -19,11 +21,13 @@ class _CustomCameraViewState extends State<CustomCameraView> {
|
||||
int _selectedCameraIndex = 0;
|
||||
double _currentScale = 1.0;
|
||||
FlashMode _currentFlashMode = FlashMode.off;
|
||||
Destination? destination;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initializeCamera();
|
||||
destination = widget.destination;
|
||||
}
|
||||
|
||||
Future<void> _initializeCamera() async {
|
||||
@ -98,7 +102,25 @@ class _CustomCameraViewState extends State<CustomCameraView> {
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
CameraPreview(_controller!),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 60.0), // 上部に60ピクセルのパディングを追加
|
||||
child: CameraPreview(_controller!),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 120.0,
|
||||
left: 16.0,
|
||||
right: 16.0,
|
||||
child: Center(
|
||||
child: Text(
|
||||
destination?.tags ?? '',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 16.0,
|
||||
left: 16.0,
|
||||
|
||||
Reference in New Issue
Block a user