Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given an m x n binary matrix mat, return the length of the longest line of consecutive one in the matrix.
The line could be horizontal, vertical, diagonal, or anti-diagonal.
 
Please complete the following python code precisely:
```python
class Solution:
    def longestLine(self, mat: List[List[int]]) -> int:
```