添加按钮

null_safety
小赖 4 years ago
parent 35c0961606
commit ffd0c44e36

@ -1,7 +1,3 @@
library ansu_ui; library ansu_ui;
/// A Calculator. export 'buttons/as_button.dart';
class Calculator {
/// Returns [value] plus 1.
int addOne(int value) => value + 1;
}

@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
///
class ASButton extends StatefulWidget {
ASButton({Key key}) : super(key: key);
@override
_ASButtonState createState() => _ASButtonState();
}
class _ASButtonState extends State<ASButton> {
@override
Widget build(BuildContext context) {
return SizedBox();
}
}

@ -1,13 +0,0 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:ansu_ui/ansu_ui.dart';
void main() {
test('adds one to input values', () {
final calculator = Calculator();
expect(calculator.addOne(2), 3);
expect(calculator.addOne(-7), -6);
expect(calculator.addOne(0), 1);
expect(() => calculator.addOne(null), throwsNoSuchMethodError);
});
}
Loading…
Cancel
Save