images, fix ui

This commit is contained in:
Yoshi 2023-01-22 21:28:43 +03:00
parent f8f0ebbb92
commit f2a802da98
25 changed files with 166 additions and 120 deletions

BIN
assets/images/01d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/images/01n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets/images/02d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/images/02n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/images/03d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/images/03n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/images/04d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/images/04n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/images/09d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
assets/images/09n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
assets/images/10d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
assets/images/10n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
assets/images/11d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/images/11n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
assets/images/13d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
assets/images/13n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
assets/images/50d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/images/50n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
assets/images/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -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<WeatherPage> {
},
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<WeatherPage> {
);
},
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<WeatherPage> {
),
),
),
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°',
),
),
),
],
),
),

View file

View file

@ -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),
),
],
),
],
),
);
}
}

View file

@ -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,
),
],
);
}
}

View file

@ -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:

View file

@ -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