Skip to content

Commit f373a0f

Browse files
committed
Format code
1 parent ee672a8 commit f373a0f

4 files changed

Lines changed: 14 additions & 18 deletions

File tree

lib/game/game_logic.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,8 @@ class GameLogic extends ChangeNotifier {
745745
// If the current piece now overlaps the pushed-up stack, move it up
746746
if (currentPiece != null &&
747747
!canPlacePiece(currentX, currentY, currentPiece!)) {
748-
while (currentY > 0 &&
749-
!canPlacePiece(currentX, currentY, currentPiece!)) {
748+
while (
749+
currentY > 0 && !canPlacePiece(currentX, currentY, currentPiece!)) {
750750
currentY--;
751751
}
752752
if (!canPlacePiece(currentX, currentY, currentPiece!)) {

lib/multiplayer/multiplayer_manager.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ class MultiplayerManager extends ChangeNotifier {
5757
String? get localIp => _localIp;
5858
String? get broadcastAddress => _broadcastAddress;
5959

60-
MultiplayerManager({required this.playerName})
61-
: playerId = _generateId();
60+
MultiplayerManager({required this.playerName}) : playerId = _generateId();
6261

6362
static String _generateId() {
6463
final r = Random.secure();
@@ -77,9 +76,8 @@ class MultiplayerManager extends ChangeNotifier {
7776

7877
try {
7978
_localIp = await _getLocalIp();
80-
_broadcastAddress = _localIp != null
81-
? _directedBroadcast(_localIp!)
82-
: '255.255.255.255';
79+
_broadcastAddress =
80+
_localIp != null ? _directedBroadcast(_localIp!) : '255.255.255.255';
8381
await _startUdp();
8482
await _startTcpServer();
8583
_startAnnouncing();
@@ -187,8 +185,7 @@ class MultiplayerManager extends ChangeNotifier {
187185
// Android (EPERM); harmless since we already have the directed address.
188186
if (_broadcastAddress != '255.255.255.255') {
189187
try {
190-
_udpSocket!.send(
191-
data, InternetAddress('255.255.255.255'), _udpPort);
188+
_udpSocket!.send(data, InternetAddress('255.255.255.255'), _udpPort);
192189
} catch (_) {}
193190
}
194191
}
@@ -238,8 +235,7 @@ class MultiplayerManager extends ChangeNotifier {
238235
}
239236

240237
void _startPeerExpiryTimer() {
241-
_peerExpiryTimer =
242-
Timer.periodic(const Duration(seconds: 3), (_) {
238+
_peerExpiryTimer = Timer.periodic(const Duration(seconds: 3), (_) {
243239
final before = peers.length;
244240
final cutoff = DateTime.now().subtract(const Duration(seconds: 6));
245241
peers.removeWhere((p) => p.lastSeen.isBefore(cutoff));

lib/screens/multiplayer_discovery_screen.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ class _MultiplayerDiscoveryScreenState
124124
await vbs.writeAsString(
125125
'Set sh = CreateObject("Shell.Application")\r\n'
126126
'sh.ShellExecute "netsh", '
127-
'"advfirewall firewall add rule '
128-
'name=""Block Drop"" dir=in action=allow '
129-
'program=""$exe"" profile=any", '
130-
'"", "runas", 1\r\n',
127+
'"advfirewall firewall add rule '
128+
'name=""Block Drop"" dir=in action=allow '
129+
'program=""$exe"" profile=any", '
130+
'"", "runas", 1\r\n',
131131
);
132132
await Process.run('wscript', [vbs.path]);
133133
// Give the UAC-elevated process time to complete.
@@ -529,7 +529,8 @@ class _LobbyPlayerTile extends StatelessWidget {
529529
label,
530530
style: TextStyle(
531531
fontSize: 12,
532-
color: isYou ? colorScheme.primary : colorScheme.onSurfaceVariant,
532+
color:
533+
isYou ? colorScheme.primary : colorScheme.onSurfaceVariant,
533534
fontWeight: FontWeight.w500,
534535
),
535536
),

lib/widgets/swipe_detector.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ class _SwipeDetectorState extends State<SwipeDetector> {
118118
details.velocity.pixelsPerSecond.dx.abs() >
119119
details.velocity.pixelsPerSecond.dy.abs() * 2 &&
120120
!widget.gameLogic.isSlamming) {
121-
final direction =
122-
details.velocity.pixelsPerSecond.dx > 0 ? 1 : -1;
121+
final direction = details.velocity.pixelsPerSecond.dx > 0 ? 1 : -1;
123122
final extraMoves =
124123
(details.velocity.pixelsPerSecond.dx.abs() / 1200.0)
125124
.clamp(0.0, 2.0)

0 commit comments

Comments
 (0)