calls/lib/main.dart

87 lines
2.9 KiB
Dart
Raw Normal View History

2024-08-06 22:37:33 -04:00
import 'package:flutter/material.dart';
2024-08-08 18:31:24 -04:00
import 'lcd.dart';
import 'keypad.dart';
2024-08-06 22:37:33 -04:00
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
2024-08-08 18:31:24 -04:00
title: 'Stillbox Calls',
2024-08-06 22:37:33 -04:00
theme: ThemeData(
2024-08-08 18:31:24 -04:00
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
2024-08-06 22:37:33 -04:00
useMaterial3: true,
),
2024-08-08 18:31:24 -04:00
darkTheme: ThemeData(
brightness: Brightness.dark,
),
themeMode: ThemeMode.dark,
home: const MainRadio(title: 'Stillbox'),
2024-08-06 22:37:33 -04:00
);
}
}
2024-08-08 18:31:24 -04:00
class MainRadio extends StatefulWidget {
const MainRadio({super.key, required this.title});
2024-08-06 22:37:33 -04:00
// 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
2024-08-08 18:31:24 -04:00
State<MainRadio> createState() => _MainRadioState();
2024-08-06 22:37:33 -04:00
}
2024-08-08 18:31:24 -04:00
class _MainRadioState extends State<MainRadio> {
2024-08-06 22:37:33 -04:00
@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(
2024-08-08 18:31:24 -04:00
body: const Center(
2024-08-06 22:37:33 -04:00
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
2024-08-08 18:31:24 -04:00
child: SizedBox(
width: 500.0,
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.start,
children: <Widget>[
ScannerLabel(),
LCD(),
Keypad(),
],
)),
2024-08-06 22:37:33 -04:00
),
);
}
}