mirror of
https://github.com/localsend/localsend.git
synced 2026-06-23 04:10:07 +00:00
style: flutter format
This commit is contained in:
@@ -69,9 +69,7 @@ class _ReceiveTagState extends ConsumerState<ReceiveTab> with AutomaticKeepAlive
|
||||
duration: const Duration(milliseconds: 300),
|
||||
delay: const Duration(milliseconds: 500),
|
||||
child: Text(
|
||||
serverState == null
|
||||
? t.general.offline
|
||||
: networkInfo.localIps.map((ip) => '#${ip.visualId}').toSet().join(' '),
|
||||
serverState == null ? t.general.offline : networkInfo.localIps.map((ip) => '#${ip.visualId}').toSet().join(' '),
|
||||
style: const TextStyle(fontSize: 24),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -22,7 +22,6 @@ Future<void> initAutoStartAndOpenSettings() async {
|
||||
} else {
|
||||
await launchAtStartup.disable();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ Future<void> initTray() async {
|
||||
}
|
||||
try {
|
||||
if (checkPlatform([TargetPlatform.windows])) {
|
||||
await trayManager.setIcon(Assets.img.logo32Ico,);
|
||||
await trayManager.setIcon(
|
||||
Assets.img.logo32Ico,
|
||||
);
|
||||
} else if (checkPlatform([TargetPlatform.macOS])) {
|
||||
await trayManager.setIcon(Assets.img.logo32BlackWhite.path, isTemplate: true);
|
||||
} else {
|
||||
@@ -56,4 +58,4 @@ Future<void> showFromTray() async {
|
||||
// https://github.com/localsend/localsend/issues/32
|
||||
await windowManager.setSkipTaskbar(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ class AddFileDialog extends StatelessWidget {
|
||||
);
|
||||
} else {
|
||||
context.pushBottomSheet(() => CustomBottomSheet(
|
||||
title: t.dialogs.addFile.title,
|
||||
description: t.dialogs.addFile.content,
|
||||
child: AddFileDialog(parentRef: parentRef, options: options),
|
||||
));
|
||||
title: t.dialogs.addFile.title,
|
||||
description: t.dialogs.addFile.content,
|
||||
child: AddFileDialog(parentRef: parentRef, options: options),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,17 +63,17 @@ class AddFileDialog extends StatelessWidget {
|
||||
child: option == null
|
||||
? Container()
|
||||
: BigButton(
|
||||
icon: option.icon,
|
||||
label: option.label,
|
||||
filled: true,
|
||||
onTap: () {
|
||||
context.popUntilRoot();
|
||||
option.select(
|
||||
context: context,
|
||||
ref: parentRef,
|
||||
);
|
||||
},
|
||||
),
|
||||
icon: option.icon,
|
||||
label: option.label,
|
||||
filled: true,
|
||||
onTap: () {
|
||||
context.popUntilRoot();
|
||||
option.select(
|
||||
context: context,
|
||||
ref: parentRef,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
];
|
||||
|
||||
@@ -53,8 +53,7 @@ class _AddressInputDialogState extends ConsumerState<AddressInputDialog> {
|
||||
final results = TaskRunner<Device?>(
|
||||
concurrency: 10,
|
||||
initialTasks: [
|
||||
for (final ip in candidates)
|
||||
() => ref.read(targetedDiscoveryProvider).discover(ip, port),
|
||||
for (final ip in candidates) () => ref.read(targetedDiscoveryProvider).discover(ip, port),
|
||||
],
|
||||
).stream;
|
||||
|
||||
@@ -127,26 +126,24 @@ class _AddressInputDialogState extends ConsumerState<AddressInputDialog> {
|
||||
'${t.general.example}: ${_mode == _InputMode.hashtag ? '123' : '${localIps.firstOrNull?.ipPrefix ?? '192.168.2'}.123'}',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
if (_mode == _InputMode.hashtag)
|
||||
...[
|
||||
if (localIps.length <= 1)
|
||||
if (_mode == _InputMode.hashtag) ...[
|
||||
if (localIps.length <= 1)
|
||||
Text(
|
||||
'${t.dialogs.addressInput.ip}: ${localIps.firstOrNull?.ipPrefix ?? '192.168.2'}.$_input',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
)
|
||||
else ...[
|
||||
Text(
|
||||
'${t.dialogs.addressInput.ip}:',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
for (final ip in localIps)
|
||||
Text(
|
||||
'${t.dialogs.addressInput.ip}: ${localIps.firstOrNull?.ipPrefix ?? '192.168.2'}.$_input',
|
||||
'- ${ip.ipPrefix}.$_input',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
)
|
||||
else
|
||||
...[
|
||||
Text(
|
||||
'${t.dialogs.addressInput.ip}:',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
for (final ip in localIps)
|
||||
Text(
|
||||
'- ${ip.ipPrefix}.$_input',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
if (_failed)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
|
||||
@@ -8,10 +8,15 @@ void main() {
|
||||
final results = TaskRunner<String?>(
|
||||
concurrency: 10,
|
||||
initialTasks: [
|
||||
for (final data in [[10, null], [30, 'a'], [20, 'b'], [40, 'c']])
|
||||
for (final data in [
|
||||
[10, null],
|
||||
[30, 'a'],
|
||||
[20, 'b'],
|
||||
[40, 'c']
|
||||
])
|
||||
() async {
|
||||
final delay = data[0] as int;
|
||||
final result = data[1] as String?;
|
||||
final delay = data[0] as int;
|
||||
final result = data[1] as String?;
|
||||
await sleepAsync(delay);
|
||||
return result;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user