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;
|
||||
|
||||
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;
|
||||
settings.degrees == 'fahrenheit'
|
||||
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
||||
|
@ -68,6 +68,10 @@ class WeatherAPI {
|
|||
weatherDataDaily.daily.precipitationProbabilityMax,
|
||||
windspeed10MMax: weatherDataDaily.daily.windspeed10MMax,
|
||||
windgusts10MMax: weatherDataDaily.daily.windgusts10MMax,
|
||||
uvIndexMax: weatherDataDaily.daily.uvIndexMax,
|
||||
rainSum: weatherDataDaily.daily.rainSum,
|
||||
winddirection10MDominant:
|
||||
weatherDataDaily.daily.winddirection10MDominant,
|
||||
timezone: weatherDataHourly.timezone,
|
||||
timestamp: DateTime.now(),
|
||||
);
|
||||
|
@ -121,7 +125,7 @@ class WeatherAPI {
|
|||
: urlHourly = baseUrlHourly;
|
||||
|
||||
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;
|
||||
settings.degrees == 'fahrenheit'
|
||||
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
||||
|
@ -162,6 +166,10 @@ class WeatherAPI {
|
|||
weatherDataDaily.daily.precipitationProbabilityMax,
|
||||
windspeed10MMax: weatherDataDaily.daily.windspeed10MMax,
|
||||
windgusts10MMax: weatherDataDaily.daily.windgusts10MMax,
|
||||
uvIndexMax: weatherDataDaily.daily.uvIndexMax,
|
||||
rainSum: weatherDataDaily.daily.rainSum,
|
||||
winddirection10MDominant:
|
||||
weatherDataDaily.daily.winddirection10MDominant,
|
||||
lat: lat,
|
||||
lon: lon,
|
||||
city: city,
|
||||
|
|
|
@ -25,6 +25,9 @@ class Daily {
|
|||
this.precipitationProbabilityMax,
|
||||
this.windspeed10MMax,
|
||||
this.windgusts10MMax,
|
||||
this.uvIndexMax,
|
||||
this.rainSum,
|
||||
this.winddirection10MDominant,
|
||||
});
|
||||
|
||||
List<DateTime>? time;
|
||||
|
@ -39,6 +42,9 @@ class Daily {
|
|||
List<int>? precipitationProbabilityMax;
|
||||
List<double>? windspeed10MMax;
|
||||
List<double>? windgusts10MMax;
|
||||
List<double>? uvIndexMax;
|
||||
List<double>? rainSum;
|
||||
List<int>? winddirection10MDominant;
|
||||
|
||||
factory Daily.fromJson(Map<String, dynamic> json) => Daily(
|
||||
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)),
|
||||
windgusts10MMax:
|
||||
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;
|
||||
element.windspeed10MMax = _weatherCard.value.windspeed10MMax;
|
||||
element.windgusts10MMax = _weatherCard.value.windgusts10MMax;
|
||||
element.uvIndexMax = _weatherCard.value.uvIndexMax;
|
||||
element.rainSum = _weatherCard.value.rainSum;
|
||||
element.winddirection10MDominant =
|
||||
_weatherCard.value.winddirection10MDominant;
|
||||
element.timestamp = DateTime.now();
|
||||
await isar.weatherCards.put(element);
|
||||
}
|
||||
|
@ -350,6 +354,10 @@ class LocationController extends GetxController {
|
|||
_weatherCard.value.precipitationProbabilityMax;
|
||||
weatherCard.windspeed10MMax = _weatherCard.value.windspeed10MMax;
|
||||
weatherCard.windgusts10MMax = _weatherCard.value.windgusts10MMax;
|
||||
weatherCard.uvIndexMax = _weatherCard.value.uvIndexMax;
|
||||
weatherCard.rainSum = _weatherCard.value.rainSum;
|
||||
weatherCard.winddirection10MDominant =
|
||||
_weatherCard.value.winddirection10MDominant;
|
||||
weatherCard.timestamp = DateTime.now();
|
||||
await isar.weatherCards.put(weatherCard);
|
||||
});
|
||||
|
|
|
@ -45,6 +45,9 @@ class MainWeatherCache {
|
|||
List<int>? precipitationProbabilityMax;
|
||||
List<double>? windspeed10MMax;
|
||||
List<double>? windgusts10MMax;
|
||||
List<double>? uvIndexMax;
|
||||
List<double>? rainSum;
|
||||
List<int>? winddirection10MDominant;
|
||||
String? timezone;
|
||||
DateTime? timestamp;
|
||||
|
||||
|
@ -76,6 +79,9 @@ class MainWeatherCache {
|
|||
this.precipitationProbabilityMax,
|
||||
this.windspeed10MMax,
|
||||
this.windgusts10MMax,
|
||||
this.uvIndexMax,
|
||||
this.rainSum,
|
||||
this.winddirection10MDominant,
|
||||
this.timezone,
|
||||
this.timestamp,
|
||||
});
|
||||
|
@ -127,6 +133,9 @@ class WeatherCard {
|
|||
List<int>? precipitationProbabilityMax;
|
||||
List<double>? windspeed10MMax;
|
||||
List<double>? windgusts10MMax;
|
||||
List<double>? uvIndexMax;
|
||||
List<double>? rainSum;
|
||||
List<int>? winddirection10MDominant;
|
||||
double? lat;
|
||||
double? lon;
|
||||
String? city;
|
||||
|
@ -162,6 +171,9 @@ class WeatherCard {
|
|||
this.precipitationProbabilityMax,
|
||||
this.windspeed10MMax,
|
||||
this.windgusts10MMax,
|
||||
this.uvIndexMax,
|
||||
this.rainSum,
|
||||
this.winddirection10MDominant,
|
||||
this.lat,
|
||||
this.lon,
|
||||
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/modules/weather_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';
|
||||
|
||||
class CardWeather extends StatefulWidget {
|
||||
|
@ -20,148 +19,133 @@ class _CardWeatherState extends State<CardWeather> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await locationController.updateCacheCard(true);
|
||||
setState(() {});
|
||||
},
|
||||
child: StreamBuilder<List<WeatherCard>>(
|
||||
stream: locationController.getWeatherCard(),
|
||||
builder: (context, listData) {
|
||||
switch (listData.connectionState) {
|
||||
case ConnectionState.done:
|
||||
default:
|
||||
if (listData.hasData) {
|
||||
final weatherCard = listData.data!;
|
||||
if (weatherCard.isEmpty) {
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/add_weather.png',
|
||||
scale: 6,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.size.width * 0.8,
|
||||
child: Text(
|
||||
'noWeatherCard'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: context.theme.textTheme.titleMedium
|
||||
?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 18,
|
||||
),
|
||||
return RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await locationController.updateCacheCard(true);
|
||||
setState(() {});
|
||||
},
|
||||
child: StreamBuilder<List<WeatherCard>>(
|
||||
stream: locationController.getWeatherCard(),
|
||||
builder: (context, listData) {
|
||||
switch (listData.connectionState) {
|
||||
case ConnectionState.done:
|
||||
default:
|
||||
if (listData.hasData) {
|
||||
final weatherCard = listData.data!;
|
||||
if (weatherCard.isEmpty) {
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/add_weather.png',
|
||||
scale: 6,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.size.width * 0.8,
|
||||
child: Text(
|
||||
'noWeatherCard'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
context.theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
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),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
floatingActionButton: 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),
|
||||
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),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'package:rain/app/controller/controller.dart';
|
|||
import 'package:rain/app/modules/card_weather.dart';
|
||||
import 'package:rain/app/modules/settings.dart';
|
||||
import 'package:rain/app/modules/weather.dart';
|
||||
import 'package:rain/app/widgets/create_card_weather.dart';
|
||||
import 'package:rain/main.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
|
@ -54,11 +55,11 @@ class _HomePageState extends State<HomePage> {
|
|||
);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
|
@ -176,13 +176,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
|||
Obx(
|
||||
() => locationController.isLoading.isFalse
|
||||
? WeatherDaily(
|
||||
date: locationController.mainWeather.timeDaily!,
|
||||
weather:
|
||||
locationController.mainWeather.weathercodeDaily!,
|
||||
minDegree:
|
||||
locationController.mainWeather.temperature2MMin!,
|
||||
maxDegree:
|
||||
locationController.mainWeather.temperature2MMax!,
|
||||
mainWeatherCache: locationController.mainWeather,
|
||||
onTap: () => Get.to(
|
||||
() => WeatherMore(
|
||||
mainWeatherCache: locationController.mainWeather,
|
||||
|
|
|
@ -57,10 +57,11 @@ class _WeatherCardPageState extends State<WeatherCardPage> {
|
|||
setState(() {});
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
|
@ -172,10 +173,7 @@ class _WeatherCardPageState extends State<WeatherCardPage> {
|
|||
uvIndex: widget.weatherCard.uvIndex![timeNow],
|
||||
),
|
||||
WeatherDaily(
|
||||
date: widget.weatherCard.timeDaily!,
|
||||
weather: widget.weatherCard.weathercodeDaily!,
|
||||
minDegree: widget.weatherCard.temperature2MMin!,
|
||||
maxDegree: widget.weatherCard.temperature2MMax!,
|
||||
weatherCard: widget.weatherCard,
|
||||
onTap: () => Get.to(
|
||||
() => WeatherMore(
|
||||
weatherCard: widget.weatherCard,
|
||||
|
|
|
@ -93,16 +93,17 @@ class _CardDescWeatherState extends State<CardDescWeather> {
|
|||
),
|
||||
const SizedBox(height: 5),
|
||||
StreamBuilder(
|
||||
stream: Stream.periodic(const Duration(seconds: 1)),
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
'${'time'.tr}: ${statusImFa.getTimeFormatTz(tz.TZDateTime.now(tz.getLocation(widget.timezone)))}',
|
||||
style: context.theme.textTheme.titleMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
);
|
||||
}),
|
||||
stream: Stream.periodic(const Duration(seconds: 1)),
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
'${'time'.tr}: ${statusImFa.getTimeFormatTz(tz.TZDateTime.now(tz.getLocation(widget.timezone)))}',
|
||||
style: context.theme.textTheme.titleMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
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/message.dart';
|
||||
import 'package:rain/app/widgets/status.dart';
|
||||
import 'package:rain/app/widgets/status_im_fa.dart';
|
||||
import 'package:rain/app/widgets/sunset_sunrise.dart';
|
||||
|
||||
class DailyCard extends StatelessWidget {
|
||||
class DailyCard extends StatefulWidget {
|
||||
const DailyCard({
|
||||
super.key,
|
||||
this.timeDaily,
|
||||
|
@ -22,128 +24,230 @@ class DailyCard extends StatelessWidget {
|
|||
this.precipitationProbabilityMax,
|
||||
this.windspeed10MMax,
|
||||
this.windgusts10MMax,
|
||||
this.uvIndexMax,
|
||||
this.rainSum,
|
||||
this.winddirection10MDominant,
|
||||
required this.index,
|
||||
});
|
||||
final DateTime? timeDaily;
|
||||
final int? weathercodeDaily;
|
||||
final double? temperature2MMax;
|
||||
final double? temperature2MMin;
|
||||
final double? apparentTemperatureMax;
|
||||
final double? apparentTemperatureMin;
|
||||
final String? sunrise;
|
||||
final String? sunset;
|
||||
final double? precipitationSum;
|
||||
final int? precipitationProbabilityMax;
|
||||
final double? windspeed10MMax;
|
||||
final double? windgusts10MMax;
|
||||
final List<DateTime>? timeDaily;
|
||||
final List<int>? weathercodeDaily;
|
||||
final List<double>? temperature2MMax;
|
||||
final List<double>? temperature2MMin;
|
||||
final List<double>? apparentTemperatureMax;
|
||||
final List<double>? apparentTemperatureMin;
|
||||
final List<String>? sunrise;
|
||||
final List<String>? sunset;
|
||||
final List<double>? precipitationSum;
|
||||
final List<int>? precipitationProbabilityMax;
|
||||
final List<double>? windspeed10MMax;
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
final locale = Get.locale;
|
||||
final status = Status();
|
||||
final statusImFa = StatusImFa();
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 15),
|
||||
Image(
|
||||
image: AssetImage(
|
||||
status.getImageNowDaily(weathercodeDaily!, timeDaily!)),
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
return Scaffold(
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
Iconsax.arrow_left_1,
|
||||
size: 20,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: SunsetSunrise(
|
||||
timeSunrise: sunrise!,
|
||||
timeSunset: sunset!,
|
||||
),
|
||||
),
|
||||
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),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
),
|
||||
title: Text(
|
||||
DateFormat.MMMMEEEEd(locale?.languageCode)
|
||||
.format(widget.timeDaily![pageIndex]),
|
||||
style: context.theme.textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: PageView.builder(
|
||||
controller: pageController,
|
||||
onPageChanged: (index) {
|
||||
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:get/get.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_im_fa.dart';
|
||||
|
||||
class WeatherDaily extends StatefulWidget {
|
||||
const WeatherDaily({
|
||||
super.key,
|
||||
required this.date,
|
||||
required this.weather,
|
||||
required this.minDegree,
|
||||
required this.maxDegree,
|
||||
this.mainWeatherCache,
|
||||
this.weatherCard,
|
||||
required this.onTap,
|
||||
});
|
||||
final List<DateTime> date;
|
||||
final List<int> weather;
|
||||
final List<double> minDegree;
|
||||
final List<double> maxDegree;
|
||||
final MainWeatherCache? mainWeatherCache;
|
||||
final WeatherCard? weatherCard;
|
||||
final Function() onTap;
|
||||
|
||||
@override
|
||||
|
@ -50,70 +48,130 @@ class _WeatherDailyState extends State<WeatherDaily> {
|
|||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: 7,
|
||||
itemBuilder: (ctx, i) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
DateFormat.EEEE(locale?.languageCode)
|
||||
.format(widget.date[i]),
|
||||
style: context.theme.textTheme.labelLarge,
|
||||
return InkWell(
|
||||
onTap: () => Get.to(
|
||||
() => DailyCard(
|
||||
timeDaily: widget.mainWeatherCache?.timeDaily ??
|
||||
widget.weatherCard?.timeDaily,
|
||||
weathercodeDaily:
|
||||
widget.mainWeatherCache?.weathercodeDaily ??
|
||||
widget.weatherCard?.weathercodeDaily,
|
||||
temperature2MMax:
|
||||
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(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
status.getImage7Day(widget.weather[i]),
|
||||
scale: 3,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Expanded(
|
||||
child: Text(
|
||||
status.getText(widget.weather[i]),
|
||||
Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
status.getImage7Day(widget.mainWeatherCache
|
||||
?.weathercodeDaily![i] ??
|
||||
widget.weatherCard!.weathercodeDaily![i]),
|
||||
scale: 3,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Expanded(
|
||||
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,
|
||||
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(),
|
||||
GestureDetector(
|
||||
InkWell(
|
||||
onTap: widget.onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:iconsax/iconsax.dart';
|
||||
import 'package:nested_scroll_views/material.dart';
|
||||
import 'package:rain/app/data/weather.dart';
|
||||
import 'package:rain/app/widgets/daily_card.dart';
|
||||
import 'package:rain/app/widgets/list_daily_card.dart';
|
||||
|
||||
class WeatherMore extends StatefulWidget {
|
||||
const WeatherMore({
|
||||
|
@ -19,27 +19,13 @@ class WeatherMore extends StatefulWidget {
|
|||
}
|
||||
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: context.theme.scaffoldBackgroundColor,
|
||||
backgroundColor: context.theme.colorScheme.surface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
|
@ -59,98 +45,67 @@ class _WeatherMoreState extends State<WeatherMore> {
|
|||
style: context.theme.textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
body: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: NestedPageView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
controller: pageController,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
pageIndex = index;
|
||||
});
|
||||
},
|
||||
itemCount: widget.mainWeatherCache?.timeDaily!.length ??
|
||||
widget.weatherCard?.timeDaily!.length,
|
||||
itemBuilder: (context, index) => SingleChildScrollView(
|
||||
child: DailyCard(
|
||||
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],
|
||||
apparentTemperatureMax:
|
||||
widget.mainWeatherCache?.apparentTemperatureMax![index] ??
|
||||
widget.weatherCard?.apparentTemperatureMax![index],
|
||||
apparentTemperatureMin:
|
||||
widget.mainWeatherCache?.apparentTemperatureMin![index] ??
|
||||
widget.weatherCard?.apparentTemperatureMin![index],
|
||||
sunrise: widget.mainWeatherCache?.sunrise![index] ??
|
||||
widget.weatherCard?.sunrise![index],
|
||||
sunset: widget.mainWeatherCache?.sunset![index] ??
|
||||
widget.weatherCard?.sunset![index],
|
||||
precipitationSum:
|
||||
widget.mainWeatherCache?.precipitationSum![index] ??
|
||||
widget.weatherCard?.precipitationSum![index],
|
||||
precipitationProbabilityMax: widget.mainWeatherCache
|
||||
?.precipitationProbabilityMax![index] ??
|
||||
widget.weatherCard?.precipitationProbabilityMax![index],
|
||||
windspeed10MMax:
|
||||
widget.mainWeatherCache?.windspeed10MMax![index] ??
|
||||
widget.weatherCard?.windspeed10MMax![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,
|
||||
body: ListView.builder(
|
||||
itemCount: widget.mainWeatherCache?.timeDaily!.length ??
|
||||
widget.weatherCard?.timeDaily!.length,
|
||||
itemBuilder: (context, index) => GestureDetector(
|
||||
onTap: () => Get.to(
|
||||
() => DailyCard(
|
||||
timeDaily: widget.mainWeatherCache?.timeDaily ??
|
||||
widget.weatherCard?.timeDaily,
|
||||
weathercodeDaily:
|
||||
widget.mainWeatherCache?.weathercodeDaily ??
|
||||
widget.weatherCard?.weathercodeDaily,
|
||||
temperature2MMax:
|
||||
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: index,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
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(
|
||||
seedColor: Colors.blue,
|
||||
brightness: Brightness.light,
|
||||
surface: Colors.white,
|
||||
primaryContainer: const Color.fromARGB(255, 245, 245, 245),
|
||||
secondaryContainer: const Color.fromARGB(255, 240, 240, 240),
|
||||
tertiaryContainer: const Color.fromARGB(255, 250, 250, 250),
|
||||
|
@ -21,7 +22,6 @@ class RainTheme {
|
|||
snackBarTheme: const SnackBarThemeData(
|
||||
backgroundColor: Color.fromARGB(255, 225, 225, 225),
|
||||
),
|
||||
scaffoldBackgroundColor: Colors.white,
|
||||
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
||||
backgroundColor: const Color.fromARGB(255, 250, 250, 250),
|
||||
),
|
||||
|
@ -37,6 +37,7 @@ class RainTheme {
|
|||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: Colors.blue,
|
||||
brightness: Brightness.dark,
|
||||
surface: Colors.black,
|
||||
primaryContainer: const Color.fromARGB(255, 15, 15, 15),
|
||||
secondaryContainer: const Color.fromARGB(255, 10, 10, 10),
|
||||
tertiaryContainer: const Color.fromARGB(255, 20, 20, 20),
|
||||
|
@ -47,7 +48,6 @@ class RainTheme {
|
|||
snackBarTheme: const SnackBarThemeData(
|
||||
backgroundColor: Color.fromARGB(255, 55, 55, 55),
|
||||
),
|
||||
scaffoldBackgroundColor: Colors.black,
|
||||
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
||||
backgroundColor: const Color.fromARGB(255, 10, 10, 10),
|
||||
),
|
||||
|
@ -63,6 +63,7 @@ class RainTheme {
|
|||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: Colors.blue,
|
||||
brightness: Brightness.dark,
|
||||
surface: const Color.fromARGB(255, 30, 30, 30),
|
||||
primaryContainer: const Color.fromARGB(255, 40, 40, 40),
|
||||
secondaryContainer: const Color.fromARGB(255, 25, 25, 25),
|
||||
tertiaryContainer: const Color.fromARGB(255, 45, 45, 45),
|
||||
|
@ -73,7 +74,6 @@ class RainTheme {
|
|||
snackBarTheme: const SnackBarThemeData(
|
||||
backgroundColor: Color.fromARGB(255, 55, 55, 55),
|
||||
),
|
||||
scaffoldBackgroundColor: const Color.fromARGB(255, 30, 30, 30),
|
||||
bottomNavigationBarTheme: baseLigth.bottomNavigationBarTheme.copyWith(
|
||||
backgroundColor: const Color.fromARGB(255, 28, 28, 28),
|
||||
),
|
||||
|
|
81
pubspec.lock
81
pubspec.lock
|
@ -189,10 +189,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
|
||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
version: "3.0.3"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -213,10 +213,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
sha256: "6d691edde054969f0e0f26abb1b30834b5138b963793e56f69d3a9a4435e6352"
|
||||
sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.3.1"
|
||||
dartx:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -416,44 +416,51 @@ packages:
|
|||
geolocator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: geolocator
|
||||
ref: master
|
||||
resolved-ref: "13e6dfee4d32ba9572e8b7e6d263ebd7ffc562db"
|
||||
url: "https://gitlab.com/free2pass/flutter-geolocator-floss.git"
|
||||
source: git
|
||||
version: "7.6.2"
|
||||
name: geolocator
|
||||
sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.0.2"
|
||||
geolocator_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_android
|
||||
sha256: dde5cd786a66f29ee74abe60095b4fe99735faa52926dcac1246747a7533cf6b
|
||||
sha256: "2ba24690aee0a3e1b6b7bd47c2711a50c874e95e4c758346589d35194adf6d6a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
version: "4.1.7"
|
||||
geolocator_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_apple
|
||||
sha256: "1e8e398cc92151d946a4bbd34e2075885333e42d35ca33e418e7ce7b0a29991e"
|
||||
sha256: "22b60ca3b8c0f58e6a9688ff855ee39ab813ca3f0c0609a48d282f6631266f2e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.2"
|
||||
version: "2.2.5"
|
||||
geolocator_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_platform_interface
|
||||
sha256: "9d6f34a8a4b704d504f34acc5e52d880a7d2caedd99739902d6319179b0336d4"
|
||||
sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.6"
|
||||
version: "4.0.7"
|
||||
geolocator_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_web
|
||||
sha256: "0b9e0ec13ce2211085cae0055b3516c975bd6cfe2878a20c8f13611f1a259855"
|
||||
sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1
|
||||
url: "https://pub.dev"
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -530,10 +537,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
sha256: "73964e3609fb96e01e69b0924b939967c556e46c7ff05db2ea9e31019000f4ef"
|
||||
sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.16"
|
||||
version: "4.0.17"
|
||||
internet_connection_checker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -654,14 +661,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -802,26 +801,26 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17"
|
||||
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
version: "2.1.4"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
sha256: ec85d7d55339d85f44ec2b682a82fea340071e8978257e5a43e69f79e98ef50c
|
||||
sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.2"
|
||||
version: "1.2.3"
|
||||
scrollable_positioned_list:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: scrollable_positioned_list
|
||||
sha256: "45806e0d64aa9dcbf4ced336eabff766dd7ba734014fd71c89bc08241c02bfc5"
|
||||
sha256: "3806b84fa3da65e47146252061d20d12ce254560a6ad098d24b6bad19e079e5d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.6"
|
||||
version: "0.3.7"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -855,10 +854,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
sha256: c2bea18c95cfa0276a366270afaa2850b09b4a76db95d546f3d003dcc7011298
|
||||
sha256: b20e191de6964e98032573cecb1d2b169d96ba63fdb586d24dcd1003ba7e94f6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.7"
|
||||
version: "1.3.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1047,10 +1046,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: dd8f9344bc305ae2923e3d11a2a911d9a4e2c7dd6fe0ed10626d63211a69676e
|
||||
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.3"
|
||||
version: "4.1.4"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1079,10 +1078,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370"
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=2.19.4 <3.0.0"
|
||||
dart: ">=2.19.6 <3.0.0"
|
||||
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
|
||||
|
||||
environment:
|
||||
sdk: ">=2.19.4 <3.0.0"
|
||||
sdk: ">=2.19.6 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
@ -21,11 +21,7 @@ dependencies:
|
|||
iconsax: ^0.0.8
|
||||
timezone: ^0.9.2
|
||||
geocoding: ^2.1.0
|
||||
geolocator:
|
||||
git:
|
||||
url: https://gitlab.com/free2pass/flutter-geolocator-floss.git
|
||||
ref: master
|
||||
path: geolocator
|
||||
geolocator: ^9.0.2
|
||||
flutter_glow: ^0.3.0
|
||||
url_launcher: ^6.1.10
|
||||
dynamic_color: ^1.6.3
|
||||
|
@ -36,11 +32,10 @@ dependencies:
|
|||
isar_flutter_libs: ^3.1.0+1
|
||||
flutter_displaymode: ^0.6.0
|
||||
lat_lng_to_timezone: ^0.2.0
|
||||
nested_scroll_views: ^0.0.7
|
||||
custom_navigation_bar: ^0.8.2
|
||||
flutter_native_timezone: ^2.0.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
|
||||
internet_connection_checker: ^1.0.0+1
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <connectivity_plus/connectivity_plus_windows_plugin.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 <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
|
@ -16,6 +17,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
||||
DynamicColorPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
||||
GeolocatorWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||
IsarFlutterLibsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin"));
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
connectivity_plus
|
||||
dynamic_color
|
||||
geolocator_windows
|
||||
isar_flutter_libs
|
||||
url_launcher_windows
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue