dart format updated

This commit is contained in:
Bijoy Ghosh
2024-04-05 09:23:42 +06:00
parent 5ed4f6c6cb
commit 65e886653e
4 changed files with 53 additions and 35 deletions

View File

@@ -1,12 +1,13 @@
import 'package:flutter/material.dart';
import 'package:map_camera_flutter/map_camera_flutter.dart';
void main() async{
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final cameras = await availableCameras();
final firstCamera = cameras.first;
runApp( MyApp(camera: firstCamera,));
runApp(MyApp(
camera: firstCamera,
));
}
class MyApp extends StatelessWidget {
@@ -22,7 +23,10 @@ class MyApp extends StatelessWidget {
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: MyHomePage(title: 'Camera With Map Location',camera: camera,),
home: MyHomePage(
title: 'Camera With Map Location',
camera: camera,
),
);
}
}
@@ -38,7 +42,6 @@ class MyHomePage extends StatefulWidget {
}
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
// TODO: implement initState
@@ -48,18 +51,19 @@ class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: MapCameraLocation(camera: widget.camera, onImageCaptured: (ImageAndLocationData data){
print('Captured image path: ${data.imagePath}');
print('Latitude: ${data.latitude}');
print('Longitude: ${data.longitude}');
print('Location name: ${data.locationName}');
print('Sublocation: ${data.subLocation}');
},)
);
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: MapCameraLocation(
camera: widget.camera,
onImageCaptured: (ImageAndLocationData data) {
print('Captured image path: ${data.imagePath}');
print('Latitude: ${data.latitude}');
print('Longitude: ${data.longitude}');
print('Location name: ${data.locationName}');
print('Sublocation: ${data.subLocation}');
},
));
}
}