mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-20 16:55:17 +00:00
Start to fix null safety migration errors
This commit is contained in:
@ -29,7 +29,7 @@ List<Widget> buildTour(TourRouteState state) {
|
||||
msgTwo: tr("Let's first join a Forez group!"),
|
||||
),
|
||||
JoinForezGroupPane(
|
||||
key: state.pubKeys[_JOIN_GROUP_KEY_ID],
|
||||
key: state.pubKeys[_JOIN_GROUP_KEY_ID] as GlobalKey<JoinGroupPaneBodyState>?,
|
||||
onUpdated: () => state.rebuild(),
|
||||
),
|
||||
FirstTourPane(
|
||||
@ -51,7 +51,7 @@ List<Widget> buildTour(TourRouteState state) {
|
||||
// Forez specific features
|
||||
PresentationPane(
|
||||
icon: Icons.calendar_today,
|
||||
title: tr("Presence in Forez"),
|
||||
title: tr("Presence in Forez")!,
|
||||
text: tr(
|
||||
"Easily specify the days you are in Forez plain, so that everyone can know it!"),
|
||||
actionTitle: tr("Do it now!"),
|
||||
@ -62,7 +62,7 @@ List<Widget> buildTour(TourRouteState state) {
|
||||
// Chat pane
|
||||
PresentationPane(
|
||||
icon: Icons.question_answer,
|
||||
title: tr("Conversations"),
|
||||
title: tr("Conversations")!,
|
||||
text: tr(
|
||||
"#Forez now integrates the conversation system of Comunic, so you have access both to public and private conversations!"),
|
||||
),
|
||||
|
@ -16,17 +16,17 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class JoinForezGroupPane extends PresentationPane {
|
||||
JoinForezGroupPane({
|
||||
@required Function() onUpdated,
|
||||
@required GlobalKey<JoinGroupPaneBodyState> key,
|
||||
required Function() onUpdated,
|
||||
required GlobalKey<JoinGroupPaneBodyState>? key,
|
||||
}) : super(
|
||||
icon: Icons.login,
|
||||
title: tr("Join a Forez group"),
|
||||
title: tr("Join a Forez group")!,
|
||||
child: (c) => _JoinGroupPaneBody(
|
||||
key: key,
|
||||
onUpdated: onUpdated,
|
||||
),
|
||||
canGoNext: key?.currentState?.canGoNext ?? false,
|
||||
onTapNext: (c) => key.currentState.validateChoice(),
|
||||
onTapNext: (c) => key!.currentState!.validateChoice(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -34,8 +34,8 @@ class _JoinGroupPaneBody extends StatefulWidget {
|
||||
final Function() onUpdated;
|
||||
|
||||
const _JoinGroupPaneBody({
|
||||
Key key,
|
||||
@required this.onUpdated,
|
||||
Key? key,
|
||||
required this.onUpdated,
|
||||
}) : assert(onUpdated != null),
|
||||
super(key: key);
|
||||
|
||||
@ -46,10 +46,10 @@ class _JoinGroupPaneBody extends StatefulWidget {
|
||||
class JoinGroupPaneBodyState extends State<_JoinGroupPaneBody> {
|
||||
final _key = GlobalKey<AsyncScreenWidgetState>();
|
||||
|
||||
List<Group> _groups;
|
||||
int _currChoice;
|
||||
late List<Group> _groups;
|
||||
int? _currChoice;
|
||||
|
||||
bool get canGoNext => _currChoice != null && _currChoice > 0;
|
||||
bool get canGoNext => _currChoice != null && _currChoice! > 0;
|
||||
|
||||
Group get _currGroup => _groups.firstWhere((e) => e.id == _currChoice);
|
||||
|
||||
@ -65,17 +65,17 @@ class JoinGroupPaneBodyState extends State<_JoinGroupPaneBody> {
|
||||
key: _key,
|
||||
onReload: _load,
|
||||
onBuild: onBuild,
|
||||
errorMessage: tr("Failed to load the list of Forez groups!"));
|
||||
errorMessage: tr("Failed to load the list of Forez groups!")!);
|
||||
|
||||
Widget onBuild() => ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 300),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(tr("Please choose now the Forez group you want to join...")),
|
||||
Text(tr("Please choose now the Forez group you want to join...")!),
|
||||
]..addAll(_groups.map((e) => RadioListTile(
|
||||
value: e.id,
|
||||
groupValue: _currChoice,
|
||||
onChanged: (v) => setState(() => _currChoice = e.id),
|
||||
onChanged: (dynamic v) => setState(() => _currChoice = e.id),
|
||||
title: Text(e.name),
|
||||
subtitle: Text(e.membershipText),
|
||||
))),
|
||||
@ -112,7 +112,7 @@ class JoinGroupPaneBodyState extends State<_JoinGroupPaneBody> {
|
||||
await alert(context,
|
||||
"${tr("You can not access this group yet, please wait for a member of the group to accept your request.")}\n${tr("Hopefully this will not be too long.")}\n${tr("Please check back soon!")}");
|
||||
|
||||
_key.currentState.refresh();
|
||||
_key.currentState!.refresh();
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -121,8 +121,8 @@ class JoinGroupPaneBodyState extends State<_JoinGroupPaneBody> {
|
||||
return true;
|
||||
} catch (e, s) {
|
||||
logError(e, s);
|
||||
snack(context, tr("Failed to register to group!"));
|
||||
_key.currentState.refresh();
|
||||
snack(context, tr("Failed to register to group!")!);
|
||||
_key.currentState!.refresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user