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( builder: (context, model, child) => Column( mainAxisAlignment: MainAxisAlignment.center, children: [ 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}', ), ], ), ); } }