Files
iroute/lib/v5_02/pages/counter/counter_page.dart
toly a1a70fae78 v6
2023-10-27 17:25:31 +08:00

36 lines
902 B
Dart

import 'package:flutter/material.dart';
class CounterPage extends StatelessWidget {
final int counter;
final VoidCallback onAddTap;
const CounterPage({super.key, required this.counter, required this.onAddTap});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$counter',
style: Theme
.of(context)
.textTheme
.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: onAddTap,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}