Replacing SizedBox with Gap

This commit is contained in:
Yoshi 2024-08-04 11:48:25 +03:00
parent 8bce420296
commit 91e1757a20
11 changed files with 46 additions and 28 deletions

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:rain/app/controller/controller.dart';
import 'package:rain/app/widgets/status/status_weather.dart';
@ -62,7 +63,7 @@ class _WeatherCardContainerState extends State<WeatherCardContainer> {
fontWeight: FontWeight.w600,
),
),
const SizedBox(width: 7),
const Gap(7),
Text(
statusWeather.getText(widget.weather[weatherController
.getTime(widget.time, widget.timezone)]),
@ -73,7 +74,7 @@ class _WeatherCardContainerState extends State<WeatherCardContainer> {
),
],
),
const SizedBox(height: 10),
const Gap(10),
Text(
widget.district.isEmpty
? widget.city
@ -87,7 +88,7 @@ class _WeatherCardContainerState extends State<WeatherCardContainer> {
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 5),
const Gap(5),
StreamBuilder(
stream: Stream.periodic(const Duration(seconds: 1)),
builder: (context, snapshot) {
@ -103,7 +104,7 @@ class _WeatherCardContainerState extends State<WeatherCardContainer> {
],
),
),
const SizedBox(width: 5),
const Gap(5),
Image.asset(
statusWeather.getImageNow(
widget.weather[

View file

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:geolocator/geolocator.dart';
import 'package:get/get.dart';
import 'package:iconsax/iconsax.dart';
@ -360,7 +361,7 @@ class _SelectGeolocationState extends State<SelectGeolocation> {
margin: const EdgeInsets.only(
left: 10, right: 10, top: 10),
),
const SizedBox(height: 20),
const Gap(20),
],
),
),

View file

@ -1,3 +1,4 @@
import 'package:gap/gap.dart';
import 'package:rain/app/data/weather.dart';
import 'package:rain/app/modules/geolocation.dart';
import 'package:rain/app/widgets/button.dart';
@ -166,7 +167,7 @@ class OnboardContent extends StatelessWidget {
style: context.textTheme.titleLarge
?.copyWith(fontWeight: FontWeight.w600),
),
const SizedBox(height: 10),
const Gap(10),
SizedBox(
width: 300,
child: Text(

View file

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_hsvcolor_picker/flutter_hsvcolor_picker.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:gap/gap.dart';
import 'package:geolocator/geolocator.dart';
import 'package:get/get.dart';
import 'package:iconsax/iconsax.dart';
@ -162,7 +163,7 @@ class _SettingsPageState extends State<SettingsPage> {
setState(() {});
},
),
const SizedBox(height: 10),
const Gap(10),
],
),
);
@ -451,7 +452,7 @@ class _SettingsPageState extends State<SettingsPage> {
}
},
),
const SizedBox(height: 10),
const Gap(10),
],
),
);
@ -602,7 +603,7 @@ class _SettingsPageState extends State<SettingsPage> {
setState(() {});
},
),
const SizedBox(height: 10),
const Gap(10),
],
),
);
@ -819,7 +820,7 @@ class _SettingsPageState extends State<SettingsPage> {
);
},
),
const SizedBox(height: 10),
const Gap(10),
],
),
);
@ -887,7 +888,7 @@ class _SettingsPageState extends State<SettingsPage> {
);
},
),
const SizedBox(height: 10),
const Gap(10),
],
);
},
@ -938,7 +939,7 @@ class _SettingsPageState extends State<SettingsPage> {
onPressed: () => urlLauncher(
'https://yoomoney.ru/to/4100117672775961'),
),
const SizedBox(height: 10),
const Gap(10),
],
),
);
@ -1002,7 +1003,7 @@ class _SettingsPageState extends State<SettingsPage> {
}
},
),
const SizedBox(height: 10),
const Gap(10),
],
),
);
@ -1064,7 +1065,7 @@ class _SettingsPageState extends State<SettingsPage> {
onTap: () => urlLauncher('https://open-meteo.com/'),
),
),
const SizedBox(height: 10),
const Gap(10),
],
),
);

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:rain/app/widgets/status/status_weather.dart';
@ -47,7 +48,7 @@ class _ListDailyCardState extends State<ListDailyCard> {
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 5),
const Gap(5),
Text(
DateFormat.MMMMEEEEd(locale.languageCode)
.format(widget.timeDaily),
@ -56,7 +57,7 @@ class _ListDailyCardState extends State<ListDailyCard> {
fontWeight: FontWeight.w400,
),
),
const SizedBox(height: 5),
const Gap(5),
Text(
statusWeather.getText(widget.weathercodeDaily),
style: context.textTheme.titleMedium?.copyWith(
@ -67,7 +68,7 @@ class _ListDailyCardState extends State<ListDailyCard> {
],
),
),
const SizedBox(width: 5),
const Gap(5),
Image.asset(
statusWeather.getImageNowDaily(widget.weathercodeDaily),
scale: 6.5,

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:rain/app/data/weather.dart';
@ -80,7 +81,7 @@ class _WeatherDailyState extends State<WeatherDaily> {
.getImage7Day(weatherCodeDaily[index]),
scale: 3,
),
const SizedBox(width: 5),
const Gap(5),
Expanded(
child: Text(
statusWeather

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
class DescWeather extends StatefulWidget {
@ -38,7 +39,7 @@ class _DescWeatherState extends State<DescWeather> {
widget.imageName,
scale: 20,
),
const SizedBox(height: 5),
const Gap(5),
Text(
widget.value,
style: textTheme.labelLarge,

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_glow/flutter_glow.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:rain/app/widgets/status/status_data.dart';
@ -43,7 +44,7 @@ class _WeatherNowState extends State<WeatherNow> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 15),
const Gap(15),
Image(
image: AssetImage(statusWeather.getImageNow(widget.weather,
widget.time, widget.timeDay, widget.timeNight)),
@ -61,7 +62,7 @@ class _WeatherNowState extends State<WeatherNow> {
statusWeather.getText(widget.weather),
style: context.textTheme.titleLarge,
),
const SizedBox(height: 5),
const Gap(5),
Text(
DateFormat.MMMMEEEEd(locale.languageCode).format(
DateTime.parse(widget.time),
@ -93,7 +94,7 @@ class _WeatherNowState extends State<WeatherNow> {
color: Colors.grey,
),
),
const SizedBox(height: 5),
const Gap(5),
Text(
statusWeather.getText(widget.weather),
style: context.textTheme.titleLarge
@ -109,7 +110,7 @@ class _WeatherNowState extends State<WeatherNow> {
style: context.textTheme.bodyMedium),
],
),
const SizedBox(height: 30),
const Gap(30),
Text(
statusData.getDegree(roundDegree
? widget.degree.round()
@ -118,7 +119,7 @@ class _WeatherNowState extends State<WeatherNow> {
fontWeight: FontWeight.w800,
),
),
const SizedBox(height: 5),
const Gap(5),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gap/gap.dart';
import 'package:rain/app/widgets/status/status_data.dart';
class SunsetSunrise extends StatefulWidget {
@ -44,7 +45,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
style: titleSmall,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 2),
const Gap(2),
Text(
statusData.getTimeFormat(widget.timeSunrise),
style: titleLarge,
@ -52,7 +53,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
],
),
),
const SizedBox(width: 5),
const Gap(5),
Flexible(
child: Image.asset(
'assets/images/sunrise.png',
@ -75,7 +76,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
style: titleSmall,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 2),
const Gap(2),
Text(
statusData.getTimeFormat(widget.timeSunset),
style: titleLarge,
@ -83,7 +84,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
],
),
),
const SizedBox(width: 5),
const Gap(5),
Flexible(
child: Image.asset(
'assets/images/sunset.png',

View file

@ -430,6 +430,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.0"
gap:
dependency: "direct main"
description:
name: gap
sha256: f19387d4e32f849394758b91377f9153a1b41d79513ef7668c088c77dbc6955d
url: "https://pub.dev"
source: hosted
version: "3.0.1"
geocoding:
dependency: "direct main"
description:

View file

@ -14,6 +14,7 @@ dependencies:
flutter_localizations:
sdk: flutter
get: ^4.6.6
gap: ^3.0.1
dio: ^5.5.0+1
intl: ^0.19.0
isar: