Address tester feedback: snackbar, filter dialog, text scaling
- Rule-deleted snackbar now auto-dismisses (persist: false) and snackbar actions use a high-contrast colour in both themes - Add-rule dialog keeps the floating label visible with the keyboard up - Dismiss focus/keyboard before swapping tab routes - Repeater status: full-width tiles on phones, no shrink-to-fit values, multi-part stats on separate lines, drop "0 days" from durations - App bar titles respect the system font size instead of scaling down; contacts controls grow with text scale; larger nav labels - Fix duplicated flood value in Japanese duplicates string
This commit is contained in:
1 parent
394df3109b
commit
03495effe6
49 files changed
+304
-39
No files matched your search
@@ -1017,6 +1017,7 @@
|
||||
"repeater_received": "Получено",
|
||||
"repeater_duplicates": "Дубликати",
|
||||
"repeater_daysHoursMinsSecs": "{days} дни {hours}ч {minutes}м {seconds}с",
|
||||
"repeater_hoursMinsSecs": "{hours}ч {minutes}м {seconds}с",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1039,6 +1039,7 @@
|
||||
"repeater_received": "Empfangen",
|
||||
"repeater_duplicates": "Duplikate",
|
||||
"repeater_daysHoursMinsSecs": "{days} Tage {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1716,6 +1716,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_hoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"hours": {
|
||||
"type": "int"
|
||||
},
|
||||
"minutes": {
|
||||
"type": "int"
|
||||
},
|
||||
"seconds": {
|
||||
"type": "int"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repeater_packetTxTotal": "Total: {total}, Flood: {flood}, Direct: {direct}",
|
||||
"@repeater_packetTxTotal": {
|
||||
"placeholders": {
|
||||
|
||||
@@ -1031,6 +1031,7 @@
|
||||
"repeater_received": "Recibidos",
|
||||
"repeater_duplicates": "Duplicados",
|
||||
"repeater_daysHoursMinsSecs": "{days} días {hours}h {minutes} min {seconds} s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes} min {seconds} s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1031,6 +1031,7 @@
|
||||
"repeater_received": "Reçu",
|
||||
"repeater_duplicates": "Doublons",
|
||||
"repeater_daysHoursMinsSecs": "{days} jours {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1245,6 +1245,7 @@
|
||||
"repeater_received": "Fogadva",
|
||||
"repeater_duplicates": "Ismétlődések",
|
||||
"repeater_daysHoursMinsSecs": "{days} nap {hours}ó {minutes}p {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}ó {minutes}p {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1076,6 +1076,7 @@
|
||||
"repeater_received": "Ricevuto",
|
||||
"repeater_duplicates": "Duplicati",
|
||||
"repeater_daysHoursMinsSecs": "{days} giorni {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
+2
-1
@@ -1213,6 +1213,7 @@
|
||||
"repeater_received": "受信済み",
|
||||
"repeater_duplicates": "重複",
|
||||
"repeater_daysHoursMinsSecs": "{days}日 {hours}時間 {minutes}分 {seconds}秒",
|
||||
"repeater_hoursMinsSecs": "{hours}時間 {minutes}分 {seconds}秒",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
@@ -1257,7 +1258,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"repeater_duplicatesFloodDirect": "{flood}: {flood}, 直接: {direct}",
|
||||
"repeater_duplicatesFloodDirect": "フラッド: {flood}, 直接: {direct}",
|
||||
"@repeater_duplicatesFloodDirect": {
|
||||
"placeholders": {
|
||||
"flood": {
|
||||
|
||||
@@ -1195,6 +1195,7 @@
|
||||
"repeater_received": "수신",
|
||||
"repeater_duplicates": "중복",
|
||||
"repeater_daysHoursMinsSecs": "{days}일 {hours}시간 {minutes}분 {seconds}초",
|
||||
"repeater_hoursMinsSecs": "{hours}시간 {minutes}분 {seconds}초",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -5654,6 +5654,12 @@ abstract class AppLocalizations {
|
||||
int seconds,
|
||||
);
|
||||
|
||||
/// No description provided for @repeater_hoursMinsSecs.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{hours}h {minutes}m {seconds}s'**
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds);
|
||||
|
||||
/// No description provided for @repeater_packetTxTotal.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -3206,6 +3206,11 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
return '$days дни $hoursч $minutesм $secondsс';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hoursч $minutesм $secondsс';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Общо: $total, Flood: $flood, Директно: $direct';
|
||||
|
||||
@@ -3205,6 +3205,11 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
return '$days Tage ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Gesamt: $total, Flood: $flood, Direkt: $direct';
|
||||
|
||||
@@ -3154,6 +3154,11 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
return '$days days ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Total: $total, Flood: $flood, Direct: $direct';
|
||||
|
||||
@@ -3193,6 +3193,11 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
return '$days días ${hours}h $minutes min $seconds s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h $minutes min $seconds s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Total: $total, Inundación: $flood, Directo: $direct';
|
||||
|
||||
@@ -3204,6 +3204,11 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
return '$days jours ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Total : $total, Tout le réseau : $flood, Direct : $direct';
|
||||
|
||||
@@ -3195,6 +3195,11 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
return '$days nap $hoursó ${minutes}p ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hoursó ${minutes}p ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Összesen: $total, Elárasztás: $flood, Közvetlen: $direct';
|
||||
|
||||
@@ -3201,6 +3201,11 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
return '$days giorni ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Totale: $total, Flood: $flood, Diretto: $direct';
|
||||
|
||||
@@ -3066,6 +3066,11 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
return '$days日 $hours時間 $minutes分 $seconds秒';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hours時間 $minutes分 $seconds秒';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return '合計: $total, フラッド: $flood, 直接: $direct';
|
||||
@@ -3078,7 +3083,7 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String repeater_duplicatesFloodDirect(String flood, String direct) {
|
||||
return '$flood: $flood, 直接: $direct';
|
||||
return 'フラッド: $flood, 直接: $direct';
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -3070,6 +3070,11 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
return '$days일 $hours시간 $minutes분 $seconds초';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hours시간 $minutes분 $seconds초';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return '총: $total, 플러딩: $flood, 직접: $direct';
|
||||
|
||||
@@ -3182,6 +3182,11 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
return '$days dagen $hours uur $minutes minuten $seconds seconden';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hours uur $minutes minuten $seconds seconden';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Totaal: $total, Flood: $flood, Direct: $direct';
|
||||
|
||||
@@ -3219,6 +3219,11 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
return '$days dni ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Razem: $total, Flood: $flood, Bezpośrednio: $direct';
|
||||
|
||||
@@ -3194,6 +3194,11 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
return '$days dias ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Total: $total, Inundação: $flood, Direto: $direct';
|
||||
|
||||
@@ -3200,6 +3200,11 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
return '$days дн. $hoursч $minutesм $secondsс';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hoursч $minutesм $secondsс';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Всего: $total, Рассылка: $flood, Прямые: $direct';
|
||||
|
||||
@@ -3191,6 +3191,11 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
return '$days dní ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Celkom: $total, Flood: $flood, Priame: $direct';
|
||||
|
||||
@@ -3184,6 +3184,11 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
return '$days dni ${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '${hours}h ${minutes}m ${seconds}s';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Skupno: $total, Flood: $flood, Neposredno: $direct';
|
||||
|
||||
@@ -3170,6 +3170,11 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
return '$days dagar $hours timmar $minutes minuter $seconds sekunder';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hours timmar $minutes minuter $seconds sekunder';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Totalt: $total, Flood: $flood, Direkt: $direct';
|
||||
|
||||
@@ -3193,6 +3193,11 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
return '$days дн. $hours год $minutes хв $seconds с';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hours год $minutes хв $seconds с';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return 'Всього: $total, Через всю мережу: $flood, Прямі: $direct';
|
||||
|
||||
@@ -3025,6 +3025,11 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
return '$days天 $hours小时 $minutes分 $seconds秒';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
|
||||
return '$hours小时 $minutes分 $seconds秒';
|
||||
}
|
||||
|
||||
@override
|
||||
String repeater_packetTxTotal(int total, String flood, String direct) {
|
||||
return '总计:$total,泛洪:$flood,直连:$direct';
|
||||
|
||||
@@ -1044,6 +1044,7 @@
|
||||
"repeater_received": "Ontvangen",
|
||||
"repeater_duplicates": "Duplicaten",
|
||||
"repeater_daysHoursMinsSecs": "{days} dagen {hours} uur {minutes} minuten {seconds} seconden",
|
||||
"repeater_hoursMinsSecs": "{hours} uur {minutes} minuten {seconds} seconden",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1027,6 +1027,7 @@
|
||||
"repeater_received": "Otrzymano",
|
||||
"repeater_duplicates": "Powtórzenia",
|
||||
"repeater_daysHoursMinsSecs": "{days} dni {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1009,6 +1009,7 @@
|
||||
"repeater_received": "Recebido",
|
||||
"repeater_duplicates": "Duplicatas",
|
||||
"repeater_daysHoursMinsSecs": "{days} dias {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -627,6 +627,7 @@
|
||||
"repeater_received": "Получено",
|
||||
"repeater_duplicates": "Дубликаты",
|
||||
"repeater_daysHoursMinsSecs": "{days} дн. {hours}ч {minutes}м {seconds}с",
|
||||
"repeater_hoursMinsSecs": "{hours}ч {minutes}м {seconds}с",
|
||||
"repeater_packetTxTotal": "Всего: {total}, Рассылка: {flood}, Прямые: {direct}",
|
||||
"repeater_packetRxTotal": "Всего: {total}, Рассылка: {flood}, Прямые: {direct}",
|
||||
"repeater_duplicatesFloodDirect": "Рассылка: {flood}, Прямые: {direct}",
|
||||
|
||||
@@ -1017,6 +1017,7 @@
|
||||
"repeater_received": "Prijaté",
|
||||
"repeater_duplicates": "Duplikáty",
|
||||
"repeater_daysHoursMinsSecs": "{days} dní {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1009,6 +1009,7 @@
|
||||
"repeater_received": "Prejeto",
|
||||
"repeater_duplicates": "Duplikati",
|
||||
"repeater_daysHoursMinsSecs": "{days} dni {hours}h {minutes}m {seconds}s",
|
||||
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1010,6 +1010,7 @@
|
||||
"repeater_received": "Mottaget",
|
||||
"repeater_duplicates": "Dubbletter",
|
||||
"repeater_daysHoursMinsSecs": "{days} dagar {hours} timmar {minutes} minuter {seconds} sekunder",
|
||||
"repeater_hoursMinsSecs": "{hours} timmar {minutes} minuter {seconds} sekunder",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1027,6 +1027,7 @@
|
||||
"repeater_received": "Отримано",
|
||||
"repeater_duplicates": "Дублікати",
|
||||
"repeater_daysHoursMinsSecs": "{days} дн. {hours} год {minutes} хв {seconds} с",
|
||||
"repeater_hoursMinsSecs": "{hours} год {minutes} хв {seconds} с",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -1039,6 +1039,7 @@
|
||||
"repeater_received": "接收",
|
||||
"repeater_duplicates": "重复",
|
||||
"repeater_daysHoursMinsSecs": "{days}天 {hours}小时 {minutes}分 {seconds}秒",
|
||||
"repeater_hoursMinsSecs": "{hours}小时 {minutes}分 {seconds}秒",
|
||||
"@repeater_daysHoursMinsSecs": {
|
||||
"placeholders": {
|
||||
"days": {
|
||||
|
||||
@@ -697,6 +697,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 1) return;
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
||||
@@ -795,7 +795,7 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
),
|
||||
],
|
||||
child: SizedBox(
|
||||
height: 48,
|
||||
height: _controlHeight(context),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Theme.of(context).colorScheme.outline),
|
||||
@@ -821,6 +821,13 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
);
|
||||
}
|
||||
|
||||
/// Height of the group/search controls; grows with the system font size so
|
||||
/// larger text is not clipped.
|
||||
double _controlHeight(BuildContext context) {
|
||||
final textHeight = MediaQuery.textScalerOf(context).scale(16) * 1.5;
|
||||
return (textHeight + 20).clamp(48.0, 120.0);
|
||||
}
|
||||
|
||||
Widget _buildContactsBody(BuildContext context, MeshCoreConnector connector) {
|
||||
final viewState = context.watch<UiViewStateService>();
|
||||
final contacts = connector.contacts;
|
||||
@@ -958,7 +965,7 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
width: viewState.contactsSearchExpanded
|
||||
? searchExpandedWidth
|
||||
: searchCollapsedWidth,
|
||||
height: 48,
|
||||
height: _controlHeight(context),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
@@ -1266,6 +1273,7 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 0) return;
|
||||
switch (index) {
|
||||
case 1:
|
||||
|
||||
@@ -1728,6 +1728,7 @@ class _LineOfSightMapScreenState extends State<LineOfSightMapScreen> {
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 2) {
|
||||
Navigator.pop(context);
|
||||
return;
|
||||
|
||||
@@ -3170,6 +3170,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 2) return;
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
||||
@@ -178,6 +178,8 @@ class _RulesList extends StatelessWidget {
|
||||
SnackBar(
|
||||
content: Text(l10n.messageFilter_ruleDeleted),
|
||||
duration: const Duration(seconds: 6),
|
||||
// Newer Flutter persists snackbars with an action unless told not to.
|
||||
persist: false,
|
||||
action: SnackBarAction(
|
||||
label: l10n.common_undo,
|
||||
onPressed: () =>
|
||||
|
||||
@@ -374,15 +374,24 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
final hours = (seconds % 86400) ~/ 3600;
|
||||
final minutes = (seconds % 3600) ~/ 60;
|
||||
final secs = seconds % 60;
|
||||
if (days == 0) return l10n.repeater_hoursMinsSecs(hours, minutes, secs);
|
||||
return l10n.repeater_daysHoursMinsSecs(days, hours, minutes, secs);
|
||||
}
|
||||
|
||||
/// Puts each "Label: n" part of a multi-part stat on its own line. Matches
|
||||
/// the comma separators used across locales (ASCII, fullwidth, ideographic,
|
||||
/// Arabic); the values themselves are unformatted integers.
|
||||
static final _partSeparator = RegExp(r'\s*[,\uFF0C\u3001\u060C]\s*');
|
||||
String _multiLine(String text) => text.split(_partSeparator).join('\n');
|
||||
|
||||
String _packetTxText() {
|
||||
if (_packetsSent == null) return '—';
|
||||
final l10n = context.l10n;
|
||||
final flood = _formatValue(_floodTx);
|
||||
final direct = _formatValue(_directTx);
|
||||
return l10n.repeater_packetTxTotal(_packetsSent!, flood, direct);
|
||||
return _multiLine(
|
||||
l10n.repeater_packetTxTotal(_packetsSent!, flood, direct),
|
||||
);
|
||||
}
|
||||
|
||||
String _packetRxText() {
|
||||
@@ -390,7 +399,9 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
final l10n = context.l10n;
|
||||
final flood = _formatValue(_floodRx);
|
||||
final direct = _formatValue(_directRx);
|
||||
return l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct);
|
||||
return _multiLine(
|
||||
l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct),
|
||||
);
|
||||
}
|
||||
|
||||
String _chanUtilText() {
|
||||
@@ -403,7 +414,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
if (_dupFlood != null || _dupDirect != null) {
|
||||
final flood = _formatValue(_dupFlood);
|
||||
final direct = _formatValue(_dupDirect);
|
||||
return l10n.repeater_duplicatesFloodDirect(flood, direct);
|
||||
return _multiLine(l10n.repeater_duplicatesFloodDirect(flood, direct));
|
||||
}
|
||||
if (_packetsRecv == null || _floodRx == null || _directRx == null) {
|
||||
return '—';
|
||||
@@ -702,7 +713,8 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
final textScaler = MediaQuery.textScalerOf(context);
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final columns = constraints.maxWidth / textScaler.scale(1) < 320
|
||||
// One full-width tile per row on phones; two columns on wide screens.
|
||||
final columns = constraints.maxWidth / textScaler.scale(1) < 520
|
||||
? 1
|
||||
: 2;
|
||||
// Rows size to their tallest tile, so labels that wrap at large
|
||||
|
||||
@@ -558,7 +558,7 @@ class MeshTheme {
|
||||
return TextStyle(
|
||||
fontFamily: MeshFonts.sans,
|
||||
fontFamilyFallback: MeshFonts.sansFallback,
|
||||
fontSize: 11.5,
|
||||
fontSize: 12,
|
||||
fontWeight: selected ? FontWeight.w700 : FontWeight.w500,
|
||||
letterSpacing: 0.1,
|
||||
color: selected ? scheme.onPrimary : scheme.onSurfaceVariant,
|
||||
@@ -591,7 +591,9 @@ class MeshTheme {
|
||||
),
|
||||
snackBarTheme: SnackBarThemeData(
|
||||
backgroundColor: scheme.surfaceContainerHigh,
|
||||
contentTextStyle: TextStyle(color: scheme.onSurface),
|
||||
contentTextStyle: TextStyle(color: scheme.onSurface, fontSize: 16),
|
||||
actionTextColor: scheme.onSurface,
|
||||
disabledActionTextColor: scheme.onSurfaceVariant,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// App bar title that honors the system font size. Long titles are
|
||||
/// ellipsized instead of being shrunk to fit.
|
||||
class AdaptiveAppBarTitle extends StatelessWidget {
|
||||
final String text;
|
||||
|
||||
@@ -7,11 +9,6 @@ class AdaptiveAppBarTitle extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) => SizedBox(
|
||||
width: constraints.maxWidth,
|
||||
child: FittedBox(fit: BoxFit.scaleDown, child: Text(text, maxLines: 1)),
|
||||
),
|
||||
);
|
||||
return Text(text, maxLines: 1, overflow: TextOverflow.ellipsis);
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,11 @@ class _FilterRuleDialogState extends State<_FilterRuleDialog> {
|
||||
content: SizedBox(
|
||||
width: 420,
|
||||
child: SingleChildScrollView(
|
||||
// The outlined field's floating label is painted above the field's
|
||||
// box, outside the scroll content bounds. Without top padding the
|
||||
// viewport clips it (worst when the focused field is scrolled flush
|
||||
// to the top while the keyboard is open).
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -107,6 +112,14 @@ class _FilterRuleDialogState extends State<_FilterRuleDialog> {
|
||||
TextField(
|
||||
controller: _controller,
|
||||
autofocus: true,
|
||||
// Keep room above the field when it is scrolled into view, so
|
||||
// the floating label (drawn above the box) is not clipped.
|
||||
scrollPadding: EdgeInsets.fromLTRB(
|
||||
20,
|
||||
16 + MediaQuery.textScalerOf(context).scale(16),
|
||||
20,
|
||||
20,
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 4,
|
||||
textInputAction: TextInputAction.done,
|
||||
|
||||
+19
-23
@@ -243,7 +243,7 @@ class StatTile extends StatelessWidget {
|
||||
label.toUpperCase(),
|
||||
style: MeshTheme.accentLabel(
|
||||
color: scheme.onSurfaceVariant,
|
||||
fontSize: 12,
|
||||
fontSize: 14,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -252,30 +252,26 @@ class StatTile extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: value,
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
children: [
|
||||
if (unit != null)
|
||||
TextSpan(
|
||||
text: ' $unit',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
text: value,
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
maxLines: 1,
|
||||
children: [
|
||||
if (unit != null)
|
||||
TextSpan(
|
||||
text: ' $unit',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
softWrap: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
|
||||
double _contrast(Color a, Color b) {
|
||||
final la = a.computeLuminance();
|
||||
final lb = b.computeLuminance();
|
||||
final hi = la > lb ? la : lb;
|
||||
final lo = la > lb ? lb : la;
|
||||
return (hi + 0.05) / (lo + 0.05);
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('snackbar action text is readable in light and dark themes', () {
|
||||
for (final theme in [MeshTheme.light(), MeshTheme.dark()]) {
|
||||
final sb = theme.snackBarTheme;
|
||||
expect(sb.actionTextColor, isNotNull);
|
||||
expect(
|
||||
_contrast(sb.actionTextColor!, sb.backgroundColor!),
|
||||
greaterThanOrEqualTo(4.5),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('snackbar with action and persist:false auto-dismisses', (
|
||||
tester,
|
||||
) async {
|
||||
late BuildContext ctx;
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
home: Scaffold(
|
||||
body: Builder(
|
||||
builder: (c) {
|
||||
ctx = c;
|
||||
return const SizedBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
ScaffoldMessenger.of(ctx).showSnackBar(
|
||||
SnackBar(
|
||||
content: const Text('Rule deleted'),
|
||||
duration: const Duration(seconds: 6),
|
||||
persist: false,
|
||||
action: SnackBarAction(label: 'Undo', onPressed: () {}),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
expect(find.text('Rule deleted'), findsOneWidget);
|
||||
await tester.pump(const Duration(seconds: 7));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Rule deleted'), findsNothing);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/widgets/filter_rule_dialog.dart';
|
||||
|
||||
void main() {
|
||||
for (final scale in [1.0, 2.0]) {
|
||||
testWidgets('floating label is not clipped with keyboard (scale $scale)', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1080, 1400);
|
||||
tester.view.devicePixelRatio = 2.75;
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
builder: (context, child) {
|
||||
final mq = MediaQuery.of(context);
|
||||
return MediaQuery(
|
||||
data: mq.copyWith(
|
||||
textScaler: TextScaler.linear(scale),
|
||||
viewInsets: const EdgeInsets.only(bottom: 150),
|
||||
),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
home: Builder(
|
||||
builder: (context) => TextButton(
|
||||
onPressed: () => showFilterRuleDialog(context),
|
||||
child: const Text('open'),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.tap(find.text('open'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final scrollRect = tester.getRect(find.byType(SingleChildScrollView));
|
||||
final labelRect = tester.getRect(find.byType(InputDecorator));
|
||||
// The floating label sits above the field box; the scroll viewport must
|
||||
// start above the field with room for it.
|
||||
final fieldTop = labelRect.top;
|
||||
expect(fieldTop - scrollRect.top, greaterThanOrEqualTo(8 * scale));
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user