mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 12:14:11 +00:00 
			
		
		
		
	Fix a few notices
This commit is contained in:
		@@ -11,9 +11,7 @@ Future<void> alert(BuildContext context, String? msg) async {
 | 
			
		||||
class _AlertDialog extends StatelessWidget {
 | 
			
		||||
  final String msg;
 | 
			
		||||
 | 
			
		||||
  const _AlertDialog({Key? key, required this.msg})
 | 
			
		||||
      : assert(msg != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  const _AlertDialog({Key? key, required this.msg}) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
 
 | 
			
		||||
@@ -19,8 +19,7 @@ class _AudioPlayerDialog extends StatefulWidget {
 | 
			
		||||
  const _AudioPlayerDialog({
 | 
			
		||||
    Key? key,
 | 
			
		||||
    required this.url,
 | 
			
		||||
  })  : assert(url != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  })  : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  __AudioPlayerDialogState createState() => __AudioPlayerDialogState();
 | 
			
		||||
 
 | 
			
		||||
@@ -12,8 +12,6 @@ Future<String?> showInputNewPassword({
 | 
			
		||||
  required BuildContext context,
 | 
			
		||||
  required UserInfoForPassword userInfo,
 | 
			
		||||
}) async {
 | 
			
		||||
  assert(context != null);
 | 
			
		||||
  assert(userInfo != null);
 | 
			
		||||
  return await showDialog(
 | 
			
		||||
      context: context,
 | 
			
		||||
      builder: (c) => _InputNewPasswordDialog(
 | 
			
		||||
@@ -27,8 +25,7 @@ class _InputNewPasswordDialog extends StatefulWidget {
 | 
			
		||||
  const _InputNewPasswordDialog({
 | 
			
		||||
    Key? key,
 | 
			
		||||
    required this.userInfo,
 | 
			
		||||
  })  : assert(userInfo != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  })  : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  __InputNewPasswordDialogState createState() =>
 | 
			
		||||
@@ -45,7 +42,8 @@ class __InputNewPasswordDialogState extends State<_InputNewPasswordDialog> {
 | 
			
		||||
  bool get _input1Valid =>
 | 
			
		||||
      _controller1.currentState != null && _controller1.currentState!.valid;
 | 
			
		||||
 | 
			
		||||
  bool get _input2Valid => _controller1.currentState!.value == _controller2.text;
 | 
			
		||||
  bool get _input2Valid =>
 | 
			
		||||
      _controller1.currentState!.value == _controller2.text;
 | 
			
		||||
 | 
			
		||||
  bool get _isValid => _input1Valid && _input2Valid;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -51,9 +51,7 @@ class _MultiChoicesEntryDialog<T> extends StatefulWidget {
 | 
			
		||||
    required this.title,
 | 
			
		||||
    required this.defaultChoice,
 | 
			
		||||
    required this.choices,
 | 
			
		||||
  })  : assert(title != null),
 | 
			
		||||
        assert(defaultChoice != null),
 | 
			
		||||
        assert(choices != null),
 | 
			
		||||
  })  : assert(defaultChoice != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
 
 | 
			
		||||
@@ -39,10 +39,7 @@ class _PickFileOption {
 | 
			
		||||
    required this.label,
 | 
			
		||||
    required this.icon,
 | 
			
		||||
    required this.canEnable,
 | 
			
		||||
  })  : assert(value != null),
 | 
			
		||||
        assert(label != null),
 | 
			
		||||
        assert(icon != null),
 | 
			
		||||
        assert(canEnable != null);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
List<_PickFileOption> get _optionsList => [
 | 
			
		||||
@@ -94,8 +91,6 @@ Future<BytesFile?> showPickFileDialog({
 | 
			
		||||
  int? imageMaxHeight,
 | 
			
		||||
  CropAspectRatio? aspectRatio,
 | 
			
		||||
}) async {
 | 
			
		||||
  assert(allowedMimeTypes != null);
 | 
			
		||||
 | 
			
		||||
  // Get the list of allowed extension
 | 
			
		||||
  final allowedExtensions = <String>[];
 | 
			
		||||
  for (var mime in allowedExtensions) {
 | 
			
		||||
@@ -196,9 +191,7 @@ class _BottomSheetPickOption extends StatelessWidget {
 | 
			
		||||
 | 
			
		||||
  const _BottomSheetPickOption(
 | 
			
		||||
      {Key? key, required this.options, required this.onOptionSelected})
 | 
			
		||||
      : assert(options != null),
 | 
			
		||||
        assert(onOptionSelected != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
      : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) => Container(
 | 
			
		||||
 
 | 
			
		||||
@@ -266,9 +266,7 @@ class _RecordAction extends StatelessWidget {
 | 
			
		||||
    required this.icon,
 | 
			
		||||
    required this.onTap,
 | 
			
		||||
    this.color,
 | 
			
		||||
  })  : assert(visible != null),
 | 
			
		||||
        assert(icon != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
@@ -287,9 +285,7 @@ class _ActionButton extends StatelessWidget {
 | 
			
		||||
    required this.visible,
 | 
			
		||||
    required this.text,
 | 
			
		||||
    this.onPressed,
 | 
			
		||||
  })  : assert(visible != null),
 | 
			
		||||
        assert(text != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  })  : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
 
 | 
			
		||||
@@ -27,12 +27,7 @@ class SingleInputDialog extends StatefulWidget {
 | 
			
		||||
    this.canBeEmpty = false,
 | 
			
		||||
    this.maxLines = 1,
 | 
			
		||||
    this.maxLength,
 | 
			
		||||
  })  : assert(title != null),
 | 
			
		||||
        assert(label != null),
 | 
			
		||||
        assert(checkInput != null),
 | 
			
		||||
        assert(errorMessage != null),
 | 
			
		||||
        assert(maxLines != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  __InputURLDialogState createState() => __InputURLDialogState();
 | 
			
		||||
 
 | 
			
		||||
@@ -18,11 +18,6 @@ Future<String?> showVirtualDirectoryDialog({
 | 
			
		||||
  required int id,
 | 
			
		||||
  required VirtualDirectoryTargetType type,
 | 
			
		||||
}) async {
 | 
			
		||||
  assert(context != null);
 | 
			
		||||
  assert(initialDirectory != null);
 | 
			
		||||
  assert(id != null);
 | 
			
		||||
  assert(type != null);
 | 
			
		||||
 | 
			
		||||
  return await showDialog<String>(
 | 
			
		||||
      context: context,
 | 
			
		||||
      builder: (c) => _VirtualDirectoryPicker(
 | 
			
		||||
@@ -39,10 +34,7 @@ class _VirtualDirectoryPicker extends StatefulWidget {
 | 
			
		||||
    required this.initialDirectory,
 | 
			
		||||
    required this.id,
 | 
			
		||||
    required this.type,
 | 
			
		||||
  })  : assert(initialDirectory != null),
 | 
			
		||||
        assert(id != null),
 | 
			
		||||
        assert(type != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  __VirtualDirectoryPickerState createState() =>
 | 
			
		||||
 
 | 
			
		||||
@@ -246,9 +246,7 @@ class _ResetPasswordBodyState extends SafeState<_ResetPasswordBody> {
 | 
			
		||||
class _Spacer extends StatelessWidget {
 | 
			
		||||
  final bool visible;
 | 
			
		||||
 | 
			
		||||
  const _Spacer({Key? key, this.visible = true})
 | 
			
		||||
      : assert(visible != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  const _Spacer({Key? key, this.visible = true}) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
 
 | 
			
		||||
@@ -50,8 +50,9 @@ abstract class MainController extends State<MainRoute> {
 | 
			
		||||
  int get numberOfPages => _pagesStack.length;
 | 
			
		||||
 | 
			
		||||
  /// Get current instance of Home controller
 | 
			
		||||
  ///
 | 
			
		||||
  /// A future implementation might need context again, that is why it is required
 | 
			
		||||
  static MainController? of(BuildContext context) {
 | 
			
		||||
    assert(context != null); // A future implementation might need context again
 | 
			
		||||
    return mainControllerKey.currentState;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -126,7 +126,7 @@ class PushNotificationsConfigurationWidgetState
 | 
			
		||||
              available: srvConfig!.notificationsPolicy.hasFirebase,
 | 
			
		||||
              onChanged: (s) {
 | 
			
		||||
                setState(() => currStatus = s);
 | 
			
		||||
                if (widget.onChanged != null) widget.onChanged();
 | 
			
		||||
                widget.onChanged();
 | 
			
		||||
              },
 | 
			
		||||
            ),
 | 
			
		||||
            SizedBox(height: 5),
 | 
			
		||||
 
 | 
			
		||||
@@ -129,8 +129,7 @@ class _NewCustomEmojiDialog extends StatefulWidget {
 | 
			
		||||
  const _NewCustomEmojiDialog({
 | 
			
		||||
    Key? key,
 | 
			
		||||
    required this.currentList,
 | 
			
		||||
  })  : assert(currentList != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  _NewCustomEmojiDialogState createState() => _NewCustomEmojiDialogState();
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,7 @@ class GroupSettingsScreen extends StatefulWidget {
 | 
			
		||||
  final int groupID;
 | 
			
		||||
 | 
			
		||||
  const GroupSettingsScreen({Key? key, required this.groupID})
 | 
			
		||||
      : assert(groupID != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
      : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  _GroupSettingsScreenState createState() => _GroupSettingsScreenState();
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ class MenuTile extends StatelessWidget {
 | 
			
		||||
  final String title;
 | 
			
		||||
  final GestureTapCallback? onTap;
 | 
			
		||||
 | 
			
		||||
  const MenuTile({required this.title, this.onTap}) : assert(title != null);
 | 
			
		||||
  const MenuTile({required this.title, this.onTap});
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user