flutter

Blur

Widget _buildUI() {
  return Stack(
    fit: StackFit.expand,
    children: [
      FlutterLogo(),
      Center(
        child: ClipRect(
          child: BackdropFilter(
            filter: ImageFilter.blur(
              sigmaX: 10.0,
              sigmaY: 10.0,
            ),
            child: Container(
              width: 200,
              height: 200,
              alignment: Alignment.center,
              child: Text('Hi Frost'),
            ),
          ),
        ),
      ),
    ],
  );
}

//Full screen blur
Widget _buildUI() {
  return Stack(
    fit: StackFit.expand,
    children: [
      FlutterLogo(),
      Center(
        child: BackdropFilter(
          filter: ImageFilter.blur(
            sigmaX: 10.0,
            sigmaY: 10.0,
          ),
          child: Container(
            alignment: Alignment.center,
            child: Text('Hi Frost'),
          ),
        ),
      ),
    ],
  );
}
Was this helpful?