1
0
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:
2022-03-10 19:39:57 +01:00
parent ab2c5da0da
commit 3a997cdc56
258 changed files with 2879 additions and 2912 deletions

View File

@ -15,9 +15,9 @@ class CallWindowWidget extends StatefulWidget {
final void Function() onClose;
const CallWindowWidget({
Key key,
@required this.convID,
@required this.onClose,
Key? key,
required this.convID,
required this.onClose,
}) : assert(convID != null),
assert(onClose != null),
super(key: key);
@ -27,7 +27,7 @@ class CallWindowWidget extends StatefulWidget {
}
class _CallWindowWidgetState extends State<CallWindowWidget> {
double _left, _top;
double? _left, _top;
var _fullScreen = false;
@ -71,7 +71,7 @@ class _CallWindowWidgetState extends State<CallWindowWidget> {
height: 30,
appBar: AppBar(
backgroundColor: Colors.black,
title: Text(convName == null ? tr("Loading...") : convName),
title: Text(convName == null ? tr("Loading...")! : convName),
actions: <Widget>[
// Go full screen
IconButton(
@ -98,9 +98,9 @@ class _CallWindowWidgetState extends State<CallWindowWidget> {
void _moveEnd(DraggableDetails details) {
// Determine the limits of containing stack
RenderBox renderBox = context
.findAncestorStateOfType<CallsAreaState>()
.findAncestorStateOfType<CallsAreaState>()!
.context
.findRenderObject();
.findRenderObject() as RenderBox;
final size = renderBox.size;
final offset = renderBox.localToGlobal(Offset.zero);
@ -109,13 +109,13 @@ class _CallWindowWidgetState extends State<CallWindowWidget> {
_left = details.offset.dx - offset.dx;
// Force the window to appear completely on the screen
if (_top + _WindowSize.height >= size.height)
if (_top! + _WindowSize.height >= size.height)
_top = size.height - _WindowSize.height;
if (_left + _WindowSize.width >= size.width)
if (_left! + _WindowSize.width >= size.width)
_left = size.width - _WindowSize.width;
if (_top < 0) _top = 0;
if (_left < 0) _left = 0;
if (_top! < 0) _top = 0;
if (_left! < 0) _left = 0;
setState(() {});
}

View File

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
/// @author Pierre Hubert
class CallsArea extends StatefulWidget {
const CallsArea({Key key}) : super(key: key);
const CallsArea({Key? key}) : super(key: key);
@override
CallsAreaState createState() => CallsAreaState();