.Net MAUI | Weather App | Using OpenWeather Api

115 Просмотры
Издатель
#.netMaui #WeatherApp #openweatherApi

If you are a .NET developer, I'm sure you recently heard about .NET MAUI. Let's learn about .NET MAUI together by making a Weather App

POCO for weatherdata

public class WeatherData
{
[JsonProperty("name")]
public string Title { get; set; }

[JsonProperty("coord")]
public Coord Coord { get; set; }

[JsonProperty("weather")]
public Weather[] Weather { get; set; }

[JsonProperty("base")]
public string Base { get; set; }

[JsonProperty("main")]
public Main Main { get; set; }

[JsonProperty("visibility")]
public long Visibility { get; set; }

[JsonProperty("wind")]
public Wind Wind { get; set; }

[JsonProperty("clouds")]
public Clouds Clouds { get; set; }

[JsonProperty("dt")]
public long Dt { get; set; }

[JsonProperty("sys")]
public Sys Sys { get; set; }

[JsonProperty("id")]
public long Id { get; set; }

[JsonProperty("cod")]
public long Cod { get; set; }
}


public class Clouds
{
[JsonProperty("all")]
public long All { get; set; }
}

public class Coord
{
[JsonProperty("lon")]
public double Lon { get; set; }

[JsonProperty("lat")]
public double Lat { get; set; }
}

public class Main
{
[JsonProperty("temp")]
public double Temperature { get; set; }

[JsonProperty("pressure")]
public long Pressure { get; set; }

[JsonProperty("humidity")]
public long Humidity { get; set; }

[JsonProperty("temp_min")]
public double TempMin { get; set; }

[JsonProperty("temp_max")]
public double TempMax { get; set; }
}

public class Sys
{
[JsonProperty("type")]
public long Type { get; set; }

[JsonProperty("id")]
public long Id { get; set; }

[JsonProperty("message")]
public double Message { get; set; }

[JsonProperty("country")]
public string Country { get; set; }

[JsonProperty("sunrise")]
public long Sunrise { get; set; }

[JsonProperty("sunset")]
public long Sunset { get; set; }
}

public class Weather
{
[JsonProperty("id")]
public long Id { get; set; }

[JsonProperty("main")]
public string Visibility { get; set; }

[JsonProperty("description")]
public string Description { get; set; }

[JsonProperty("icon")]
public string Icon { get; set; }
}

public class Wind
{
[JsonProperty("speed")]
public double Speed { get; set; }

[JsonProperty("deg")]
public long Deg { get; set; }
}

----------------------------------------------------------------------------------------------------------------------------------------------------------

#DotNetMAUI
#MAUI
#Xamarin
#maui
#xamarin
#android
#dotnet
#.net
#weatherapp
#androidweatherapp

formula
celcius = (fah - 32) * 5 / 9;

Source code
https://github.com/SyedMohsinAliZaidi/.NetMAUIWeatherApp

follow me on instagram
https://www.instagram.com/codingwithzaidi/?igshid=1jdu9k0ayywu1
Категория
Разработка на Flutter
Комментариев нет.