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 createState() => _CountersPageState(); } class _CountersPageState extends State { @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(), ); } }