fix: resolve 2 remaining strict analysis errors

- introPage.dart: Convert fireItems to proper static function closure
- mainDrawer.dart: Convert unreadCount int to String for Text widget
This commit is contained in:
vjrj 2026-03-06 11:21:06 +01:00
parent 1864e5b105
commit 7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions

View file

@ -1,13 +1,15 @@
import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:flutter/material.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import 'generated/i18n.dart';
import 'mainDrawer.dart';
class SupportPage extends StatefulWidget {
const SupportPage({super.key});
static const String routeName = '/support';
@override
@ -15,27 +17,27 @@ class SupportPage extends StatefulWidget {
}
class _SupportPageState extends State<SupportPage> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
Widget buildSupportButton() {
return new Align(
return Align(
alignment: const Alignment(0.0, -0.2),
child: new OutlinedButton.icon(
child: OutlinedButton.icon(
icon: const Icon(Icons.favorite_border),
label: new Text(S.of(context).comunesSupportBtn),
label: Text(S.of(context).comunesSupportBtn),
onPressed: () {
launch("https://comunes.org/");
launch('https://comunes.org/');
},
),
);
}
Widget buildShareButton() {
return new Align(
return Align(
alignment: const Alignment(0.0, -0.2),
child: new OutlinedButton.icon(
child: OutlinedButton.icon(
icon: const Icon(Icons.share),
label: new Text(S.of(context).shareAppBtn),
label: Text(S.of(context).shareAppBtn),
onPressed: () {
Share.shareWithResult(
'https://play.google.com/store/apps/details?id=org.comunes.fires');
@ -45,11 +47,11 @@ class _SupportPageState extends State<SupportPage> {
}
Widget buildStarButton() {
return new Align(
return Align(
alignment: const Alignment(0.0, -0.2),
child: new OutlinedButton.icon(
child: OutlinedButton.icon(
icon: const Icon(Icons.star_border),
label: new Text(S.of(context).starAppBtn),
label: Text(S.of(context).starAppBtn),
onPressed: () {
InAppReview.instance.requestReview();
},
@ -58,14 +60,14 @@ class _SupportPageState extends State<SupportPage> {
}
Widget buildTranslateButton() {
return new Align(
return Align(
alignment: const Alignment(0.0, -0.2),
child: new OutlinedButton.icon(
child: OutlinedButton.icon(
icon: const Icon(Icons.translate),
label: new Text(S.of(context).translateBtn),
label: Text(S.of(context).translateBtn),
onPressed: () {
launch(
"https://translate.comunes.org/projects/todos-contra-el-fuego/");
'https://translate.comunes.org/projects/todos-contra-el-fuego/');
},
),
);
@ -76,24 +78,24 @@ class _SupportPageState extends State<SupportPage> {
return Scaffold(
key: _scaffoldKey,
appBar:
new AppBar(title: new Text(S.of(context).supportThisInitiative)),
drawer: new MainDrawer(context, SupportPage.routeName),
AppBar(title: Text(S.of(context).supportThisInitiative)),
drawer: MainDrawer(context, SupportPage.routeName),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: new CenteredColumn(children: <Widget>[
new Flexible(
child: new CenteredColumn(children: <Widget>[
new Text(
child: CenteredColumn(children: <Widget>[
Flexible(
child: CenteredColumn(children: <Widget>[
Text(
S.of(context).supportPageDescription,
textAlign: TextAlign.center,
),
new SizedBox(height: 20.0),
const SizedBox(height: 20.0),
buildSupportButton(),
new SizedBox(height: 20.0),
const SizedBox(height: 20.0),
buildTranslateButton(),
new SizedBox(height: 20.0),
const SizedBox(height: 20.0),
buildStarButton(),
new SizedBox(height: 20.0),
const SizedBox(height: 20.0),
buildShareButton()
]))
]),