Skip to content

Instantly share code, notes, and snippets.

@nandofalcao
Last active March 1, 2021 05:16
Show Gist options
  • Select an option

  • Save nandofalcao/abb820c4d258c53ca5c39c738de08333 to your computer and use it in GitHub Desktop.

Select an option

Save nandofalcao/abb820c4d258c53ca5c39c738de08333 to your computer and use it in GitHub Desktop.
Flutter Cheat Sheet

Get Status Bar Height

MediaQuery.of(context).padding.top;

Get AppBar Height

AppBar _appBar = AppBar();
_appBar.preferredSize.height;

Margin Widget

margin: EdgeInsets.all(15)
margin: EdgeInsets.only(top: 15)

Text style

style: TextStyle(
  fontSize: 30,
  fontWeight: FontWeight.bold,
  color: Colors.blueGrey,
  fontStyle: FontStyle.italic,
  decoration: TextDecoration.underline,
  decorationColor: Colors.green,
  decorationStyle: TextDecorationStyle.wavy,
)

AppBar Transparent Blur (Glassmorphism)

AppBar(
  backgroundColor: Colors.transparent,
  elevation: 0,
  brightness: Brightness.dark,
  flexibleSpace: ClipRect(
    child: BackdropFilter(
      filter: ImageFilter.blur(sigmaX: 7, sigmaY: 7),
      child: Container(
        color: Colors.green.withOpacity(0.8),
      ),
    ),
  ),
  title: Text("AppBar"),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment