mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-28 20:19:58 +00:00
parent
4a67ddf35a
commit
c54398d6b0
20 changed files with 2064 additions and 653 deletions
|
@ -27,7 +27,7 @@ class WeatherAPI {
|
||||||
: urlHourly = baseUrlHourly;
|
: urlHourly = baseUrlHourly;
|
||||||
|
|
||||||
String baseUrlDaily =
|
String baseUrlDaily =
|
||||||
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max&forecast_days=10&timezone=auto';
|
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max,uv_index_max,rain_sum,winddirection_10m_dominant&forecast_days=10&timezone=auto';
|
||||||
String urlDaily;
|
String urlDaily;
|
||||||
settings.degrees == 'fahrenheit'
|
settings.degrees == 'fahrenheit'
|
||||||
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
||||||
|
@ -68,6 +68,10 @@ class WeatherAPI {
|
||||||
weatherDataDaily.daily.precipitationProbabilityMax,
|
weatherDataDaily.daily.precipitationProbabilityMax,
|
||||||
windspeed10MMax: weatherDataDaily.daily.windspeed10MMax,
|
windspeed10MMax: weatherDataDaily.daily.windspeed10MMax,
|
||||||
windgusts10MMax: weatherDataDaily.daily.windgusts10MMax,
|
windgusts10MMax: weatherDataDaily.daily.windgusts10MMax,
|
||||||
|
uvIndexMax: weatherDataDaily.daily.uvIndexMax,
|
||||||
|
rainSum: weatherDataDaily.daily.rainSum,
|
||||||
|
winddirection10MDominant:
|
||||||
|
weatherDataDaily.daily.winddirection10MDominant,
|
||||||
timezone: weatherDataHourly.timezone,
|
timezone: weatherDataHourly.timezone,
|
||||||
timestamp: DateTime.now(),
|
timestamp: DateTime.now(),
|
||||||
);
|
);
|
||||||
|
@ -121,7 +125,7 @@ class WeatherAPI {
|
||||||
: urlHourly = baseUrlHourly;
|
: urlHourly = baseUrlHourly;
|
||||||
|
|
||||||
String baseUrlDaily =
|
String baseUrlDaily =
|
||||||
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max&forecast_days=10&timezone=auto';
|
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max,uv_index_max,rain_sum,winddirection_10m_dominant&forecast_days=10&timezone=auto';
|
||||||
String urlDaily;
|
String urlDaily;
|
||||||
settings.degrees == 'fahrenheit'
|
settings.degrees == 'fahrenheit'
|
||||||
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
||||||
|
@ -162,6 +166,10 @@ class WeatherAPI {
|
||||||
weatherDataDaily.daily.precipitationProbabilityMax,
|
weatherDataDaily.daily.precipitationProbabilityMax,
|
||||||
windspeed10MMax: weatherDataDaily.daily.windspeed10MMax,
|
windspeed10MMax: weatherDataDaily.daily.windspeed10MMax,
|
||||||
windgusts10MMax: weatherDataDaily.daily.windgusts10MMax,
|
windgusts10MMax: weatherDataDaily.daily.windgusts10MMax,
|
||||||
|
uvIndexMax: weatherDataDaily.daily.uvIndexMax,
|
||||||
|
rainSum: weatherDataDaily.daily.rainSum,
|
||||||
|
winddirection10MDominant:
|
||||||
|
weatherDataDaily.daily.winddirection10MDominant,
|
||||||
lat: lat,
|
lat: lat,
|
||||||
lon: lon,
|
lon: lon,
|
||||||
city: city,
|
city: city,
|
||||||
|
|
|
@ -25,6 +25,9 @@ class Daily {
|
||||||
this.precipitationProbabilityMax,
|
this.precipitationProbabilityMax,
|
||||||
this.windspeed10MMax,
|
this.windspeed10MMax,
|
||||||
this.windgusts10MMax,
|
this.windgusts10MMax,
|
||||||
|
this.uvIndexMax,
|
||||||
|
this.rainSum,
|
||||||
|
this.winddirection10MDominant,
|
||||||
});
|
});
|
||||||
|
|
||||||
List<DateTime>? time;
|
List<DateTime>? time;
|
||||||
|
@ -39,6 +42,9 @@ class Daily {
|
||||||
List<int>? precipitationProbabilityMax;
|
List<int>? precipitationProbabilityMax;
|
||||||
List<double>? windspeed10MMax;
|
List<double>? windspeed10MMax;
|
||||||
List<double>? windgusts10MMax;
|
List<double>? windgusts10MMax;
|
||||||
|
List<double>? uvIndexMax;
|
||||||
|
List<double>? rainSum;
|
||||||
|
List<int>? winddirection10MDominant;
|
||||||
|
|
||||||
factory Daily.fromJson(Map<String, dynamic> json) => Daily(
|
factory Daily.fromJson(Map<String, dynamic> json) => Daily(
|
||||||
time: List<DateTime>.from(json["time"].map((x) => DateTime.parse(x))),
|
time: List<DateTime>.from(json["time"].map((x) => DateTime.parse(x))),
|
||||||
|
@ -61,5 +67,9 @@ class Daily {
|
||||||
List<double>.from(json["windspeed_10m_max"].map((x) => x)),
|
List<double>.from(json["windspeed_10m_max"].map((x) => x)),
|
||||||
windgusts10MMax:
|
windgusts10MMax:
|
||||||
List<double>.from(json["windgusts_10m_max"].map((x) => x)),
|
List<double>.from(json["windgusts_10m_max"].map((x) => x)),
|
||||||
|
uvIndexMax: List<double>.from(json["uv_index_max"].map((x) => x)),
|
||||||
|
rainSum: List<double>.from(json["rain_sum"].map((x) => x)),
|
||||||
|
winddirection10MDominant:
|
||||||
|
List<int>.from(json["winddirection_10m_dominant"].map((x) => x)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,10 @@ class LocationController extends GetxController {
|
||||||
_weatherCard.value.precipitationProbabilityMax;
|
_weatherCard.value.precipitationProbabilityMax;
|
||||||
element.windspeed10MMax = _weatherCard.value.windspeed10MMax;
|
element.windspeed10MMax = _weatherCard.value.windspeed10MMax;
|
||||||
element.windgusts10MMax = _weatherCard.value.windgusts10MMax;
|
element.windgusts10MMax = _weatherCard.value.windgusts10MMax;
|
||||||
|
element.uvIndexMax = _weatherCard.value.uvIndexMax;
|
||||||
|
element.rainSum = _weatherCard.value.rainSum;
|
||||||
|
element.winddirection10MDominant =
|
||||||
|
_weatherCard.value.winddirection10MDominant;
|
||||||
element.timestamp = DateTime.now();
|
element.timestamp = DateTime.now();
|
||||||
await isar.weatherCards.put(element);
|
await isar.weatherCards.put(element);
|
||||||
}
|
}
|
||||||
|
@ -350,6 +354,10 @@ class LocationController extends GetxController {
|
||||||
_weatherCard.value.precipitationProbabilityMax;
|
_weatherCard.value.precipitationProbabilityMax;
|
||||||
weatherCard.windspeed10MMax = _weatherCard.value.windspeed10MMax;
|
weatherCard.windspeed10MMax = _weatherCard.value.windspeed10MMax;
|
||||||
weatherCard.windgusts10MMax = _weatherCard.value.windgusts10MMax;
|
weatherCard.windgusts10MMax = _weatherCard.value.windgusts10MMax;
|
||||||
|
weatherCard.uvIndexMax = _weatherCard.value.uvIndexMax;
|
||||||
|
weatherCard.rainSum = _weatherCard.value.rainSum;
|
||||||
|
weatherCard.winddirection10MDominant =
|
||||||
|
_weatherCard.value.winddirection10MDominant;
|
||||||
weatherCard.timestamp = DateTime.now();
|
weatherCard.timestamp = DateTime.now();
|
||||||
await isar.weatherCards.put(weatherCard);
|
await isar.weatherCards.put(weatherCard);
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,6 +45,9 @@ class MainWeatherCache {
|
||||||
List<int>? precipitationProbabilityMax;
|
List<int>? precipitationProbabilityMax;
|
||||||
List<double>? windspeed10MMax;
|
List<double>? windspeed10MMax;
|
||||||
List<double>? windgusts10MMax;
|
List<double>? windgusts10MMax;
|
||||||
|
List<double>? uvIndexMax;
|
||||||
|
List<double>? rainSum;
|
||||||
|
List<int>? winddirection10MDominant;
|
||||||
String? timezone;
|
String? timezone;
|
||||||
DateTime? timestamp;
|
DateTime? timestamp;
|
||||||
|
|
||||||
|
@ -76,6 +79,9 @@ class MainWeatherCache {
|
||||||
this.precipitationProbabilityMax,
|
this.precipitationProbabilityMax,
|
||||||
this.windspeed10MMax,
|
this.windspeed10MMax,
|
||||||
this.windgusts10MMax,
|
this.windgusts10MMax,
|
||||||
|
this.uvIndexMax,
|
||||||
|
this.rainSum,
|
||||||
|
this.winddirection10MDominant,
|
||||||
this.timezone,
|
this.timezone,
|
||||||
this.timestamp,
|
this.timestamp,
|
||||||
});
|
});
|
||||||
|
@ -127,6 +133,9 @@ class WeatherCard {
|
||||||
List<int>? precipitationProbabilityMax;
|
List<int>? precipitationProbabilityMax;
|
||||||
List<double>? windspeed10MMax;
|
List<double>? windspeed10MMax;
|
||||||
List<double>? windgusts10MMax;
|
List<double>? windgusts10MMax;
|
||||||
|
List<double>? uvIndexMax;
|
||||||
|
List<double>? rainSum;
|
||||||
|
List<int>? winddirection10MDominant;
|
||||||
double? lat;
|
double? lat;
|
||||||
double? lon;
|
double? lon;
|
||||||
String? city;
|
String? city;
|
||||||
|
@ -162,6 +171,9 @@ class WeatherCard {
|
||||||
this.precipitationProbabilityMax,
|
this.precipitationProbabilityMax,
|
||||||
this.windspeed10MMax,
|
this.windspeed10MMax,
|
||||||
this.windgusts10MMax,
|
this.windgusts10MMax,
|
||||||
|
this.uvIndexMax,
|
||||||
|
this.rainSum,
|
||||||
|
this.winddirection10MDominant,
|
||||||
this.lat,
|
this.lat,
|
||||||
this.lon,
|
this.lon,
|
||||||
this.city,
|
this.city,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,6 @@ import 'package:rain/app/controller/controller.dart';
|
||||||
import 'package:rain/app/data/weather.dart';
|
import 'package:rain/app/data/weather.dart';
|
||||||
import 'package:rain/app/modules/weather_card.dart';
|
import 'package:rain/app/modules/weather_card.dart';
|
||||||
import 'package:rain/app/widgets/card.dart';
|
import 'package:rain/app/widgets/card.dart';
|
||||||
import 'package:rain/app/widgets/create_card_weather.dart';
|
|
||||||
import 'package:rain/app/widgets/shimmer.dart';
|
import 'package:rain/app/widgets/shimmer.dart';
|
||||||
|
|
||||||
class CardWeather extends StatefulWidget {
|
class CardWeather extends StatefulWidget {
|
||||||
|
@ -20,148 +19,133 @@ class _CardWeatherState extends State<CardWeather> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return RefreshIndicator(
|
||||||
body: RefreshIndicator(
|
onRefresh: () async {
|
||||||
onRefresh: () async {
|
await locationController.updateCacheCard(true);
|
||||||
await locationController.updateCacheCard(true);
|
setState(() {});
|
||||||
setState(() {});
|
},
|
||||||
},
|
child: StreamBuilder<List<WeatherCard>>(
|
||||||
child: StreamBuilder<List<WeatherCard>>(
|
stream: locationController.getWeatherCard(),
|
||||||
stream: locationController.getWeatherCard(),
|
builder: (context, listData) {
|
||||||
builder: (context, listData) {
|
switch (listData.connectionState) {
|
||||||
switch (listData.connectionState) {
|
case ConnectionState.done:
|
||||||
case ConnectionState.done:
|
default:
|
||||||
default:
|
if (listData.hasData) {
|
||||||
if (listData.hasData) {
|
final weatherCard = listData.data!;
|
||||||
final weatherCard = listData.data!;
|
if (weatherCard.isEmpty) {
|
||||||
if (weatherCard.isEmpty) {
|
return Center(
|
||||||
return Center(
|
child: SingleChildScrollView(
|
||||||
child: SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
Image.asset(
|
||||||
Image.asset(
|
'assets/images/add_weather.png',
|
||||||
'assets/images/add_weather.png',
|
scale: 6,
|
||||||
scale: 6,
|
),
|
||||||
),
|
SizedBox(
|
||||||
SizedBox(
|
width: Get.size.width * 0.8,
|
||||||
width: Get.size.width * 0.8,
|
child: Text(
|
||||||
child: Text(
|
'noWeatherCard'.tr,
|
||||||
'noWeatherCard'.tr,
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
style:
|
||||||
style: context.theme.textTheme.titleMedium
|
context.theme.textTheme.titleMedium?.copyWith(
|
||||||
?.copyWith(
|
fontWeight: FontWeight.w600,
|
||||||
fontWeight: FontWeight.w600,
|
fontSize: 18,
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
);
|
|
||||||
}
|
|
||||||
return ListView.builder(
|
|
||||||
itemCount: weatherCard.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final weatherCardList = weatherCard[index];
|
|
||||||
return Dismissible(
|
|
||||||
key: ValueKey(weatherCardList),
|
|
||||||
direction: DismissDirection.endToStart,
|
|
||||||
background: Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
right: 15,
|
|
||||||
),
|
|
||||||
child: Icon(
|
|
||||||
Iconsax.trash,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
confirmDismiss: (DismissDirection direction) async {
|
|
||||||
return await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
backgroundColor:
|
|
||||||
context.theme.colorScheme.primaryContainer,
|
|
||||||
title: Text(
|
|
||||||
"deletedCardWeather".tr,
|
|
||||||
style: context.theme.textTheme.titleLarge,
|
|
||||||
),
|
|
||||||
content: Text("deletedCardWeatherQuery".tr,
|
|
||||||
style: context.theme.textTheme.titleMedium),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Get.back(result: false),
|
|
||||||
child: Text("cancel".tr,
|
|
||||||
style: context
|
|
||||||
.theme.textTheme.titleMedium
|
|
||||||
?.copyWith(
|
|
||||||
color: Colors.blueAccent))),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Get.back(result: true),
|
|
||||||
child: Text("delete".tr,
|
|
||||||
style: context
|
|
||||||
.theme.textTheme.titleMedium
|
|
||||||
?.copyWith(color: Colors.red))),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onDismissed: (DismissDirection direction) async {
|
|
||||||
await locationController
|
|
||||||
.deleteCardWeather(weatherCardList);
|
|
||||||
},
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () => Get.to(
|
|
||||||
() => WeatherCardPage(
|
|
||||||
weatherCard: weatherCardList,
|
|
||||||
),
|
|
||||||
transition: Transition.downToUp),
|
|
||||||
child: CardDescWeather(
|
|
||||||
time: weatherCardList.time!,
|
|
||||||
timeDaily: weatherCardList.timeDaily!,
|
|
||||||
timeDay: weatherCardList.sunrise!,
|
|
||||||
timeNight: weatherCardList.sunset!,
|
|
||||||
weather: weatherCardList.weathercode!,
|
|
||||||
degree: weatherCardList.temperature2M!,
|
|
||||||
district: weatherCardList.district!,
|
|
||||||
city: weatherCardList.city!,
|
|
||||||
timezone: weatherCardList.timezone!,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return ListView.builder(
|
|
||||||
itemCount: 10,
|
|
||||||
itemBuilder: (context, index) => const MyShimmer(
|
|
||||||
hight: 110,
|
|
||||||
edgeInsetsMargin:
|
|
||||||
EdgeInsets.symmetric(vertical: 8, horizontal: 10),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
return ListView.builder(
|
||||||
},
|
itemCount: weatherCard.length,
|
||||||
),
|
itemBuilder: (context, index) {
|
||||||
),
|
final weatherCardList = weatherCard[index];
|
||||||
floatingActionButton: FloatingActionButton(
|
return Dismissible(
|
||||||
onPressed: () => showModalBottomSheet(
|
key: ValueKey(weatherCardList),
|
||||||
enableDrag: false,
|
direction: DismissDirection.endToStart,
|
||||||
backgroundColor: context.theme.colorScheme.secondaryContainer,
|
background: Container(
|
||||||
context: context,
|
alignment: Alignment.centerRight,
|
||||||
isScrollControlled: true,
|
child: const Padding(
|
||||||
builder: (BuildContext context) {
|
padding: EdgeInsets.only(
|
||||||
return const CreateWeatherCard();
|
right: 15,
|
||||||
},
|
),
|
||||||
),
|
child: Icon(
|
||||||
backgroundColor: context.theme.colorScheme.tertiaryContainer,
|
Iconsax.trash,
|
||||||
child: const Icon(Iconsax.add),
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
confirmDismiss: (DismissDirection direction) async {
|
||||||
|
return await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
backgroundColor:
|
||||||
|
context.theme.colorScheme.primaryContainer,
|
||||||
|
title: Text(
|
||||||
|
"deletedCardWeather".tr,
|
||||||
|
style: context.theme.textTheme.titleLarge,
|
||||||
|
),
|
||||||
|
content: Text("deletedCardWeatherQuery".tr,
|
||||||
|
style: context.theme.textTheme.titleMedium),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Get.back(result: false),
|
||||||
|
child: Text("cancel".tr,
|
||||||
|
style: context
|
||||||
|
.theme.textTheme.titleMedium
|
||||||
|
?.copyWith(
|
||||||
|
color: Colors.blueAccent))),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Get.back(result: true),
|
||||||
|
child: Text("delete".tr,
|
||||||
|
style: context
|
||||||
|
.theme.textTheme.titleMedium
|
||||||
|
?.copyWith(color: Colors.red))),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
onDismissed: (DismissDirection direction) async {
|
||||||
|
await locationController
|
||||||
|
.deleteCardWeather(weatherCardList);
|
||||||
|
},
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () => Get.to(
|
||||||
|
() => WeatherCardPage(
|
||||||
|
weatherCard: weatherCardList,
|
||||||
|
),
|
||||||
|
transition: Transition.downToUp),
|
||||||
|
child: CardDescWeather(
|
||||||
|
time: weatherCardList.time!,
|
||||||
|
timeDaily: weatherCardList.timeDaily!,
|
||||||
|
timeDay: weatherCardList.sunrise!,
|
||||||
|
timeNight: weatherCardList.sunset!,
|
||||||
|
weather: weatherCardList.weathercode!,
|
||||||
|
degree: weatherCardList.temperature2M!,
|
||||||
|
district: weatherCardList.district!,
|
||||||
|
city: weatherCardList.city!,
|
||||||
|
timezone: weatherCardList.timezone!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: 10,
|
||||||
|
itemBuilder: (context, index) => const MyShimmer(
|
||||||
|
hight: 110,
|
||||||
|
edgeInsetsMargin:
|
||||||
|
EdgeInsets.symmetric(vertical: 8, horizontal: 10),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:rain/app/controller/controller.dart';
|
||||||
import 'package:rain/app/modules/card_weather.dart';
|
import 'package:rain/app/modules/card_weather.dart';
|
||||||
import 'package:rain/app/modules/settings.dart';
|
import 'package:rain/app/modules/settings.dart';
|
||||||
import 'package:rain/app/modules/weather.dart';
|
import 'package:rain/app/modules/weather.dart';
|
||||||
|
import 'package:rain/app/widgets/create_card_weather.dart';
|
||||||
import 'package:rain/main.dart';
|
import 'package:rain/main.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
|
@ -54,11 +55,11 @@ class _HomePageState extends State<HomePage> {
|
||||||
);
|
);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
surfaceTintColor: Colors.transparent,
|
surfaceTintColor: Colors.transparent,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: Image.asset(
|
leading: Image.asset(
|
||||||
|
@ -212,6 +213,21 @@ class _HomePageState extends State<HomePage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
floatingActionButton: tabIndex == 1
|
||||||
|
? FloatingActionButton(
|
||||||
|
onPressed: () => showModalBottomSheet(
|
||||||
|
enableDrag: false,
|
||||||
|
backgroundColor: context.theme.colorScheme.secondaryContainer,
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return const CreateWeatherCard();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
backgroundColor: context.theme.colorScheme.tertiaryContainer,
|
||||||
|
child: const Icon(Iconsax.add),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -176,13 +176,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
||||||
Obx(
|
Obx(
|
||||||
() => locationController.isLoading.isFalse
|
() => locationController.isLoading.isFalse
|
||||||
? WeatherDaily(
|
? WeatherDaily(
|
||||||
date: locationController.mainWeather.timeDaily!,
|
mainWeatherCache: locationController.mainWeather,
|
||||||
weather:
|
|
||||||
locationController.mainWeather.weathercodeDaily!,
|
|
||||||
minDegree:
|
|
||||||
locationController.mainWeather.temperature2MMin!,
|
|
||||||
maxDegree:
|
|
||||||
locationController.mainWeather.temperature2MMax!,
|
|
||||||
onTap: () => Get.to(
|
onTap: () => Get.to(
|
||||||
() => WeatherMore(
|
() => WeatherMore(
|
||||||
mainWeatherCache: locationController.mainWeather,
|
mainWeatherCache: locationController.mainWeather,
|
||||||
|
|
|
@ -57,10 +57,11 @@ class _WeatherCardPageState extends State<WeatherCardPage> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
surfaceTintColor: Colors.transparent,
|
surfaceTintColor: Colors.transparent,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
|
@ -172,10 +173,7 @@ class _WeatherCardPageState extends State<WeatherCardPage> {
|
||||||
uvIndex: widget.weatherCard.uvIndex![timeNow],
|
uvIndex: widget.weatherCard.uvIndex![timeNow],
|
||||||
),
|
),
|
||||||
WeatherDaily(
|
WeatherDaily(
|
||||||
date: widget.weatherCard.timeDaily!,
|
weatherCard: widget.weatherCard,
|
||||||
weather: widget.weatherCard.weathercodeDaily!,
|
|
||||||
minDegree: widget.weatherCard.temperature2MMin!,
|
|
||||||
maxDegree: widget.weatherCard.temperature2MMax!,
|
|
||||||
onTap: () => Get.to(
|
onTap: () => Get.to(
|
||||||
() => WeatherMore(
|
() => WeatherMore(
|
||||||
weatherCard: widget.weatherCard,
|
weatherCard: widget.weatherCard,
|
||||||
|
|
|
@ -93,16 +93,17 @@ class _CardDescWeatherState extends State<CardDescWeather> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
StreamBuilder(
|
StreamBuilder(
|
||||||
stream: Stream.periodic(const Duration(seconds: 1)),
|
stream: Stream.periodic(const Duration(seconds: 1)),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return Text(
|
return Text(
|
||||||
'${'time'.tr}: ${statusImFa.getTimeFormatTz(tz.TZDateTime.now(tz.getLocation(widget.timezone)))}',
|
'${'time'.tr}: ${statusImFa.getTimeFormatTz(tz.TZDateTime.now(tz.getLocation(widget.timezone)))}',
|
||||||
style: context.theme.textTheme.titleMedium?.copyWith(
|
style: context.theme.textTheme.titleMedium?.copyWith(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_glow/flutter_glow.dart';
|
import 'package:flutter_glow/flutter_glow.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:iconsax/iconsax.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:rain/app/widgets/desc.dart';
|
import 'package:rain/app/widgets/desc.dart';
|
||||||
|
import 'package:rain/app/widgets/message.dart';
|
||||||
import 'package:rain/app/widgets/status.dart';
|
import 'package:rain/app/widgets/status.dart';
|
||||||
import 'package:rain/app/widgets/status_im_fa.dart';
|
import 'package:rain/app/widgets/status_im_fa.dart';
|
||||||
import 'package:rain/app/widgets/sunset_sunrise.dart';
|
import 'package:rain/app/widgets/sunset_sunrise.dart';
|
||||||
|
|
||||||
class DailyCard extends StatelessWidget {
|
class DailyCard extends StatefulWidget {
|
||||||
const DailyCard({
|
const DailyCard({
|
||||||
super.key,
|
super.key,
|
||||||
this.timeDaily,
|
this.timeDaily,
|
||||||
|
@ -22,128 +24,230 @@ class DailyCard extends StatelessWidget {
|
||||||
this.precipitationProbabilityMax,
|
this.precipitationProbabilityMax,
|
||||||
this.windspeed10MMax,
|
this.windspeed10MMax,
|
||||||
this.windgusts10MMax,
|
this.windgusts10MMax,
|
||||||
|
this.uvIndexMax,
|
||||||
|
this.rainSum,
|
||||||
|
this.winddirection10MDominant,
|
||||||
|
required this.index,
|
||||||
});
|
});
|
||||||
final DateTime? timeDaily;
|
final List<DateTime>? timeDaily;
|
||||||
final int? weathercodeDaily;
|
final List<int>? weathercodeDaily;
|
||||||
final double? temperature2MMax;
|
final List<double>? temperature2MMax;
|
||||||
final double? temperature2MMin;
|
final List<double>? temperature2MMin;
|
||||||
final double? apparentTemperatureMax;
|
final List<double>? apparentTemperatureMax;
|
||||||
final double? apparentTemperatureMin;
|
final List<double>? apparentTemperatureMin;
|
||||||
final String? sunrise;
|
final List<String>? sunrise;
|
||||||
final String? sunset;
|
final List<String>? sunset;
|
||||||
final double? precipitationSum;
|
final List<double>? precipitationSum;
|
||||||
final int? precipitationProbabilityMax;
|
final List<int>? precipitationProbabilityMax;
|
||||||
final double? windspeed10MMax;
|
final List<double>? windspeed10MMax;
|
||||||
final double? windgusts10MMax;
|
final List<double>? windgusts10MMax;
|
||||||
|
final List<double>? uvIndexMax;
|
||||||
|
final List<double>? rainSum;
|
||||||
|
final List<int>? winddirection10MDominant;
|
||||||
|
final int index;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DailyCard> createState() => _DailyCardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DailyCardState extends State<DailyCard> {
|
||||||
|
final locale = Get.locale;
|
||||||
|
final status = Status();
|
||||||
|
final statusImFa = StatusImFa();
|
||||||
|
final message = Message();
|
||||||
|
late PageController pageController;
|
||||||
|
int pageIndex = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
pageController = PageController(initialPage: widget.index);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
pageController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final locale = Get.locale;
|
return Scaffold(
|
||||||
final status = Status();
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
final statusImFa = StatusImFa();
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
return Container(
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
surfaceTintColor: Colors.transparent,
|
||||||
child: Column(
|
elevation: 0,
|
||||||
children: [
|
centerTitle: true,
|
||||||
Column(
|
leading: IconButton(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
onPressed: () {
|
||||||
children: [
|
Get.back();
|
||||||
const SizedBox(height: 15),
|
},
|
||||||
Image(
|
icon: const Icon(
|
||||||
image: AssetImage(
|
Iconsax.arrow_left_1,
|
||||||
status.getImageNowDaily(weathercodeDaily!, timeDaily!)),
|
size: 20,
|
||||||
fit: BoxFit.fill,
|
|
||||||
height: 200,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
GlowText(
|
|
||||||
'${statusImFa.getDegree(temperature2MMin!.round())} / ${statusImFa.getDegree(temperature2MMax!.round())}',
|
|
||||||
style: context.theme.textTheme.titleLarge?.copyWith(
|
|
||||||
fontSize: 30,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
status.getText(weathercodeDaily!),
|
|
||||||
style: context.theme.textTheme.titleLarge,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
DateFormat.MMMMEEEEd(locale?.languageCode).format(timeDaily!),
|
|
||||||
style: context.theme.textTheme.labelLarge?.copyWith(
|
|
||||||
color: Colors.grey,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Padding(
|
splashColor: Colors.transparent,
|
||||||
padding: const EdgeInsets.only(top: 15),
|
highlightColor: Colors.transparent,
|
||||||
child: SunsetSunrise(
|
),
|
||||||
timeSunrise: sunrise!,
|
title: Text(
|
||||||
timeSunset: sunset!,
|
DateFormat.MMMMEEEEd(locale?.languageCode)
|
||||||
),
|
.format(widget.timeDaily![pageIndex]),
|
||||||
),
|
style: context.theme.textTheme.titleLarge,
|
||||||
Container(
|
),
|
||||||
margin: const EdgeInsets.only(bottom: 15),
|
),
|
||||||
padding: const EdgeInsets.only(top: 20, bottom: 5),
|
body: SafeArea(
|
||||||
decoration: BoxDecoration(
|
child: PageView.builder(
|
||||||
color: context.theme.colorScheme.primaryContainer,
|
controller: pageController,
|
||||||
borderRadius: const BorderRadius.all(
|
onPageChanged: (index) {
|
||||||
Radius.circular(20),
|
setState(() {
|
||||||
|
pageIndex = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
itemCount: widget.timeDaily?.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
Image(
|
||||||
|
image: AssetImage(status.getImageNowDaily(
|
||||||
|
widget.weathercodeDaily![index],
|
||||||
|
widget.timeDaily![index])),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
height: 200,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
GlowText(
|
||||||
|
'${statusImFa.getDegree(widget.temperature2MMin![index].round())} / ${statusImFa.getDegree(widget.temperature2MMax![index].round())}',
|
||||||
|
style: context.theme.textTheme.titleLarge?.copyWith(
|
||||||
|
fontSize: 30,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
status.getText(widget.weathercodeDaily![index]),
|
||||||
|
style: context.theme.textTheme.titleLarge,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
DateFormat.MMMMEEEEd(locale?.languageCode)
|
||||||
|
.format(widget.timeDaily![index]),
|
||||||
|
style: context.theme.textTheme.labelLarge?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 15),
|
||||||
|
child: SunsetSunrise(
|
||||||
|
timeSunrise: widget.sunrise![index],
|
||||||
|
timeSunset: widget.sunset![index],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 15),
|
||||||
|
padding: const EdgeInsets.only(top: 20, bottom: 5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: context.theme.colorScheme.primaryContainer,
|
||||||
|
borderRadius: const BorderRadius.all(
|
||||||
|
Radius.circular(20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/cold.png',
|
||||||
|
value: statusImFa.getDegree(widget
|
||||||
|
.apparentTemperatureMin![index]
|
||||||
|
.round()),
|
||||||
|
desc: 'apparentTemperatureMin'.tr,
|
||||||
|
),
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/hot.png',
|
||||||
|
value: statusImFa.getDegree(widget
|
||||||
|
.apparentTemperatureMax![index]
|
||||||
|
.round()),
|
||||||
|
desc: 'apparentTemperatureMax'.tr,
|
||||||
|
),
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/uv.png',
|
||||||
|
value: '${widget.uvIndexMax![index].round()}',
|
||||||
|
desc: 'uvIndex'.tr,
|
||||||
|
message: message.getUvIndex(
|
||||||
|
widget.uvIndexMax![index].round()),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/windsock.png',
|
||||||
|
value:
|
||||||
|
'${widget.winddirection10MDominant![index]}°',
|
||||||
|
desc: 'direction'.tr,
|
||||||
|
message: message.getDirection(
|
||||||
|
widget.winddirection10MDominant![index]),
|
||||||
|
),
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/wind.png',
|
||||||
|
value: statusImFa.getSpeed(
|
||||||
|
widget.windspeed10MMax![index].round()),
|
||||||
|
desc: 'wind'.tr,
|
||||||
|
),
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/windgusts.png',
|
||||||
|
value: statusImFa.getSpeed(
|
||||||
|
widget.windgusts10MMax![index].round()),
|
||||||
|
desc: 'windgusts'.tr,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/humidity.png',
|
||||||
|
value:
|
||||||
|
'${widget.precipitationProbabilityMax![index]}%',
|
||||||
|
desc: 'precipitationProbabilit'.tr,
|
||||||
|
),
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/water.png',
|
||||||
|
value: statusImFa
|
||||||
|
.getPrecipitation(widget.rainSum![index]),
|
||||||
|
desc: 'rain'.tr,
|
||||||
|
),
|
||||||
|
DescWeather(
|
||||||
|
imageName: 'assets/images/rainfall.png',
|
||||||
|
value: statusImFa.getPrecipitation(
|
||||||
|
widget.precipitationSum![index]),
|
||||||
|
desc: 'precipitation'.tr,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
child: Column(
|
},
|
||||||
children: [
|
),
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
DescWeather(
|
|
||||||
imageName: 'assets/images/humidity.png',
|
|
||||||
value: '$precipitationProbabilityMax%',
|
|
||||||
desc: 'precipitationProbabilit'.tr,
|
|
||||||
),
|
|
||||||
DescWeather(
|
|
||||||
imageName: 'assets/images/wind.png',
|
|
||||||
value: statusImFa.getSpeed(windspeed10MMax!.round()),
|
|
||||||
desc: 'wind'.tr,
|
|
||||||
),
|
|
||||||
DescWeather(
|
|
||||||
imageName: 'assets/images/windgusts.png',
|
|
||||||
value: statusImFa.getSpeed(windgusts10MMax!.round()),
|
|
||||||
desc: 'windgusts'.tr,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
DescWeather(
|
|
||||||
imageName: 'assets/images/rainfall.png',
|
|
||||||
value: statusImFa.getPrecipitation(precipitationSum!),
|
|
||||||
desc: 'precipitation'.tr,
|
|
||||||
),
|
|
||||||
DescWeather(
|
|
||||||
imageName: 'assets/images/cold.png',
|
|
||||||
value:
|
|
||||||
statusImFa.getDegree(apparentTemperatureMin!.round()),
|
|
||||||
desc: 'apparentTemperatureMin'.tr,
|
|
||||||
),
|
|
||||||
DescWeather(
|
|
||||||
imageName: 'assets/images/hot.png',
|
|
||||||
value:
|
|
||||||
statusImFa.getDegree(apparentTemperatureMax!.round()),
|
|
||||||
desc: 'apparentTemperatureMax'.tr,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
75
lib/app/widgets/list_daily_card.dart
Normal file
75
lib/app/widgets/list_daily_card.dart
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:rain/app/widgets/status.dart';
|
||||||
|
import 'package:rain/app/widgets/status_im_fa.dart';
|
||||||
|
|
||||||
|
class ListCardDaily extends StatelessWidget {
|
||||||
|
const ListCardDaily({
|
||||||
|
super.key,
|
||||||
|
this.timeDaily,
|
||||||
|
this.weathercodeDaily,
|
||||||
|
this.temperature2MMax,
|
||||||
|
this.temperature2MMin,
|
||||||
|
});
|
||||||
|
final DateTime? timeDaily;
|
||||||
|
final int? weathercodeDaily;
|
||||||
|
final double? temperature2MMax;
|
||||||
|
final double? temperature2MMin;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final locale = Get.locale;
|
||||||
|
final status = Status();
|
||||||
|
final statusImFa = StatusImFa();
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
color: context.theme.colorScheme.primaryContainer,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${statusImFa.getDegree(temperature2MMin!.round())} / ${statusImFa.getDegree(temperature2MMax!.round())}',
|
||||||
|
style: context.theme.textTheme.titleLarge?.copyWith(
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
DateFormat.MMMMEEEEd(locale?.languageCode).format(timeDaily!),
|
||||||
|
style: context.theme.textTheme.titleMedium?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
status.getText(weathercodeDaily!),
|
||||||
|
style: context.theme.textTheme.titleMedium?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 5),
|
||||||
|
Image.asset(
|
||||||
|
status.getImageNowDaily(weathercodeDaily!, timeDaily!),
|
||||||
|
scale: 6.5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,22 +1,20 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:rain/app/data/weather.dart';
|
||||||
|
import 'package:rain/app/widgets/daily_card.dart';
|
||||||
import 'package:rain/app/widgets/status.dart';
|
import 'package:rain/app/widgets/status.dart';
|
||||||
import 'package:rain/app/widgets/status_im_fa.dart';
|
import 'package:rain/app/widgets/status_im_fa.dart';
|
||||||
|
|
||||||
class WeatherDaily extends StatefulWidget {
|
class WeatherDaily extends StatefulWidget {
|
||||||
const WeatherDaily({
|
const WeatherDaily({
|
||||||
super.key,
|
super.key,
|
||||||
required this.date,
|
this.mainWeatherCache,
|
||||||
required this.weather,
|
this.weatherCard,
|
||||||
required this.minDegree,
|
|
||||||
required this.maxDegree,
|
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
});
|
});
|
||||||
final List<DateTime> date;
|
final MainWeatherCache? mainWeatherCache;
|
||||||
final List<int> weather;
|
final WeatherCard? weatherCard;
|
||||||
final List<double> minDegree;
|
|
||||||
final List<double> maxDegree;
|
|
||||||
final Function() onTap;
|
final Function() onTap;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -50,70 +48,130 @@ class _WeatherDailyState extends State<WeatherDaily> {
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemCount: 7,
|
itemCount: 7,
|
||||||
itemBuilder: (ctx, i) {
|
itemBuilder: (ctx, i) {
|
||||||
return Container(
|
return InkWell(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 12),
|
onTap: () => Get.to(
|
||||||
child: Row(
|
() => DailyCard(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
timeDaily: widget.mainWeatherCache?.timeDaily ??
|
||||||
children: [
|
widget.weatherCard?.timeDaily,
|
||||||
Expanded(
|
weathercodeDaily:
|
||||||
child: Text(
|
widget.mainWeatherCache?.weathercodeDaily ??
|
||||||
DateFormat.EEEE(locale?.languageCode)
|
widget.weatherCard?.weathercodeDaily,
|
||||||
.format(widget.date[i]),
|
temperature2MMax:
|
||||||
style: context.theme.textTheme.labelLarge,
|
widget.mainWeatherCache?.temperature2MMax ??
|
||||||
|
widget.weatherCard?.temperature2MMax,
|
||||||
|
temperature2MMin:
|
||||||
|
widget.mainWeatherCache?.temperature2MMin ??
|
||||||
|
widget.weatherCard?.temperature2MMin,
|
||||||
|
apparentTemperatureMax: widget
|
||||||
|
.mainWeatherCache?.apparentTemperatureMax ??
|
||||||
|
widget.weatherCard?.apparentTemperatureMax,
|
||||||
|
apparentTemperatureMin: widget
|
||||||
|
.mainWeatherCache?.apparentTemperatureMin ??
|
||||||
|
widget.weatherCard?.apparentTemperatureMin,
|
||||||
|
sunrise: widget.mainWeatherCache?.sunrise ??
|
||||||
|
widget.weatherCard?.sunrise,
|
||||||
|
sunset: widget.mainWeatherCache?.sunset ??
|
||||||
|
widget.weatherCard?.sunset,
|
||||||
|
precipitationSum:
|
||||||
|
widget.mainWeatherCache?.precipitationSum ??
|
||||||
|
widget.weatherCard?.precipitationSum,
|
||||||
|
precipitationProbabilityMax: widget.mainWeatherCache
|
||||||
|
?.precipitationProbabilityMax ??
|
||||||
|
widget.weatherCard?.precipitationProbabilityMax,
|
||||||
|
windspeed10MMax:
|
||||||
|
widget.mainWeatherCache?.windspeed10MMax ??
|
||||||
|
widget.weatherCard?.windspeed10MMax,
|
||||||
|
windgusts10MMax:
|
||||||
|
widget.mainWeatherCache?.windgusts10MMax ??
|
||||||
|
widget.weatherCard?.windgusts10MMax,
|
||||||
|
uvIndexMax: widget.mainWeatherCache?.uvIndexMax ??
|
||||||
|
widget.weatherCard?.uvIndexMax,
|
||||||
|
rainSum: widget.mainWeatherCache?.rainSum! ??
|
||||||
|
widget.weatherCard?.rainSum,
|
||||||
|
winddirection10MDominant: widget.mainWeatherCache
|
||||||
|
?.winddirection10MDominant ??
|
||||||
|
widget.weatherCard?.winddirection10MDominant,
|
||||||
|
index: i,
|
||||||
|
),
|
||||||
|
transition: Transition.downToUp),
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
DateFormat.EEEE(locale?.languageCode).format(
|
||||||
|
widget.mainWeatherCache?.timeDaily![i] ??
|
||||||
|
widget.weatherCard!.timeDaily![i]),
|
||||||
|
style: context.theme.textTheme.labelLarge,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: Row(
|
||||||
child: Row(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
children: [
|
Image.asset(
|
||||||
Image.asset(
|
status.getImage7Day(widget.mainWeatherCache
|
||||||
status.getImage7Day(widget.weather[i]),
|
?.weathercodeDaily![i] ??
|
||||||
scale: 3,
|
widget.weatherCard!.weathercodeDaily![i]),
|
||||||
),
|
scale: 3,
|
||||||
const SizedBox(width: 5),
|
),
|
||||||
Expanded(
|
const SizedBox(width: 5),
|
||||||
child: Text(
|
Expanded(
|
||||||
status.getText(widget.weather[i]),
|
child: Text(
|
||||||
|
status.getText(widget.mainWeatherCache
|
||||||
|
?.weathercodeDaily![i] ??
|
||||||
|
widget.weatherCard!.weathercodeDaily![i]),
|
||||||
|
style: context.theme.textTheme.labelLarge,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
statusImFa.getDegree(widget
|
||||||
|
.mainWeatherCache?.temperature2MMin![i]
|
||||||
|
.round() ??
|
||||||
|
widget.weatherCard!.temperature2MMin![i]
|
||||||
|
.round()),
|
||||||
style: context.theme.textTheme.labelLarge,
|
style: context.theme.textTheme.labelLarge,
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
],
|
' / ',
|
||||||
|
style: context.theme.textTheme.bodyMedium
|
||||||
|
?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
statusImFa.getDegree(widget
|
||||||
|
.mainWeatherCache?.temperature2MMax![i]
|
||||||
|
.round() ??
|
||||||
|
widget.weatherCard!.temperature2MMax![i]
|
||||||
|
.round()),
|
||||||
|
style: context.theme.textTheme.bodyMedium
|
||||||
|
?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
Expanded(
|
),
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
statusImFa.getDegree(widget.minDegree[i].round()),
|
|
||||||
style: context.theme.textTheme.labelLarge,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
' / ',
|
|
||||||
style:
|
|
||||||
context.theme.textTheme.bodyMedium?.copyWith(
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
statusImFa.getDegree(widget.maxDegree[i].round()),
|
|
||||||
style:
|
|
||||||
context.theme.textTheme.bodyMedium?.copyWith(
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
GestureDetector(
|
InkWell(
|
||||||
onTap: widget.onTap,
|
onTap: widget.onTap,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:iconsax/iconsax.dart';
|
import 'package:iconsax/iconsax.dart';
|
||||||
import 'package:nested_scroll_views/material.dart';
|
|
||||||
import 'package:rain/app/data/weather.dart';
|
import 'package:rain/app/data/weather.dart';
|
||||||
import 'package:rain/app/widgets/daily_card.dart';
|
import 'package:rain/app/widgets/daily_card.dart';
|
||||||
|
import 'package:rain/app/widgets/list_daily_card.dart';
|
||||||
|
|
||||||
class WeatherMore extends StatefulWidget {
|
class WeatherMore extends StatefulWidget {
|
||||||
const WeatherMore({
|
const WeatherMore({
|
||||||
|
@ -19,27 +19,13 @@ class WeatherMore extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _WeatherMoreState extends State<WeatherMore> {
|
class _WeatherMoreState extends State<WeatherMore> {
|
||||||
late PageController pageController;
|
|
||||||
int pageIndex = 0;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
pageController = PageController(initialPage: 0);
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
pageController.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
backgroundColor: context.theme.colorScheme.surface,
|
||||||
surfaceTintColor: Colors.transparent,
|
surfaceTintColor: Colors.transparent,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
@ -59,98 +45,67 @@ class _WeatherMoreState extends State<WeatherMore> {
|
||||||
style: context.theme.textTheme.titleLarge,
|
style: context.theme.textTheme.titleLarge,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Row(
|
body: ListView.builder(
|
||||||
children: [
|
itemCount: widget.mainWeatherCache?.timeDaily!.length ??
|
||||||
Expanded(
|
widget.weatherCard?.timeDaily!.length,
|
||||||
child: NestedPageView.builder(
|
itemBuilder: (context, index) => GestureDetector(
|
||||||
scrollDirection: Axis.vertical,
|
onTap: () => Get.to(
|
||||||
controller: pageController,
|
() => DailyCard(
|
||||||
onPageChanged: (index) {
|
timeDaily: widget.mainWeatherCache?.timeDaily ??
|
||||||
setState(() {
|
widget.weatherCard?.timeDaily,
|
||||||
pageIndex = index;
|
weathercodeDaily:
|
||||||
});
|
widget.mainWeatherCache?.weathercodeDaily ??
|
||||||
},
|
widget.weatherCard?.weathercodeDaily,
|
||||||
itemCount: widget.mainWeatherCache?.timeDaily!.length ??
|
temperature2MMax:
|
||||||
widget.weatherCard?.timeDaily!.length,
|
widget.mainWeatherCache?.temperature2MMax ??
|
||||||
itemBuilder: (context, index) => SingleChildScrollView(
|
widget.weatherCard?.temperature2MMax,
|
||||||
child: DailyCard(
|
temperature2MMin:
|
||||||
timeDaily: widget.mainWeatherCache?.timeDaily![index] ??
|
widget.mainWeatherCache?.temperature2MMin ??
|
||||||
widget.weatherCard?.timeDaily![index],
|
widget.weatherCard?.temperature2MMin,
|
||||||
weathercodeDaily:
|
apparentTemperatureMax:
|
||||||
widget.mainWeatherCache?.weathercodeDaily![index] ??
|
widget.mainWeatherCache?.apparentTemperatureMax ??
|
||||||
widget.weatherCard?.weathercodeDaily![index],
|
widget.weatherCard?.apparentTemperatureMax,
|
||||||
temperature2MMax:
|
apparentTemperatureMin:
|
||||||
widget.mainWeatherCache?.temperature2MMax![index] ??
|
widget.mainWeatherCache?.apparentTemperatureMin ??
|
||||||
widget.weatherCard?.temperature2MMax![index],
|
widget.weatherCard?.apparentTemperatureMin,
|
||||||
temperature2MMin:
|
sunrise: widget.mainWeatherCache?.sunrise ??
|
||||||
widget.mainWeatherCache?.temperature2MMin![index] ??
|
widget.weatherCard?.sunrise,
|
||||||
widget.weatherCard?.temperature2MMin![index],
|
sunset: widget.mainWeatherCache?.sunset ??
|
||||||
apparentTemperatureMax:
|
widget.weatherCard?.sunset,
|
||||||
widget.mainWeatherCache?.apparentTemperatureMax![index] ??
|
precipitationSum:
|
||||||
widget.weatherCard?.apparentTemperatureMax![index],
|
widget.mainWeatherCache?.precipitationSum ??
|
||||||
apparentTemperatureMin:
|
widget.weatherCard?.precipitationSum,
|
||||||
widget.mainWeatherCache?.apparentTemperatureMin![index] ??
|
precipitationProbabilityMax:
|
||||||
widget.weatherCard?.apparentTemperatureMin![index],
|
widget.mainWeatherCache?.precipitationProbabilityMax ??
|
||||||
sunrise: widget.mainWeatherCache?.sunrise![index] ??
|
widget.weatherCard?.precipitationProbabilityMax,
|
||||||
widget.weatherCard?.sunrise![index],
|
windspeed10MMax: widget.mainWeatherCache?.windspeed10MMax ??
|
||||||
sunset: widget.mainWeatherCache?.sunset![index] ??
|
widget.weatherCard?.windspeed10MMax,
|
||||||
widget.weatherCard?.sunset![index],
|
windgusts10MMax: widget.mainWeatherCache?.windgusts10MMax ??
|
||||||
precipitationSum:
|
widget.weatherCard?.windgusts10MMax,
|
||||||
widget.mainWeatherCache?.precipitationSum![index] ??
|
uvIndexMax: widget.mainWeatherCache?.uvIndexMax ??
|
||||||
widget.weatherCard?.precipitationSum![index],
|
widget.weatherCard?.uvIndexMax,
|
||||||
precipitationProbabilityMax: widget.mainWeatherCache
|
rainSum: widget.mainWeatherCache?.rainSum ??
|
||||||
?.precipitationProbabilityMax![index] ??
|
widget.weatherCard?.rainSum,
|
||||||
widget.weatherCard?.precipitationProbabilityMax![index],
|
winddirection10MDominant:
|
||||||
windspeed10MMax:
|
widget.mainWeatherCache?.winddirection10MDominant ??
|
||||||
widget.mainWeatherCache?.windspeed10MMax![index] ??
|
widget.weatherCard?.winddirection10MDominant,
|
||||||
widget.weatherCard?.windspeed10MMax![index],
|
index: index,
|
||||||
windgusts10MMax:
|
|
||||||
widget.mainWeatherCache?.windgusts10MMax![index] ??
|
|
||||||
widget.weatherCard?.windgusts10MMax![index],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
...List.generate(
|
|
||||||
widget.mainWeatherCache?.timeDaily!.length ??
|
|
||||||
widget.weatherCard!.timeDaily!.length,
|
|
||||||
(index) => Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
|
||||||
child: DotIndicator(
|
|
||||||
isActive: index == pageIndex,
|
|
||||||
),
|
),
|
||||||
),
|
transition: Transition.downToUp),
|
||||||
),
|
child: ListCardDaily(
|
||||||
],
|
timeDaily: widget.mainWeatherCache?.timeDaily![index] ??
|
||||||
|
widget.weatherCard?.timeDaily![index],
|
||||||
|
weathercodeDaily:
|
||||||
|
widget.mainWeatherCache?.weathercodeDaily![index] ??
|
||||||
|
widget.weatherCard?.weathercodeDaily![index],
|
||||||
|
temperature2MMax:
|
||||||
|
widget.mainWeatherCache?.temperature2MMax![index] ??
|
||||||
|
widget.weatherCard?.temperature2MMax![index],
|
||||||
|
temperature2MMin:
|
||||||
|
widget.mainWeatherCache?.temperature2MMin![index] ??
|
||||||
|
widget.weatherCard?.temperature2MMin![index],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class DotIndicator extends StatelessWidget {
|
|
||||||
const DotIndicator({
|
|
||||||
Key? key,
|
|
||||||
this.isActive = false,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final bool isActive;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AnimatedContainer(
|
|
||||||
duration: const Duration(milliseconds: 300),
|
|
||||||
height: 8,
|
|
||||||
width: 8,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: isActive
|
|
||||||
? context.theme.dividerColor
|
|
||||||
: context.theme.colorScheme.primaryContainer,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ class RainTheme {
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
seedColor: Colors.blue,
|
seedColor: Colors.blue,
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
|
surface: Colors.white,
|
||||||
primaryContainer: const Color.fromARGB(255, 245, 245, 245),
|
primaryContainer: const Color.fromARGB(255, 245, 245, 245),
|
||||||
secondaryContainer: const Color.fromARGB(255, 240, 240, 240),
|
secondaryContainer: const Color.fromARGB(255, 240, 240, 240),
|
||||||
tertiaryContainer: const Color.fromARGB(255, 250, 250, 250),
|
tertiaryContainer: const Color.fromARGB(255, 250, 250, 250),
|
||||||
|
@ -21,7 +22,6 @@ class RainTheme {
|
||||||
snackBarTheme: const SnackBarThemeData(
|
snackBarTheme: const SnackBarThemeData(
|
||||||
backgroundColor: Color.fromARGB(255, 225, 225, 225),
|
backgroundColor: Color.fromARGB(255, 225, 225, 225),
|
||||||
),
|
),
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
||||||
backgroundColor: const Color.fromARGB(255, 250, 250, 250),
|
backgroundColor: const Color.fromARGB(255, 250, 250, 250),
|
||||||
),
|
),
|
||||||
|
@ -37,6 +37,7 @@ class RainTheme {
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
seedColor: Colors.blue,
|
seedColor: Colors.blue,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
surface: Colors.black,
|
||||||
primaryContainer: const Color.fromARGB(255, 15, 15, 15),
|
primaryContainer: const Color.fromARGB(255, 15, 15, 15),
|
||||||
secondaryContainer: const Color.fromARGB(255, 10, 10, 10),
|
secondaryContainer: const Color.fromARGB(255, 10, 10, 10),
|
||||||
tertiaryContainer: const Color.fromARGB(255, 20, 20, 20),
|
tertiaryContainer: const Color.fromARGB(255, 20, 20, 20),
|
||||||
|
@ -47,7 +48,6 @@ class RainTheme {
|
||||||
snackBarTheme: const SnackBarThemeData(
|
snackBarTheme: const SnackBarThemeData(
|
||||||
backgroundColor: Color.fromARGB(255, 55, 55, 55),
|
backgroundColor: Color.fromARGB(255, 55, 55, 55),
|
||||||
),
|
),
|
||||||
scaffoldBackgroundColor: Colors.black,
|
|
||||||
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
||||||
backgroundColor: const Color.fromARGB(255, 10, 10, 10),
|
backgroundColor: const Color.fromARGB(255, 10, 10, 10),
|
||||||
),
|
),
|
||||||
|
@ -63,6 +63,7 @@ class RainTheme {
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
seedColor: Colors.blue,
|
seedColor: Colors.blue,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
surface: const Color.fromARGB(255, 30, 30, 30),
|
||||||
primaryContainer: const Color.fromARGB(255, 40, 40, 40),
|
primaryContainer: const Color.fromARGB(255, 40, 40, 40),
|
||||||
secondaryContainer: const Color.fromARGB(255, 25, 25, 25),
|
secondaryContainer: const Color.fromARGB(255, 25, 25, 25),
|
||||||
tertiaryContainer: const Color.fromARGB(255, 45, 45, 45),
|
tertiaryContainer: const Color.fromARGB(255, 45, 45, 45),
|
||||||
|
@ -73,7 +74,6 @@ class RainTheme {
|
||||||
snackBarTheme: const SnackBarThemeData(
|
snackBarTheme: const SnackBarThemeData(
|
||||||
backgroundColor: Color.fromARGB(255, 55, 55, 55),
|
backgroundColor: Color.fromARGB(255, 55, 55, 55),
|
||||||
),
|
),
|
||||||
scaffoldBackgroundColor: const Color.fromARGB(255, 30, 30, 30),
|
|
||||||
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
||||||
backgroundColor: const Color.fromARGB(255, 28, 28, 28),
|
backgroundColor: const Color.fromARGB(255, 28, 28, 28),
|
||||||
),
|
),
|
||||||
|
|
81
pubspec.lock
81
pubspec.lock
|
@ -189,10 +189,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: crypto
|
name: crypto
|
||||||
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
|
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.2"
|
version: "3.0.3"
|
||||||
csslib:
|
csslib:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -213,10 +213,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dart_style
|
name: dart_style
|
||||||
sha256: "6d691edde054969f0e0f26abb1b30834b5138b963793e56f69d3a9a4435e6352"
|
sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.0"
|
version: "2.3.1"
|
||||||
dartx:
|
dartx:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -416,44 +416,51 @@ packages:
|
||||||
geolocator:
|
geolocator:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: geolocator
|
name: geolocator
|
||||||
ref: master
|
sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8"
|
||||||
resolved-ref: "13e6dfee4d32ba9572e8b7e6d263ebd7ffc562db"
|
url: "https://pub.dev"
|
||||||
url: "https://gitlab.com/free2pass/flutter-geolocator-floss.git"
|
source: hosted
|
||||||
source: git
|
version: "9.0.2"
|
||||||
version: "7.6.2"
|
|
||||||
geolocator_android:
|
geolocator_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: geolocator_android
|
name: geolocator_android
|
||||||
sha256: dde5cd786a66f29ee74abe60095b4fe99735faa52926dcac1246747a7533cf6b
|
sha256: "2ba24690aee0a3e1b6b7bd47c2711a50c874e95e4c758346589d35194adf6d6a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "4.1.7"
|
||||||
geolocator_apple:
|
geolocator_apple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: geolocator_apple
|
name: geolocator_apple
|
||||||
sha256: "1e8e398cc92151d946a4bbd34e2075885333e42d35ca33e418e7ce7b0a29991e"
|
sha256: "22b60ca3b8c0f58e6a9688ff855ee39ab813ca3f0c0609a48d282f6631266f2e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.2"
|
version: "2.2.5"
|
||||||
geolocator_platform_interface:
|
geolocator_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: geolocator_platform_interface
|
name: geolocator_platform_interface
|
||||||
sha256: "9d6f34a8a4b704d504f34acc5e52d880a7d2caedd99739902d6319179b0336d4"
|
sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.6"
|
version: "4.0.7"
|
||||||
geolocator_web:
|
geolocator_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: geolocator_web
|
name: geolocator_web
|
||||||
sha256: "0b9e0ec13ce2211085cae0055b3516c975bd6cfe2878a20c8f13611f1a259855"
|
sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.6"
|
version: "2.1.6"
|
||||||
|
geolocator_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_windows
|
||||||
|
sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.1"
|
||||||
get:
|
get:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -530,10 +537,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: "73964e3609fb96e01e69b0924b939967c556e46c7ff05db2ea9e31019000f4ef"
|
sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.16"
|
version: "4.0.17"
|
||||||
internet_connection_checker:
|
internet_connection_checker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -654,14 +661,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
nested_scroll_views:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: nested_scroll_views
|
|
||||||
sha256: "5ebbaf7d86d7cec55433532b0476aa1275cbe3298e1303d02db06b7b5e70b362"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.0.7"
|
|
||||||
nm:
|
nm:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -802,26 +801,26 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pub_semver
|
name: pub_semver
|
||||||
sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17"
|
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.4"
|
||||||
pubspec_parse:
|
pubspec_parse:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pubspec_parse
|
name: pubspec_parse
|
||||||
sha256: ec85d7d55339d85f44ec2b682a82fea340071e8978257e5a43e69f79e98ef50c
|
sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.2"
|
version: "1.2.3"
|
||||||
scrollable_positioned_list:
|
scrollable_positioned_list:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: scrollable_positioned_list
|
name: scrollable_positioned_list
|
||||||
sha256: "45806e0d64aa9dcbf4ced336eabff766dd7ba734014fd71c89bc08241c02bfc5"
|
sha256: "3806b84fa3da65e47146252061d20d12ce254560a6ad098d24b6bad19e079e5d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.6"
|
version: "0.3.7"
|
||||||
shelf:
|
shelf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -855,10 +854,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_gen
|
name: source_gen
|
||||||
sha256: c2bea18c95cfa0276a366270afaa2850b09b4a76db95d546f3d003dcc7011298
|
sha256: b20e191de6964e98032573cecb1d2b169d96ba63fdb586d24dcd1003ba7e94f6
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.7"
|
version: "1.3.0"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1047,10 +1046,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: dd8f9344bc305ae2923e3d11a2a911d9a4e2c7dd6fe0ed10626d63211a69676e
|
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.3"
|
version: "4.1.4"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1079,10 +1078,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: yaml
|
name: yaml
|
||||||
sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370"
|
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.1"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.19.4 <3.0.0"
|
dart: ">=2.19.6 <3.0.0"
|
||||||
flutter: ">=3.4.0-17.0.pre"
|
flutter: ">=3.4.0-17.0.pre"
|
||||||
|
|
11
pubspec.yaml
11
pubspec.yaml
|
@ -6,7 +6,7 @@ publish_to: "none"
|
||||||
version: 1.1.10+21
|
version: 1.1.10+21
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.4 <3.0.0"
|
sdk: ">=2.19.6 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -21,11 +21,7 @@ dependencies:
|
||||||
iconsax: ^0.0.8
|
iconsax: ^0.0.8
|
||||||
timezone: ^0.9.2
|
timezone: ^0.9.2
|
||||||
geocoding: ^2.1.0
|
geocoding: ^2.1.0
|
||||||
geolocator:
|
geolocator: ^9.0.2
|
||||||
git:
|
|
||||||
url: https://gitlab.com/free2pass/flutter-geolocator-floss.git
|
|
||||||
ref: master
|
|
||||||
path: geolocator
|
|
||||||
flutter_glow: ^0.3.0
|
flutter_glow: ^0.3.0
|
||||||
url_launcher: ^6.1.10
|
url_launcher: ^6.1.10
|
||||||
dynamic_color: ^1.6.3
|
dynamic_color: ^1.6.3
|
||||||
|
@ -36,11 +32,10 @@ dependencies:
|
||||||
isar_flutter_libs: ^3.1.0+1
|
isar_flutter_libs: ^3.1.0+1
|
||||||
flutter_displaymode: ^0.6.0
|
flutter_displaymode: ^0.6.0
|
||||||
lat_lng_to_timezone: ^0.2.0
|
lat_lng_to_timezone: ^0.2.0
|
||||||
nested_scroll_views: ^0.0.7
|
|
||||||
custom_navigation_bar: ^0.8.2
|
custom_navigation_bar: ^0.8.2
|
||||||
flutter_native_timezone: ^2.0.0
|
flutter_native_timezone: ^2.0.0
|
||||||
material_color_utilities: ^0.2.0
|
material_color_utilities: ^0.2.0
|
||||||
scrollable_positioned_list: ^0.3.6
|
scrollable_positioned_list: ^0.3.7
|
||||||
flutter_local_notifications: ^14.0.0+1
|
flutter_local_notifications: ^14.0.0+1
|
||||||
internet_connection_checker: ^1.0.0+1
|
internet_connection_checker: ^1.0.0+1
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
||||||
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
||||||
|
#include <geolocator_windows/geolocator_windows.h>
|
||||||
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
|
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
|
@ -16,6 +17,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
||||||
DynamicColorPluginCApiRegisterWithRegistrar(
|
DynamicColorPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
||||||
|
GeolocatorWindowsRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||||
IsarFlutterLibsPluginRegisterWithRegistrar(
|
IsarFlutterLibsPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin"));
|
registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
connectivity_plus
|
connectivity_plus
|
||||||
dynamic_color
|
dynamic_color
|
||||||
|
geolocator_windows
|
||||||
isar_flutter_libs
|
isar_flutter_libs
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue