mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
29
lib/util/widget_extensions.dart
Normal file
29
lib/util/widget_extensions.dart
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
extension WidgetExtensions on Widget {
|
||||
Widget padding(EdgeInsets insets) {
|
||||
return Padding(
|
||||
padding: insets,
|
||||
child: this,
|
||||
);
|
||||
}
|
||||
|
||||
Widget setKey(Key? key) {
|
||||
return Center(
|
||||
key: key,
|
||||
child: this,
|
||||
);
|
||||
}
|
||||
|
||||
Widget addHeroTag(String? tag) {
|
||||
if (tag != null) {
|
||||
return Hero(tag: tag, child: this);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Widget addVisiblity(bool visible) {
|
||||
return AnimatedOpacity(duration: const Duration(milliseconds: 250), opacity: visible ? 1 : 0, child: this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue