You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.8 KiB

7 months ago
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class CountersPage extends StatefulWidget {
const CountersPage({super.key, required this.title, required this.comments});
final String title;
final String comments;
@override
State<CountersPage> createState() => _CountersPageState();
}
class _CountersPageState extends State<CountersPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
widget.title,
style: Theme.of(context).textTheme.bodyLarge,
),
Text(
widget.comments,
style: Theme.of(context).textTheme.bodySmall,
),
],
),
),
body: const SizedBox(),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const NewCounterPage()))
.then((_) => setState(() {}));
},
tooltip: AppLocalizations.of(context)!.add_new_counter_tooltip,
child: const Icon(Icons.add),
));
}
}
class NewCounterPage extends StatelessWidget {
const NewCounterPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(AppLocalizations.of(context)!.new_counter_title)),
body: const SizedBox(),
);
}
}