Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
11 kB
1
Indexable
Never
@override
  Widget build(BuildContext context) {
    var widthCard = defaultPadding * 5;
    var heightCard = defaultPadding * 5.4;
    return WillPopScope(
      onWillPop: () async => true,
      child: GestureDetector(
        onTap: () => Navigator.of(context).pop(),
        child: Scaffold(
          appBar: AppBar(
            primary: false,
            toolbarHeight: 0,
            elevation: 0,
            systemOverlayStyle: const SystemUiOverlayStyle(
              statusBarColor: transparent,
              statusBarIconBrightness: Brightness.dark,
              statusBarBrightness: Brightness.light,
            ),
            backgroundColor: transparent,
          ),
          resizeToAvoidBottomInset: true,
          backgroundColor: isDark ? white : black.withOpacity(0.5),
          body: AlertDialog(
            backgroundColor: isDark ? black2 : white,
            alignment: Alignment.topRight,
            title:Text(
              "App Menu",
              style: Helpers.font1(15.0, isDark ? white : black, FontWeight.w600),
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              textAlign: TextAlign.start,
            ),
            content: SingleChildScrollView(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        ButtonPinch(
                          onPressed: () => onNavigate("/Home", ""),
                          boxColor: transparent,
                          child: Container(
                            width: widthCard,
                            height: heightCard,
                            decoration: BoxDecoration(
                              borderRadius: Helpers.onRadius(1, defaultPadding),
                              color: isDark ? black2 : white,
                              boxShadow: [
                                BoxShadow(
                                  color: isDark ? white.withOpacity(0.3) : black.withOpacity(0.15),
                                  spreadRadius: 1,
                                  blurRadius: 1,
                                  offset: const Offset(0, 0),
                                ),
                              ],
                            ),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Icon(
                                  Icons.home_outlined,
                                  size: widthCard * 0.4,
                                  color: gray,
                                ),
                                Text(
                                  "Home",
                                  style: Helpers.font1(15.0, isDark ? white : black, FontWeight.w400),
                                  overflow: TextOverflow.ellipsis,
                                  maxLines: 1,
                                  textAlign: TextAlign.center,
                                ),
                              ],
                            ),
                          ),
                        ),
                        ButtonPinch(
                          onPressed: () => onNavigate("/Search", ""),
                          boxColor: transparent,
                          child: Container(
                            width: widthCard,
                            height: heightCard,
                            decoration: BoxDecoration(
                              borderRadius: Helpers.onRadius(1, defaultPadding),
                              color: isDark ? black2 : white,
                              boxShadow: [
                                BoxShadow(
                                  color: isDark ? white.withOpacity(0.3) : black.withOpacity(0.15),
                                  spreadRadius: 1,
                                  blurRadius: 1,
                                  offset: const Offset(0, 0),
                                ),
                              ],
                            ),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Icon(
                                  Icons.search_outlined,
                                  size: widthCard * 0.4,
                                  color: gray,
                                ),
                                Text(
                                  "Search",
                                  style: Helpers.font1(15.0, isDark ? white : black, FontWeight.w400),
                                  overflow: TextOverflow.ellipsis,
                                  maxLines: 1,
                                  textAlign: TextAlign.center,
                                ),
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                    const SizedBox(
                      height: defaultPadding,
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        ButtonPinch(
                          onPressed: () => onNavigate("/Stats", ""),
                          boxColor: transparent,
                          child: Container(
                            width: widthCard,
                            height: heightCard,
                            decoration: BoxDecoration(
                              borderRadius: Helpers.onRadius(1, defaultPadding),
                              color: isDark ? black2 : white,
                              boxShadow: [
                                BoxShadow(
                                  color: isDark ? white.withOpacity(0.3) : black.withOpacity(0.15),
                                  spreadRadius: 1,
                                  blurRadius: 1,
                                  offset: const Offset(0, 0),
                                ),
                              ],
                            ),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Icon(
                                  Icons.cases_outlined,
                                  size: widthCard * 0.4,
                                  color: gray,
                                ),
                                Text(
                                  "Case",
                                  style: Helpers.font1(15.0, isDark ? white : black, FontWeight.w400),
                                  overflow: TextOverflow.ellipsis,
                                  maxLines: 1,
                                  textAlign: TextAlign.center,
                                ),
                              ],
                            ),
                          ),
                        ),
                        ButtonPinch(
                          onPressed: () => onNavigate("/Profile", ""),
                          boxColor: transparent,
                          child:  Container(
                            width: widthCard,
                            height: heightCard,
                            decoration: BoxDecoration(
                              borderRadius: Helpers.onRadius(1, defaultPadding),
                              color: isDark ? black2 : white,
                              boxShadow: [
                                BoxShadow(
                                  color: isDark ? white.withOpacity(0.3) : black.withOpacity(0.15),
                                  spreadRadius: 1,
                                  blurRadius: 1,
                                  offset: const Offset(0, 0),
                                ),
                              ],
                            ),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Icon(
                                  Icons.person_outline,
                                  size: widthCard * 0.4,
                                  color: gray,
                                ),
                                Text(
                                  "Profile",
                                  style: Helpers.font1(15.0, isDark ? white : black, FontWeight.w400),
                                  overflow: TextOverflow.ellipsis,
                                  maxLines: 1,
                                  textAlign: TextAlign.center,
                                ),
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                    const SizedBox(
                      height: defaultPadding,
                    ),
                    ButtonPinch(
                        onPressed: ()=> logoutAkun(),
                        boxColor: transparent,
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            const Icon(Icons.power_settings_new,size: defaultSizeIcon,color: gray,),
                            const SizedBox(
                              width: defaultPadding/2,
                            ),
                            Text(
                              "Logout",
                              style: Helpers.font1(15.0,
                                  isDark ? gray : black2, FontWeight.w400),
                              overflow: TextOverflow.ellipsis,
                              maxLines: 1,
                            ),
                          ],
                        )
                    ),
                  ],
                )
            ),
            actions: null,
          ),
        ),
      ),
    );
  }
Leave a Comment