Popup top-level property

Function Popup
getter/setter pair

Implementation

Function Popup = (
  BuildContext context,
  Widget content, {
  bool rightSide = false,
  bool leftSide = false,
  bool loading = false,
}) {
  showDialog(
    context: context,
    builder: (context) {
      if (loading) {
        return Center(
          child: CircularProgressIndicator(),
        );
      }
      if (leftSide | rightSide) {
        return Center(
          child: Row(
            mainAxisAlignment:
                leftSide ? MainAxisAlignment.start : MainAxisAlignment.end,
            children: [
              Card(
                child: Container(
                  width: 240,
                  height: double.infinity,
                  padding:
                      const EdgeInsets.symmetric(vertical: 20, horizontal: 6),
                  child: content,
                ),
              ),
            ],
          ),
        );
      } else {
        return Center(
          child: Card(
            child: Container(
              padding: const EdgeInsets.all(20),
              child: content,
            ),
          ),
        );
      }
    },
  );
};