diff --git a/assets/images/01d.png b/assets/images/01d.png new file mode 100644 index 0000000..7a41cbc Binary files /dev/null and b/assets/images/01d.png differ diff --git a/assets/images/01n.png b/assets/images/01n.png new file mode 100644 index 0000000..a865cb6 Binary files /dev/null and b/assets/images/01n.png differ diff --git a/assets/images/02d.png b/assets/images/02d.png new file mode 100644 index 0000000..456f687 Binary files /dev/null and b/assets/images/02d.png differ diff --git a/assets/images/02n.png b/assets/images/02n.png new file mode 100644 index 0000000..ad333a0 Binary files /dev/null and b/assets/images/02n.png differ diff --git a/assets/images/03d.png b/assets/images/03d.png new file mode 100644 index 0000000..b21cdbc Binary files /dev/null and b/assets/images/03d.png differ diff --git a/assets/images/03n.png b/assets/images/03n.png new file mode 100644 index 0000000..b21cdbc Binary files /dev/null and b/assets/images/03n.png differ diff --git a/assets/images/04d.png b/assets/images/04d.png new file mode 100644 index 0000000..dace0ef Binary files /dev/null and b/assets/images/04d.png differ diff --git a/assets/images/04n.png b/assets/images/04n.png new file mode 100644 index 0000000..dace0ef Binary files /dev/null and b/assets/images/04n.png differ diff --git a/assets/images/09d.png b/assets/images/09d.png new file mode 100644 index 0000000..dc6d54d Binary files /dev/null and b/assets/images/09d.png differ diff --git a/assets/images/09n.png b/assets/images/09n.png new file mode 100644 index 0000000..a1ec783 Binary files /dev/null and b/assets/images/09n.png differ diff --git a/assets/images/10d.png b/assets/images/10d.png new file mode 100644 index 0000000..dc6d54d Binary files /dev/null and b/assets/images/10d.png differ diff --git a/assets/images/10n.png b/assets/images/10n.png new file mode 100644 index 0000000..a1ec783 Binary files /dev/null and b/assets/images/10n.png differ diff --git a/assets/images/11d.png b/assets/images/11d.png new file mode 100644 index 0000000..e8ab42d Binary files /dev/null and b/assets/images/11d.png differ diff --git a/assets/images/11n.png b/assets/images/11n.png new file mode 100644 index 0000000..cdafda1 Binary files /dev/null and b/assets/images/11n.png differ diff --git a/assets/images/13d.png b/assets/images/13d.png new file mode 100644 index 0000000..3079834 Binary files /dev/null and b/assets/images/13d.png differ diff --git a/assets/images/13n.png b/assets/images/13n.png new file mode 100644 index 0000000..3079834 Binary files /dev/null and b/assets/images/13n.png differ diff --git a/assets/images/50d.png b/assets/images/50d.png new file mode 100644 index 0000000..50866b5 Binary files /dev/null and b/assets/images/50d.png differ diff --git a/assets/images/50n.png b/assets/images/50n.png new file mode 100644 index 0000000..28a7de2 Binary files /dev/null and b/assets/images/50n.png differ diff --git a/assets/images/map.png b/assets/images/map.png new file mode 100644 index 0000000..f7a97d9 Binary files /dev/null and b/assets/images/map.png differ diff --git a/lib/app/modules/weather.dart b/lib/app/modules/weather.dart index 96e1236..a7bd72b 100644 --- a/lib/app/modules/weather.dart +++ b/lib/app/modules/weather.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_glow/flutter_glow.dart'; import 'package:get/get.dart'; -import 'package:iconsax/iconsax.dart'; import 'package:intl/intl.dart'; import 'package:rain/app/widgets/desc.dart'; +import 'package:rain/app/widgets/weather_7days.dart'; +import 'package:rain/app/widgets/weather_today.dart'; class WeatherPage extends StatefulWidget { const WeatherPage({super.key}); @@ -27,39 +28,40 @@ class _WeatherPageState extends State { }, child: ListView( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () {}, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Icon( - Iconsax.location, - size: 16, - ), - const SizedBox(width: 3), - Text( - 'Ростов-на-Дону, Россия', - style: context.theme.textTheme.headline6, - ), - const SizedBox(width: 3), - const Icon( - Icons.arrow_drop_down_outlined, - size: 16, - ), - ], + Padding( + padding: const EdgeInsets.only(top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'assets/images/map.png', + scale: 35, + ), + const SizedBox(width: 5), + Text( + 'Ростов-на-Дону, Россия', + style: context.theme.textTheme.headline6, + ), + const Icon( + Icons.arrow_drop_down_outlined, + size: 16, + ), + ], + ), ), - ), - IconButton( - alignment: Alignment.centerRight, - onPressed: () {}, - icon: const Icon(Iconsax.sun_1), - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - ), - ], + GestureDetector( + onTap: () {}, + child: Image.asset( + 'assets/images/01d.png', + scale: 5, + ), + ), + ], + ), ), SizedBox( height: 350, @@ -132,85 +134,11 @@ class _WeatherPageState extends State { ); }, scrollDirection: Axis.horizontal, - itemCount: 10, - itemBuilder: (ctx, i) => Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Text( - '00:00', - style: context.theme.primaryTextTheme.subtitle1, - ), - Image.asset( - 'assets/images/snow_2d.png', - scale: 5, - ), - Text( - '-2.6°', - style: context.theme.textTheme.headline3, - ), - ], - ), - ), - ), - Container( - height: 355, - margin: const EdgeInsets.only(bottom: 15), - padding: - const EdgeInsets.symmetric(horizontal: 15, vertical: 5), - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - context.theme.backgroundColor, - context.theme.primaryColor - ], - ), - borderRadius: - const BorderRadius.all(Radius.circular(20))), - child: ListView.builder( - physics: const BouncingScrollPhysics(), - itemCount: 7, - itemBuilder: (ctx, i) => Container( - margin: const EdgeInsets.symmetric(vertical: 12), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - DateFormat.EEEE('${locale?.languageCode}') - .format(DateTime.now()), - style: context.theme.primaryTextTheme.subtitle1 - ?.copyWith(fontSize: 16), - ), - Row( - children: [ - Image.asset( - 'assets/images/sunny_2d.png', - scale: 5, - ), - const SizedBox(width: 5), - Text( - 'Солнечно', - style: context.theme.primaryTextTheme.subtitle1 - ?.copyWith(fontSize: 16), - ), - ], - ), - Row( - children: [ - Text( - '1.4°', - style: context.theme.textTheme.headline3 - ?.copyWith(fontSize: 16), - ), - const SizedBox(width: 5), - Text( - '-5.6°', - style: context.theme.primaryTextTheme.subtitle1 - ?.copyWith(fontSize: 16), - ), - ], - ), - ], - ), + itemCount: 24, + itemBuilder: (ctx, i) => const WeatherToday( + time: '00:00', + weather: 'assets/images/sunny_2d.png', + degree: '-2.6', ), ), ), @@ -281,6 +209,32 @@ class _WeatherPageState extends State { ), ), ), + Container( + height: 355, + margin: const EdgeInsets.only(bottom: 15), + padding: + const EdgeInsets.symmetric(horizontal: 15, vertical: 5), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + context.theme.backgroundColor, + context.theme.primaryColor + ], + ), + borderRadius: + const BorderRadius.all(Radius.circular(20))), + child: ListView.builder( + physics: const BouncingScrollPhysics(), + itemCount: 7, + itemBuilder: (ctx, i) => Weather7Days( + locale: locale!, + image: 'assets/images/sunny_2d.png', + weather: 'Грозы', + minDegree: '1.4°', + maxDegree: '-5.3°', + ), + ), + ), ], ), ), diff --git a/lib/app/services/isar_services.dart b/lib/app/services/isar_services.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/app/widgets/weather_7days.dart b/lib/app/widgets/weather_7days.dart new file mode 100644 index 0000000..443f25e --- /dev/null +++ b/lib/app/widgets/weather_7days.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:intl/intl.dart'; + +class Weather7Days extends StatelessWidget { + const Weather7Days({ + super.key, + required this.locale, + required this.image, + required this.weather, + required this.minDegree, + required this.maxDegree, + }); + final Locale locale; + final String image; + final String weather; + final String minDegree; + final String maxDegree; + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.symmetric(vertical: 12), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + DateFormat.EEEE(locale.languageCode).format(DateTime.now()), + style: context.theme.primaryTextTheme.subtitle1 + ?.copyWith(fontSize: 16), + ), + Row( + children: [ + Image.asset( + image, + scale: 5, + ), + const SizedBox(width: 5), + Text( + weather, + style: context.theme.primaryTextTheme.subtitle1 + ?.copyWith(fontSize: 16), + ), + ], + ), + Row( + children: [ + Text( + minDegree, + style: + context.theme.textTheme.headline3?.copyWith(fontSize: 16), + ), + const SizedBox(width: 5), + Text( + minDegree, + style: context.theme.primaryTextTheme.subtitle1 + ?.copyWith(fontSize: 16), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/app/widgets/weather_today.dart b/lib/app/widgets/weather_today.dart new file mode 100644 index 0000000..81142a1 --- /dev/null +++ b/lib/app/widgets/weather_today.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +class WeatherToday extends StatelessWidget { + const WeatherToday({ + super.key, + required this.time, + required this.weather, + required this.degree, + }); + final String time; + final String weather; + final String degree; + + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text( + time, + style: context.theme.primaryTextTheme.subtitle1, + ), + Image.asset( + weather, + scale: 5, + ), + Text( + degree, + style: context.theme.textTheme.headline3, + ), + ], + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index e96d45f..e3a978d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -329,13 +329,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.2" - iconsax: - dependency: "direct main" - description: - name: iconsax - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.8" image: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 11841a5..aefd1ca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,6 @@ dependencies: dio: ^4.0.6 isar: ^3.0.5 intl: ^0.17.0 - iconsax: ^0.0.8 shimmer: ^2.0.0 flutter_glow: ^0.2.0 path_provider: ^2.0.11