You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
500 B
23 lines
500 B
1 year ago
|
/*
|
||
|
* Copyright (c) 2023. Open Mobile Platform LLC.
|
||
|
* License: Proprietary.
|
||
|
*/
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
/// Extensions for [GlobalKey]
|
||
|
extension ExtGlobalKey on GlobalKey {
|
||
|
/// Get height by key
|
||
|
double? getHeight() {
|
||
|
if (currentContext == null) {
|
||
|
return null;
|
||
|
}
|
||
|
try {
|
||
|
final renderBoxRed = currentContext!.findRenderObject() as RenderBox;
|
||
|
final sizeRed = renderBoxRed.size;
|
||
|
return sizeRed.height;
|
||
|
} catch (e) {
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
}
|