Remove some demo project stuff

This commit is contained in:
Pyrex 2023-09-06 12:15:45 -07:00
parent 9ac4b45422
commit 6dc224b229
2 changed files with 9 additions and 59 deletions

View File

@ -3,11 +3,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const App());
} }
class MyApp extends StatelessWidget { class App extends StatelessWidget {
const MyApp({super.key}); const App({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -22,21 +22,19 @@ class MyApp extends StatelessWidget {
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: child!); child: child!);
}, },
home: const MyHomePage(title: 'DARTTERM'), home: const Viewer(),
); );
} }
} }
class MyHomePage extends StatefulWidget { class Viewer extends StatefulWidget {
const MyHomePage({super.key, required this.title}); const Viewer({super.key});
final String title;
@override @override
State<MyHomePage> createState() => _MyHomePageState(); State<Viewer> createState() => _ViewerState();
} }
class _MyHomePageState extends State<MyHomePage> { class _ViewerState extends State<Viewer> {
Ticker? ticker; Ticker? ticker;
@override @override
@ -58,22 +56,3 @@ class _MyHomePageState extends State<MyHomePage> {
setState(() {/* state changed, force a redraw */}); setState(() {/* state changed, force a redraw */});
} }
} }
/*
class TerminalCustomPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..style = PaintingStyle.stroke
..strokeWidth = 4.0
..color = Colors.indigo;
canvas.drawRect(
Rect.fromLTWH(-20 + Random().nextDouble() * 20 - 10, -20, 40, 40),
paint);
}
@override
bool shouldRepaint(TerminalCustomPainter oldDelegate) => true;
}
*/

View File

@ -1,30 +1 @@
// This is a basic Flutter widget test. void main() {}
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:dartterm/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}