1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-20 00:35:17 +00:00

Fix a few notices

This commit is contained in:
2022-03-11 16:36:42 +01:00
parent 06312512a6
commit 45e8f34c81
26 changed files with 38 additions and 110 deletions

View File

@ -13,8 +13,7 @@ class BBCodeParsedWidget extends StatelessWidget {
final ParseCallBack? parseCallback;
BBCodeParsedWidget({required String text, this.parseCallback})
: assert(text != null),
_content = _parse(text);
: _content = _parse(text);
_printRecur(_Element el, {int pos = 0}) {
String str;
@ -239,7 +238,7 @@ class _Element {
if (parseCallback != null && text != null) {
final parsed = parseCallback(generatedStyle, text);
if (parsed != null && parsed.length > 0)
if (parsed.length > 0)
return TextSpan(
style: generatedStyle,
children: parsed,

View File

@ -16,9 +16,6 @@ void popPage(BuildContext context) {
/// Open the page of a user
void openUserPage({required int userID, required BuildContext context}) {
assert(userID != null);
assert(context != null);
MainController.of(context)!.openUserPage(userID);
}

View File

@ -101,13 +101,6 @@ Future<String?> askUserString({
int maxLength = 200,
int minLength = 1,
}) async {
assert(context != null);
assert(title != null);
assert(message != null);
assert(defaultValue != null);
assert(hint != null);
assert(maxLength != null);
TextEditingController controller = TextEditingController(text: defaultValue);
final confirm = await showDialog<bool>(
@ -257,7 +250,8 @@ const darkAccentColor = Colors.white70;
const darkerAccentColor = Colors.white30;
/// Check out whether dark theme is enabled or not
bool darkTheme() => preferences()!.getBool(PreferencesKeyList.ENABLE_DARK_THEME);
bool darkTheme() =>
preferences()!.getBool(PreferencesKeyList.ENABLE_DARK_THEME);
/// Check out whether we use tablet mode or not
bool isTablet(BuildContext context) =>