flutter_demo_gps/lib/widgets/gps_position_widget_provide...

42 lines
1.1 KiB
Dart
Raw Permalink Normal View History

2022-10-18 15:07:13 +02:00
import 'package:flutter/material.dart';
import 'package:gps/provider/gps_model.dart';
import 'package:provider/provider.dart';
class GpsPositionWidget extends StatelessWidget {
const GpsPositionWidget({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Consumer<GpsModel>(
builder: (context, model, child) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Breite: ${model.currentLocation.latitude}',
),
Text(
'Länge: ${model.currentLocation.longitude}',
),
Text(
'Genauigkeit: ${model.currentLocation.accuracy}',
),
Text(
'Geschwindigkeit: ${model.currentLocation.speed}',
),
Text(
'Richtung: ${model.currentLocation.heading}',
),
Text(
'Satelliten: ${model.currentLocation.satelliteNumber}',
),
Text(
'Provider: ${model.currentLocation.provider}',
),
],
),
);
}
}