diff --git a/assets/laserscouterlogo.png b/assets/laserscouterlogo.png new file mode 100644 index 0000000..0027836 Binary files /dev/null and b/assets/laserscouterlogo.png differ diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5d..f08940f 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -51,7 +51,7 @@ _LoginPageState(); +} + +class _LoginPageState extends State { + final TextEditingController _teamNumberController = TextEditingController(); + final TextEditingController _apiKeyController = TextEditingController(); + + @override + void dispose() { + _teamNumberController.dispose(); + _apiKeyController.dispose(); + super.dispose(); + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Login', style: TextStyle(color: Colors.white)), + backgroundColor: const Color.fromARGB(255, 19, 81, 179), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/laserscouterlogo.png', height: 100), + const SizedBox(height: 16.0), + TextField( + controller: _teamNumberController, + decoration: const InputDecoration( + labelText: 'Team Number', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _apiKeyController, + decoration: const InputDecoration( + labelText: 'TBA API Key', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 16.0), + ElevatedButton( + onPressed: () async { + String teamNumber = _teamNumberController.text; + String apiKey = _apiKeyController.text; + Navigator.push( + context, + MaterialPageRoute(builder: (context) => EventPicker()), + ); + }, + child: const Text('Login'), + ), + ], + ), + ), + ); + } +} + diff --git a/lib/main.dart b/lib/main.dart index 7ac98a8..65e02f0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,110 +1,22 @@ import 'package:flutter/material.dart'; +import 'login.dart'; void main() { - runApp(const MyApp()); + runApp(MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); - // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Laser Scouter', - theme: ThemeData(fontFamily: 'Ocraextended', - colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent), - useMaterial3: true, + theme: ThemeData( + primarySwatch: Colors.blue, + fontFamily: 'Ocraextended', ), - home: const MyHomePage(title: 'Laser Scouter'), + home: LoginPage(), ); } -} - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // TRY THIS: Try changing the color here to a specific color (to - // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar - // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - // - // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" - // action in the IDE, or press "p" in the console), to see the - // wireframe for each widget. - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'You have pushed the button this many times:', - ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. - ); - } -} +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 55f1d09..11b7b1c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -131,6 +131,22 @@ packages: description: flutter source: sdk version: "0.0.0" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" image: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 91c34f9..1353986 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,6 +36,8 @@ dependencies: cupertino_icons: ^1.0.8 flutter_launcher_icons: ^0.14.3 + http: ^0.13.4 + dev_dependencies: flutter_test: sdk: flutter @@ -59,7 +61,8 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: + assets: + - assets/laserscouterlogo.png # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg