import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:shimmer/shimmer.dart'; extension WidgetExtensions on Widget { Widget onPress(VoidCallback onTap) => InkWell(onTap: onTap, child: this); Widget paddingAll(double _value) => Padding(padding: EdgeInsets.all(_value), child: this); Widget paddingOnly({double left = 0.0, double right = 0.0, double top = 0.0, double bottom = 0.0}) => Padding(padding: EdgeInsets.only(left: left, right: right, top: top, bottom: bottom), child: this); Widget toShimmer() => Shimmer.fromColors( baseColor: Color(0xffe8eff0), highlightColor: Colors.white, child: Container( child: this, color: Colors.white, )); Widget animatedSwither() => AnimatedSwitcher( duration: const Duration(milliseconds: 500), // transitionBuilder: (Widget child, Animation animation) { // return ScaleTransition(scale: animation, child: child); // }, switchInCurve: Curves.linearToEaseOut, switchOutCurve: Curves.linearToEaseOut, child: this, ); }