mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
try fix layout
This commit is contained in:
parent
9eaad8b0cf
commit
8d5a0ad1f6
@ -4,51 +4,121 @@ List<Translation> translations = [
|
|||||||
Translation(language: "FR", data: {
|
Translation(language: "FR", data: {
|
||||||
"weather.hourly": "Prochaines heures",
|
"weather.hourly": "Prochaines heures",
|
||||||
"weather.nextdays": "Prochains jours",
|
"weather.nextdays": "Prochains jours",
|
||||||
"agenda.all": "Tout"
|
"agenda.all": "Tout",
|
||||||
|
"monday": "Lundi",
|
||||||
|
"tuesday": "Mardi",
|
||||||
|
"wednesday": "Mercredi",
|
||||||
|
"thursday": "Jeudi",
|
||||||
|
"friday": "Vendredi",
|
||||||
|
"saturday": "Samedi",
|
||||||
|
"sunday": "Dimanche",
|
||||||
}),
|
}),
|
||||||
Translation(language: "EN", data: {
|
Translation(language: "EN", data: {
|
||||||
"weather.hourly": "Hourly",
|
"weather.hourly": "Hourly",
|
||||||
"weather.nextdays": "Next days",
|
"weather.nextdays": "Next days",
|
||||||
"agenda.all": "All"
|
"agenda.all": "All",
|
||||||
|
"monday": "Monday",
|
||||||
|
"tuesday": "Tuesday",
|
||||||
|
"wednesday": "Wednesday",
|
||||||
|
"thursday": "Thursday",
|
||||||
|
"friday": "Friday",
|
||||||
|
"saturday": "Saturday",
|
||||||
|
"sunday": "Sunday"
|
||||||
}),
|
}),
|
||||||
Translation(language: "DE", data: {
|
Translation(language: "DE", data: {
|
||||||
"weather.hourly": "Nächste Stunden",
|
"weather.hourly": "Nächste Stunden",
|
||||||
"weather.nextdays": "Nächsten Tage",
|
"weather.nextdays": "Nächsten Tage",
|
||||||
"agenda.all": "Alle"
|
"agenda.all": "Alle",
|
||||||
|
"monday": "Montag",
|
||||||
|
"tuesday": "Dienstag",
|
||||||
|
"wednesday": "Mittwoch",
|
||||||
|
"thursday": "Donnerstag",
|
||||||
|
"friday": "Freitag",
|
||||||
|
"saturday": "Samstag",
|
||||||
|
"sunday": "Sonntag"
|
||||||
}),
|
}),
|
||||||
Translation(language: "NL", data: {
|
Translation(language: "NL", data: {
|
||||||
"weather.hourly": "Volgende uren",
|
"weather.hourly": "Volgende uren",
|
||||||
"weather.nextdays": "Volgende dagen",
|
"weather.nextdays": "Volgende dagen",
|
||||||
"agenda.all": "Alle"
|
"agenda.all": "Alle",
|
||||||
|
"monday": "Maandag",
|
||||||
|
"tuesday": "Dinsdag",
|
||||||
|
"wednesday": "Woensdag",
|
||||||
|
"thursday": "Donderdag",
|
||||||
|
"friday": "Vrijdag",
|
||||||
|
"saturday": "Zaterdag",
|
||||||
|
"sunday": "Zondag"
|
||||||
}),
|
}),
|
||||||
Translation(language: "IT", data: {
|
Translation(language: "IT", data: {
|
||||||
"weather.hourly": "Le prossime ore",
|
"weather.hourly": "Le prossime ore",
|
||||||
"weather.nextdays": "Prossimi giorni",
|
"weather.nextdays": "Prossimi giorni",
|
||||||
"agenda.all": "Tutto"
|
"agenda.all": "Tutto",
|
||||||
|
"monday": "Lunedì",
|
||||||
|
"tuesday": "Martedì",
|
||||||
|
"wednesday": "Mercoledì",
|
||||||
|
"thursday": "Giovedì",
|
||||||
|
"friday": "Venerdì",
|
||||||
|
"saturday": "Sabato",
|
||||||
|
"sunday": "Domenica"
|
||||||
}),
|
}),
|
||||||
Translation(language: "ES", data: {
|
Translation(language: "ES", data: {
|
||||||
"weather.hourly": "Próximas horas",
|
"weather.hourly": "Próximas horas",
|
||||||
"weather.nextdays": "Proximos dias",
|
"weather.nextdays": "Proximos dias",
|
||||||
"agenda.all": "Todo"
|
"agenda.all": "Todo",
|
||||||
|
"monday": "Lunes",
|
||||||
|
"tuesday": "Martes",
|
||||||
|
"wednesday": "Miércoles",
|
||||||
|
"thursday": "Jueves",
|
||||||
|
"friday": "Viernes",
|
||||||
|
"saturday": "Sábado",
|
||||||
|
"sunday": "Domingo"
|
||||||
}),
|
}),
|
||||||
Translation(language: "PL", data: {
|
Translation(language: "PL", data: {
|
||||||
"weather.hourly": "Następne godziny",
|
"weather.hourly": "Następne godziny",
|
||||||
"weather.nextdays": "Następne dni",
|
"weather.nextdays": "Następne dni",
|
||||||
"agenda.all": "Wszystko"
|
"agenda.all": "Wszystko",
|
||||||
|
"monday": "Poniedziałek",
|
||||||
|
"tuesday": "Wtorek",
|
||||||
|
"wednesday": "Środa",
|
||||||
|
"thursday": "Czwartek",
|
||||||
|
"friday": "Piątek",
|
||||||
|
"saturday": "Sobota",
|
||||||
|
"sunday": "Niedziela"
|
||||||
}),
|
}),
|
||||||
Translation(language: "CN", data: {
|
Translation(language: "CN", data: {
|
||||||
"weather.hourly": "接下来的几个小时",
|
"weather.hourly": "接下来的几个小时",
|
||||||
"weather.nextdays": "未来几天",
|
"weather.nextdays": "未来几天",
|
||||||
"agenda.all": "全部"
|
"agenda.all": "全部",
|
||||||
|
"monday": "星期一",
|
||||||
|
"tuesday": "星期二",
|
||||||
|
"wednesday": "星期三",
|
||||||
|
"thursday": "星期四",
|
||||||
|
"friday": "星期五",
|
||||||
|
"saturday": "星期六",
|
||||||
|
"sunday": "星期日"
|
||||||
}),
|
}),
|
||||||
Translation(language: "UK", data: {
|
Translation(language: "UK", data: {
|
||||||
"weather.hourly": "Наступні години",
|
"weather.hourly": "Наступні години",
|
||||||
"weather.nextdays": "Наступні дні",
|
"weather.nextdays": "Наступні дні",
|
||||||
"agenda.all": "все"
|
"agenda.all": "все",
|
||||||
|
"monday": "Понеділок",
|
||||||
|
"tuesday": "Вівторок",
|
||||||
|
"wednesday": "Середа",
|
||||||
|
"thursday": "Четвер",
|
||||||
|
"friday": "П'ятниця",
|
||||||
|
"saturday": "Субота",
|
||||||
|
"sunday": "Неділя"
|
||||||
}),
|
}),
|
||||||
Translation(language: "AR", data: {
|
Translation(language: "AR", data: {
|
||||||
"weather.hourly": "الساعات القادمة",
|
"weather.hourly": "الساعات القادمة",
|
||||||
"weather.nextdays": "الايام القادمة",
|
"weather.nextdays": "الايام القادمة",
|
||||||
"agenda.all": "الجميع"
|
"agenda.all": "الجميع",
|
||||||
|
"monday": "الإثنين",
|
||||||
|
"tuesday": "الثلاثاء",
|
||||||
|
"wednesday": "الأربعاء",
|
||||||
|
"thursday": "الخميس",
|
||||||
|
"friday": "الجمعة",
|
||||||
|
"saturday": "السبت",
|
||||||
|
"sunday": "الأحد"
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
@ -136,13 +136,11 @@ class EventListItem extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: HtmlWidget(
|
child: AutoSizeText(
|
||||||
eventAgenda.name!,
|
eventAgenda.name!,
|
||||||
customStylesBuilder: (element) {
|
style: TextStyle(fontSize: kDescriptionSize),
|
||||||
return {'text-align': 'center'};
|
maxFontSize: 15,
|
||||||
},
|
),
|
||||||
textStyle: TextStyle(fontSize: kDescriptionSize),
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
AutoSizeText(
|
AutoSizeText(
|
||||||
eventAgenda.type!,
|
eventAgenda.type!,
|
||||||
|
|||||||
@ -220,7 +220,7 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: size.width * 0.28,
|
width: size.width * 0.3,
|
||||||
height: size.height * 0.65,
|
height: size.height * 0.65,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
@ -230,7 +230,7 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
children: [
|
children: [
|
||||||
widget.eventAgenda.address!.lat != null && widget.eventAgenda.address!.lng != null ?
|
widget.eventAgenda.address!.lat != null && widget.eventAgenda.address!.lng != null ?
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: size.width * 0.28,
|
width: size.width * 0.25,
|
||||||
height: size.height * 0.2,
|
height: size.height * 0.2,
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
mapToolbarEnabled: false,
|
mapToolbarEnabled: false,
|
||||||
@ -304,7 +304,6 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class _MonthFilterState extends State<MonthFilter> {
|
|||||||
title: Text(
|
title: Text(
|
||||||
'$monthName $annee (${nbrEvents})',
|
'$monthName $annee (${nbrEvents})',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16.0,
|
fontSize: 14.0,
|
||||||
fontWeight: _selectedMonth == monthYear ? FontWeight.bold : FontWeight.normal,
|
fontWeight: _selectedMonth == monthYear ? FontWeight.bold : FontWeight.normal,
|
||||||
color: _selectedMonth == monthYear ? kTestSecondColor : null,
|
color: _selectedMonth == monthYear ? kTestSecondColor : null,
|
||||||
),
|
),
|
||||||
@ -88,7 +88,7 @@ class _MonthFilterState extends State<MonthFilter> {
|
|||||||
title: Text(
|
title: Text(
|
||||||
'${TranslationHelper.getFromLocale("agenda.all", appContext.getContext())} ($totalEvents)',
|
'${TranslationHelper.getFromLocale("agenda.all", appContext.getContext())} ($totalEvents)',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16.0,
|
fontSize: 14.0,
|
||||||
fontWeight: _selectedMonth == null ? FontWeight.bold : FontWeight.normal,
|
fontWeight: _selectedMonth == null ? FontWeight.bold : FontWeight.normal,
|
||||||
color: _selectedMonth == null ? kTestSecondColor : null,
|
color: _selectedMonth == null ? kTestSecondColor : null,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -38,6 +38,41 @@ class WeatherView extends StatelessWidget {
|
|||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getTranslatedDayOfWeek(int timestamp, AppContext appContext, bool isDate) {
|
||||||
|
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
|
||||||
|
|
||||||
|
String dayToPrint = "";
|
||||||
|
|
||||||
|
print("dateTime.weekday");
|
||||||
|
print(dateTime.weekday);
|
||||||
|
|
||||||
|
switch(dateTime.weekday) {
|
||||||
|
case 1:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("monday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("tuesday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("wednesday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("thursday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("friday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("saturday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
dayToPrint = TranslationHelper.getFromLocale("sunday", appContext.getContext());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isDate ? "${dayToPrint} ${formatTimestamp(timestamp, appContext, false, true)}" : dayToPrint;
|
||||||
|
}
|
||||||
|
|
||||||
List<WeatherForecast> getNextFiveDaysForecast(List<WeatherForecast> allForecasts) {
|
List<WeatherForecast> getNextFiveDaysForecast(List<WeatherForecast> allForecasts) {
|
||||||
List<WeatherForecast> nextFiveDaysForecast = [];
|
List<WeatherForecast> nextFiveDaysForecast = [];
|
||||||
DateTime today = DateTime.now();
|
DateTime today = DateTime.now();
|
||||||
@ -129,7 +164,7 @@ class WeatherView extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
height: size.height * 0.9,
|
height: size.height * 0.9,
|
||||||
width: size.width * 0.7,
|
width: size.width * 0.8,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(
|
Positioned(
|
||||||
@ -227,7 +262,7 @@ class WeatherView extends StatelessWidget {
|
|||||||
children: List.generate(
|
children: List.generate(
|
||||||
nbrNextHours,
|
nbrNextHours,
|
||||||
(index) {
|
(index) {
|
||||||
final weatherForecast = weatherData.list![index];
|
final weatherForecast = weatherData.list!.sublist(1)[index];
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -308,7 +343,7 @@ class WeatherView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Center(child: CachedNetworkImage(imageUrl: "https://openweathermap.org/img/wn/${weatherForecastNextDay.weather!.first.icon!}@2x.png")),
|
Center(child: CachedNetworkImage(imageUrl: "https://openweathermap.org/img/wn/${weatherForecastNextDay.weather!.first.icon!}@2x.png")),
|
||||||
Text('${weatherForecastNextDay.main!.temp!.round().toString()}°', style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600, color: Colors.white)),
|
Text('${weatherForecastNextDay.main!.temp!.round().toString()}°', style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600, color: Colors.white)),
|
||||||
Text('${formatTimestamp(weatherForecastNextDay.dt!, appContext, false, true)}', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: Colors.white)),
|
Text('${getTranslatedDayOfWeek(weatherForecastNextDay.dt!, appContext, true)}', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: Colors.white)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user