Added bottom options and reset.

This commit is contained in:
Raktbastr 2026-01-23 17:27:24 -06:00
parent 78618aed9a
commit 84aaf9c527
6 changed files with 125 additions and 10 deletions

View file

@ -4,6 +4,7 @@ import 'core/theme.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'eventpicker.dart';
import 'settings.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(const MyApp());
@ -49,6 +50,12 @@ class _LoginPageState extends State<LoginPage> {
await prefs.setString('teamNumber', _teamNumberController.text);
}
Future<void> _launchUrl(Uri url) async {
if (!await launchUrl(url)) {
throw Exception('Could not launch $url');
}
}
@override
void dispose() {
_teamNumberController.dispose();
@ -65,7 +72,7 @@ class _LoginPageState extends State<LoginPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/main.png', height: 100),
Image.asset('assets/main.png', height: 75, alignment: Alignment.center),
const SizedBox(height: 16.0),
TextField(
controller: _teamNumberController,
@ -120,9 +127,38 @@ class _LoginPageState extends State<LoginPage> {
),
)
: const Text('Login'),
)
],
),
),
bottomNavigationBar: Padding (
padding: const EdgeInsets.all(50.0),
child: Row (
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
child: const Text('Info'),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Info'),
content: const Text(
"This app makes use of The Blue Alliance APIv3 through Laser Proxy. No API keys are stored on device. Laser Scouter was created by FRC 2077 Laser Robotics. \n\nVersion: Rebuilt 26.1.23"
),
);
}
);
},
),
const SizedBox(height: 8),
ElevatedButton(
TextButton(
child: const Text('Github'),
onPressed: () {
_launchUrl(Uri.parse('https://github.com/raktbastr/laserscouter'));
}
),
TextButton(
onPressed: _isLoading
? null
: () {
@ -130,13 +166,14 @@ class _LoginPageState extends State<LoginPage> {
context,
MaterialPageRoute(
builder: (context) => const SettingsPage(),
));
)
);
},
child: const Text('Settings'),
),
],
),
),
)
]
)
)
);
}
}