mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-08-11 18:26:27 +10:00
dart format
This commit is contained in:
@@ -76,8 +76,7 @@ class Cyr2LatProfile {
|
|||||||
|
|
||||||
class AppSettings {
|
class AppSettings {
|
||||||
static const Object _unset = Object();
|
static const Object _unset = Object();
|
||||||
static const String stadiaDemo =
|
static const String stadiaDemo = '51bd0381-4685-4666-bae8-48940f6d77c0';
|
||||||
'51bd0381-4685-4666-bae8-48940f6d77c0';
|
|
||||||
|
|
||||||
final bool clearPathOnMaxRetry;
|
final bool clearPathOnMaxRetry;
|
||||||
final bool mapShowRepeaters;
|
final bool mapShowRepeaters;
|
||||||
@@ -137,8 +136,7 @@ class AppSettings {
|
|||||||
return apiKey;
|
return apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get usesstadiaDemo =>
|
bool get usesstadiaDemo => effectiveMapTileApiKey == stadiaDemo;
|
||||||
effectiveMapTileApiKey == stadiaDemo;
|
|
||||||
|
|
||||||
Map<String, String> get cyr2latCharMap {
|
Map<String, String> get cyr2latCharMap {
|
||||||
final profile = cyr2latProfiles.firstWhere(
|
final profile = cyr2latProfiles.firstWhere(
|
||||||
|
|||||||
@@ -1153,9 +1153,7 @@ class AppSettingsScreen extends StatelessWidget {
|
|||||||
) {
|
) {
|
||||||
final currentApiKey = settingsService.settings.mapTileApiKey?.trim() ?? '';
|
final currentApiKey = settingsService.settings.mapTileApiKey?.trim() ?? '';
|
||||||
final maskedApiKey = _maskApiKey(
|
final maskedApiKey = _maskApiKey(
|
||||||
currentApiKey.isEmpty
|
currentApiKey.isEmpty ? AppSettings.stadiaDemo : currentApiKey,
|
||||||
? AppSettings.stadiaDemo
|
|
||||||
: currentApiKey,
|
|
||||||
);
|
);
|
||||||
final controller = TextEditingController(text: maskedApiKey);
|
final controller = TextEditingController(text: maskedApiKey);
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|||||||
@@ -700,9 +700,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
context.l10n.channels_via(
|
context.l10n.channels_via(
|
||||||
_formatPathPrefixes(
|
_formatPathPrefixes(
|
||||||
displayPath,
|
displayPath,
|
||||||
displayPathHashWidth,
|
displayPathHashWidth,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: MeshTheme.mono(
|
style: MeshTheme.mono(
|
||||||
fontSize: 9.5 * textScale,
|
fontSize: 9.5 * textScale,
|
||||||
@@ -1214,25 +1214,19 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: context.l10n.chat_typeMessage,
|
hintText: context.l10n.chat_typeMessage,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||||
MeshRadii.md,
|
|
||||||
),
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: scheme.outlineVariant,
|
color: scheme.outlineVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||||
MeshRadii.md,
|
|
||||||
),
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: scheme.outlineVariant,
|
color: scheme.outlineVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||||
MeshRadii.md,
|
|
||||||
),
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: scheme.primary,
|
color: scheme.primary,
|
||||||
width: 1.5,
|
width: 1.5,
|
||||||
|
|||||||
@@ -412,7 +412,8 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
|||||||
final messages = connector.getChannelMessages(channel);
|
final messages = connector.getChannelMessages(channel);
|
||||||
final lastMessage = messages.isNotEmpty ? messages.last : null;
|
final lastMessage = messages.isNotEmpty ? messages.last : null;
|
||||||
final lastMessageText = lastMessage?.text ?? '';
|
final lastMessageText = lastMessage?.text ?? '';
|
||||||
final lastPreview = lastMessageText.isNotEmpty &&
|
final lastPreview =
|
||||||
|
lastMessageText.isNotEmpty &&
|
||||||
GifHelper.parseGif(lastMessageText) != null
|
GifHelper.parseGif(lastMessageText) != null
|
||||||
? context.l10n.chat_receivedGif
|
? context.l10n.chat_receivedGif
|
||||||
: lastMessageText;
|
: lastMessageText;
|
||||||
|
|||||||
@@ -643,7 +643,6 @@ void main() {
|
|||||||
expect(contacts.first.path, equals(Uint8List.fromList([0x11, 0x22])));
|
expect(contacts.first.path, equals(Uint8List.fromList([0x11, 0x22])));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
group('AppSettingsService — gps interval fallback', () {
|
group('AppSettingsService — gps interval fallback', () {
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ class _FakeStorageService extends StorageService {
|
|||||||
ContactPathHistory history,
|
ContactPathHistory history,
|
||||||
) async {}
|
) async {}
|
||||||
@override
|
@override
|
||||||
Future<ContactPathHistory?> loadPathHistory(String contactPubKeyHex) async => null;
|
Future<ContactPathHistory?> loadPathHistory(String contactPubKeyHex) async =>
|
||||||
|
null;
|
||||||
@override
|
@override
|
||||||
Future<void> clearPathHistory(String contactPubKeyHex) async {}
|
Future<void> clearPathHistory(String contactPubKeyHex) async {}
|
||||||
}
|
}
|
||||||
@@ -76,9 +77,12 @@ Widget _buildTestApp({
|
|||||||
return MultiProvider(
|
return MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
ChangeNotifierProvider<MeshCoreConnector>.value(value: connector),
|
ChangeNotifierProvider<MeshCoreConnector>.value(value: connector),
|
||||||
ChangeNotifierProvider<AppSettingsService>.value(value: appSettingsService),
|
ChangeNotifierProvider<AppSettingsService>.value(
|
||||||
|
value: appSettingsService,
|
||||||
|
),
|
||||||
ChangeNotifierProvider<MapTileCacheService>(
|
ChangeNotifierProvider<MapTileCacheService>(
|
||||||
create: (_) => MapTileCacheService(appSettingsService: appSettingsService),
|
create: (_) =>
|
||||||
|
MapTileCacheService(appSettingsService: appSettingsService),
|
||||||
),
|
),
|
||||||
ChangeNotifierProvider<PathHistoryService>(
|
ChangeNotifierProvider<PathHistoryService>(
|
||||||
create: (_) => PathHistoryService(_FakeStorageService()),
|
create: (_) => PathHistoryService(_FakeStorageService()),
|
||||||
|
|||||||
Reference in New Issue
Block a user