Skip to content

Commit f4cc3e5

Browse files
authored
Debug updates (#89)
* remove dependabot.yml * random bike id Allows you to create unlimited amount of bikes
1 parent e9074e2 commit f4cc3e5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/debug.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
import 'package:flutter/material.dart';
22
import 'package:superduper/help.dart';
3+
import 'dart:math';
34

45
import 'bike.dart';
56
import 'edit_bike.dart';
67

78
class DebugPage extends StatelessWidget {
89
const DebugPage({super.key});
910

11+
// Function to generate a random MAC address
12+
String _generateRandomMac() {
13+
final random = Random();
14+
final parts = List.generate(6, (_) => random.nextInt(256));
15+
return parts.map((part) => part.toRadixString(16).padLeft(2, '0')).join(':');
16+
}
17+
1018
@override
1119
Widget build(BuildContext context) {
1220
return Scaffold(
@@ -41,7 +49,7 @@ class DebugPage extends StatelessWidget {
4149
context: context,
4250
builder: (BuildContext context) {
4351
return BikeSettingsWidget(
44-
bike: BikeState.defaultState('1'));
52+
bike: BikeState.defaultState(_generateRandomMac()));
4553
});
4654
},
4755
child: const Text('Form'),
@@ -50,4 +58,4 @@ class DebugPage extends StatelessWidget {
5058
),
5159
);
5260
}
53-
}
61+
}

0 commit comments

Comments
 (0)