diff --git a/assets/example/images/background.png b/assets/example/images/background.png deleted file mode 100644 index a67b6e5..0000000 Binary files a/assets/example/images/background.png and /dev/null differ diff --git a/assets/example/images/clock.png b/assets/example/images/clock.png deleted file mode 100644 index 6e4ff8a..0000000 Binary files a/assets/example/images/clock.png and /dev/null differ diff --git a/assets/example/images/light-1.png b/assets/example/images/light-1.png deleted file mode 100644 index 6ee0da3..0000000 Binary files a/assets/example/images/light-1.png and /dev/null differ diff --git a/assets/example/images/light-2.png b/assets/example/images/light-2.png deleted file mode 100644 index 6b422f0..0000000 Binary files a/assets/example/images/light-2.png and /dev/null differ diff --git a/assets/example/images/mainImage.png b/assets/example/images/mainImage.png deleted file mode 100644 index 0b359f5..0000000 Binary files a/assets/example/images/mainImage.png and /dev/null differ diff --git a/assets/images/121843-200.png b/assets/images/121843-200.png new file mode 100644 index 0000000..647a08c Binary files /dev/null and b/assets/images/121843-200.png differ diff --git a/assets/images/icons8-night-wind-48.png b/assets/images/icons8-night-wind-48.png new file mode 100644 index 0000000..e099498 Binary files /dev/null and b/assets/images/icons8-night-wind-48.png differ diff --git a/assets/images/icons8-partly-cloudy-day-48.png b/assets/images/icons8-partly-cloudy-day-48.png new file mode 100644 index 0000000..656834a Binary files /dev/null and b/assets/images/icons8-partly-cloudy-day-48.png differ diff --git a/assets/images/image-removebg-preview (1).png b/assets/images/image-removebg-preview (1).png new file mode 100644 index 0000000..50f1ae6 Binary files /dev/null and b/assets/images/image-removebg-preview (1).png differ diff --git a/assets/images/image-removebg-preview (2).png b/assets/images/image-removebg-preview (2).png new file mode 100644 index 0000000..4f91819 Binary files /dev/null and b/assets/images/image-removebg-preview (2).png differ diff --git a/assets/images/image-removebg-preview.png b/assets/images/image-removebg-preview.png new file mode 100644 index 0000000..df81835 Binary files /dev/null and b/assets/images/image-removebg-preview.png differ diff --git a/assets/images/moon.png b/assets/images/moon.png new file mode 100644 index 0000000..2ea0550 Binary files /dev/null and b/assets/images/moon.png differ diff --git a/assets/images/moon1.png b/assets/images/moon1.png new file mode 100644 index 0000000..7e80a38 Binary files /dev/null and b/assets/images/moon1.png differ diff --git a/assets/images/sun.png b/assets/images/sun.png new file mode 100644 index 0000000..de7c98d Binary files /dev/null and b/assets/images/sun.png differ diff --git a/assets/images/sun1.png b/assets/images/sun1.png new file mode 100644 index 0000000..7207cab Binary files /dev/null and b/assets/images/sun1.png differ diff --git a/assets/images/sun_4814489.png b/assets/images/sun_4814489.png new file mode 100644 index 0000000..eb603e9 Binary files /dev/null and b/assets/images/sun_4814489.png differ diff --git a/assets/images/weather /2682801_cloudy_fog_foggy_mist_moon_icon.png b/assets/images/weather /2682801_cloudy_fog_foggy_mist_moon_icon.png new file mode 100644 index 0000000..0a90925 Binary files /dev/null and b/assets/images/weather /2682801_cloudy_fog_foggy_mist_moon_icon.png differ diff --git a/assets/images/weather /2682802_cloudy_day_fog_foggy_mist_icon.png b/assets/images/weather /2682802_cloudy_day_fog_foggy_mist_icon.png new file mode 100644 index 0000000..8eb0b71 Binary files /dev/null and b/assets/images/weather /2682802_cloudy_day_fog_foggy_mist_icon.png differ diff --git a/assets/images/weather /2682807_drop_high_humidity_percentage_precipitation_icon.png b/assets/images/weather /2682807_drop_high_humidity_percentage_precipitation_icon.png new file mode 100644 index 0000000..e779695 Binary files /dev/null and b/assets/images/weather /2682807_drop_high_humidity_percentage_precipitation_icon.png differ diff --git a/assets/images/weather /2682808_high_hot_summer_temperature_termometer_icon.png b/assets/images/weather /2682808_high_hot_summer_temperature_termometer_icon.png new file mode 100644 index 0000000..bea6c71 Binary files /dev/null and b/assets/images/weather /2682808_high_hot_summer_temperature_termometer_icon.png differ diff --git a/assets/images/weather /2682809_cold_freezing_low_temperature_termometer_icon.png b/assets/images/weather /2682809_cold_freezing_low_temperature_termometer_icon.png new file mode 100644 index 0000000..5f12c2e Binary files /dev/null and b/assets/images/weather /2682809_cold_freezing_low_temperature_termometer_icon.png differ diff --git a/assets/images/weather /2682824_horizont_morning_sun_sunrise_weather_icon.png b/assets/images/weather /2682824_horizont_morning_sun_sunrise_weather_icon.png new file mode 100644 index 0000000..71962a2 Binary files /dev/null and b/assets/images/weather /2682824_horizont_morning_sun_sunrise_weather_icon.png differ diff --git a/assets/images/weather /2682825_evening_horizon_sun_sundown_sunset_icon.png b/assets/images/weather /2682825_evening_horizon_sun_sundown_sunset_icon.png new file mode 100644 index 0000000..ab86352 Binary files /dev/null and b/assets/images/weather /2682825_evening_horizon_sun_sundown_sunset_icon.png differ diff --git a/assets/images/weather /2682827_cloud_day_light bolt_rain_sun_icon.png b/assets/images/weather /2682827_cloud_day_light bolt_rain_sun_icon.png new file mode 100644 index 0000000..199057d Binary files /dev/null and b/assets/images/weather /2682827_cloud_day_light bolt_rain_sun_icon.png differ diff --git a/assets/images/weather /2682835_cloud_cloudy_forecast_precipitation_rain_icon.png b/assets/images/weather /2682835_cloud_cloudy_forecast_precipitation_rain_icon.png new file mode 100644 index 0000000..33ec878 Binary files /dev/null and b/assets/images/weather /2682835_cloud_cloudy_forecast_precipitation_rain_icon.png differ diff --git a/assets/images/weather /2682839_drop_forecast_humidity_precipitation_rain_icon.png b/assets/images/weather /2682839_drop_forecast_humidity_precipitation_rain_icon.png new file mode 100644 index 0000000..45f0d36 Binary files /dev/null and b/assets/images/weather /2682839_drop_forecast_humidity_precipitation_rain_icon.png differ diff --git a/assets/images/weather /2682840_bolt_elictricity_light_lightning_storm_icon.svg b/assets/images/weather /2682840_bolt_elictricity_light_lightning_storm_icon.svg new file mode 100644 index 0000000..a1107d2 --- /dev/null +++ b/assets/images/weather /2682840_bolt_elictricity_light_lightning_storm_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/weather /2682842_breeze_fast_speed_weather_wind_icon.png b/assets/images/weather /2682842_breeze_fast_speed_weather_wind_icon.png new file mode 100644 index 0000000..11188de Binary files /dev/null and b/assets/images/weather /2682842_breeze_fast_speed_weather_wind_icon.png differ diff --git a/assets/images/weather /2682848_day_forecast_sun_sunny_weather_icon.png b/assets/images/weather /2682848_day_forecast_sun_sunny_weather_icon.png new file mode 100644 index 0000000..8c8e358 Binary files /dev/null and b/assets/images/weather /2682848_day_forecast_sun_sunny_weather_icon.png differ diff --git a/assets/images/wind_4161247.png b/assets/images/wind_4161247.png new file mode 100644 index 0000000..1ca8cdb Binary files /dev/null and b/assets/images/wind_4161247.png differ diff --git a/lib/main.dart b/lib/main.dart index a725658..a6bf6f6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'screens/home_screen.dart'; import 'package:flutter/material.dart'; void main() { @@ -10,11 +11,9 @@ class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { return const MaterialApp( - home: Scaffold( - body: Center( - child: Text('Hello World!'), - ), - ), + title: 'Weather App', + home: HomeScreen(), + debugShowCheckedModeBanner: false, ); } } diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart new file mode 100644 index 0000000..93e5d6c --- /dev/null +++ b/lib/screens/home_screen.dart @@ -0,0 +1,105 @@ +import 'package:flutter/material.dart'; +import 'package:weather_app/widgets/daily_weather.dart'; +import 'package:weather_app/widgets/hourly_weather.dart'; +import 'package:weather_app/widgets/weather_card.dart'; +import 'package:weather_app/widgets/indicators.dart'; + +class HomeScreen extends StatelessWidget { + const HomeScreen({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return Scaffold( + + body: Center( + + child: Container( + + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [ + Color.fromARGB(255, 59, 213, 252), + Color.fromARGB(255, 2, 4, 117), + ], + )), + + child: const Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + WeatherCard( + city: 'Khobar', + image: Image( + image: AssetImage("assets/images/sun_4814489.png"), + width: 190), + conditions: 'Partly cloudy', + degree: '25°c', + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IndicatorCard( + image: Image( + image: AssetImage("assets/images/image-removebg-preview (1).png")), + indicator: 'Wind', + level: '15 km/h', + ), + IndicatorCard( + image: Image( + image: AssetImage("assets/images/image-removebg-preview.png")), + indicator: 'Humidity', + level: '34 %', + ), + IndicatorCard( + image: Image( + image: AssetImage("assets/images/image-removebg-preview (2).png")), + indicator: 'Rain', + level: '56 %', + ), + + ]), + SizedBox(height: 25,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + HourlyWeather(time: 'Now', degree: '25°c'), + HourlyWeather(time: '5PM', degree: '24°c'), + HourlyWeather(time: '6PM', degree: '24°c'), + HourlyWeather(time: '7PM', degree: '23°c'), + HourlyWeather(time: '8PM', degree: '22°c'), + HourlyWeather(time: '9PM', degree: '22°c'), + ], + ), + SizedBox(height: 30,), + DailyWeather( + day: 'Mon', + high: '25°c', + low: '20°c'), + DailyWeather( + day: 'Tue', + high: '23°c', + low: '20°c'), + DailyWeather( + day: 'Wed', + high: '24°c', + low: '21°c'), + DailyWeather( + day: 'Thu', + high: '25°c', + low: '23°c'), + DailyWeather( + day: 'Fri', + high: '26°c', + low: '19°c'), + SizedBox(height: 20,), + ], + ))), + ), + ); + } +} diff --git a/lib/widgets/daily_weather.dart b/lib/widgets/daily_weather.dart new file mode 100644 index 0000000..c6f9895 --- /dev/null +++ b/lib/widgets/daily_weather.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; + +// ignore: camel_case_types +class DailyWeather extends StatelessWidget { + const DailyWeather({ + super.key, + required this.day, + required this.high, + required this.low, + }); + + final String day; + final String high; + final String low; + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 400, + height: 50, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Flexible( + child: Text( + day, + textAlign: TextAlign.left, + style: const TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + const SizedBox( + height: 20, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Flexible( + child: Text( + low, + textAlign: TextAlign.left, + style: const TextStyle( + color: Color.fromARGB(255, 195, 217, 255), + fontSize: 20, + ), + ), + ), + ], + ), + const SizedBox( + height: 10, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Flexible( + child: Text( + high, + textAlign: TextAlign.left, + style: const TextStyle( + color: Color.fromARGB(255, 195, 217, 255), + fontSize: 20, + ), + ), + ), + ], + ), + ], + )); + } +} diff --git a/lib/widgets/hourly_weather.dart b/lib/widgets/hourly_weather.dart new file mode 100644 index 0000000..9bdff64 --- /dev/null +++ b/lib/widgets/hourly_weather.dart @@ -0,0 +1,53 @@ +import 'package:flutter/material.dart'; + +// ignore: camel_case_types +class HourlyWeather extends StatelessWidget { + const HourlyWeather({ + super.key, + required this.time, + required this.degree, + }); + + final String time; + final String degree; + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 70, + height: 70, + + + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + + children: [ + + Flexible( + child: Text( + time, + textAlign: TextAlign.left, + style: const TextStyle( + color: Color.fromARGB(255, 195, 217, 255), + fontSize: 20, + ), + ), + ), + const SizedBox(height: 15,), + Flexible( + child: Text( + degree, + textAlign: TextAlign.left, + style: const TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + + + )); + } +} diff --git a/lib/widgets/indicators.dart b/lib/widgets/indicators.dart new file mode 100644 index 0000000..8ea6a89 --- /dev/null +++ b/lib/widgets/indicators.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; + +// ignore: camel_case_types +class IndicatorCard extends StatelessWidget { + const IndicatorCard({ + super.key, + required this.image, + required this.indicator, + required this.level, + }); + + final Image image; + final String indicator; + final String level; + + @override + Widget build(BuildContext context) { + return Container( + width: 120, + height: 120, + + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(30)), + color: const Color.fromARGB(255, 255, 255, 255).withOpacity(0.25)), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + + children: [ + Flexible(child: image), + Flexible( + child: Text( + level, + textAlign: TextAlign.left, + style: const TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + Flexible( + child: Text( + indicator, + textAlign: TextAlign.left, + style: const TextStyle( + color: Color.fromARGB(255, 195, 217, 255), + fontSize: 20, + ), + ), + ), + ], + + + )); + } +} diff --git a/lib/widgets/weather_card.dart b/lib/widgets/weather_card.dart new file mode 100644 index 0000000..0c80537 --- /dev/null +++ b/lib/widgets/weather_card.dart @@ -0,0 +1,66 @@ +import 'package:flutter/material.dart'; + +// ignore: camel_case_types +class WeatherCard extends StatelessWidget { + const WeatherCard({ + super.key, + required this.city, + required this.image, + required this.conditions, + required this.degree, + }); + + final String city; + final Image image; + final String conditions; + final String degree; + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 400, + height: 300, + + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Flexible( + child: Text( + city, + textAlign: TextAlign.left, + style: const TextStyle( + color: Colors.white, + fontSize: 40, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 15,), + + Flexible( + child: Text( + degree, + textAlign: TextAlign.left, + style: const TextStyle( + color: Colors.white, + fontSize: 40, + fontWeight: FontWeight.bold, + ), + ), + ), + Flexible( + child: Text( + conditions, + textAlign: TextAlign.left, + style: const TextStyle( + color: Colors.white, + fontSize: 25, + ), + ), + ), + ], + ) + , + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 2b23063..69b1c96 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -95,10 +95,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -124,18 +124,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -172,9 +172,9 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.2 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6bac6b8..be59e6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -52,7 +52,7 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - - assets/example/images/ + - assets/images/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware # For details regarding adding assets from package dependencies, see