drawer method

dynamic drawer(
  1. BuildContext context,
  2. String title,
  3. String subTitle,
  4. String imagePath,
  5. Color circleColor, [
  6. TemplateRF? template,
])

Implementation

drawer(
  BuildContext context,
  String title,
  String subTitle,
  String imagePath,
  Color circleColor, [
  TemplateRF? template,
]) {
  var drawerModernOval = DrawerRF(
      clipper: OvalRightBorderClipper(),
      menuHeader: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: <Widget>[
          Container(
            color: Colors.red,
            height: 240,
            padding: EdgeInsets.only(top: 15),
            child: StoreOutlineDefaults()
                .storeOutline()
                .header!
                .drawer!
                .drawerHeader(
                  title,
                  subTitle,
                  imagePath,
                  circleColor,
                  template: template,
                  context: context,
                ),
          )
        ],
      ),
      menuBody: StoreOutlineDefaults()
          .storeOutline()
          .header!
          .drawer!
          .menuBody(context,
              separator: true,
              textWeight: FontWeight.bold,
              template: template),
      menuFooter: StoreOutlineDefaults()
          .storeOutline()
          .header!
          .drawer!
          .drawerFooter(context,
              color: Colors.pink, separator: false, template: template)
//      DrawerItemRF(
//        icon: FontAwesomeIcons.headphonesAlt,
//        text: 'Support',
//        color: Colors.pink,
//        separator: false,
//        template: template,
//      ),
      );

  var drawerMaterialDefault = DrawerRF(
    menuHeader: Container(
      color: Colors.red,
      child:
          StoreOutlineDefaults().storeOutline().header!.drawer!.drawerHeader(
                title,
                subTitle,
                imagePath,
                circleColor,
                template: template,
                context: context,
              ),
//        DrawerHeader(
//          child: Column(
//            crossAxisAlignment: CrossAxisAlignment.stretch,
//            mainAxisAlignment: MainAxisAlignment.start,
//            children: <Widget>[
//              Padding(
//                padding: const EdgeInsets.only(right: 8.0),
//                child: CircleAvatar(
//                  radius: 45,
//                  backgroundColor: Color(0xffFDCF09),
//                  child: CircleAvatar(
//                      radius: 40, backgroundImage: AssetImage('assets/images/profile.png')),
//                ),
//              ),
//              SizedBox(height: 5),
//              Text(
//                'Drawer Header',
//                style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, fontSize: 18),
//              ),
//              Text('Sonething', style: TextStyle(color: Colors.white)),
//            ],
//          ),
//          decoration: BoxDecoration(color: Colors.blue),
//        ),
    ),
    menuBody: StoreOutlineDefaults().storeOutline().header!.drawer!.menuBody(
        context,
        separator: false,
        textWeight: FontWeight.w500,
        template: template),
    menuFooter: StoreOutlineDefaults()
        .storeOutline()
        .header!
        .drawer!
        .drawerFooter(context,
            separator: false,
            padding: 10,
            color: Colors.pink,
            template: template),
//      DrawerItemRF(
//          icon: FontAwesomeIcons.headphonesAlt,
//          text: 'Support',
//          color: Colors.pink,
//          separator: false,
//          template: template),
  );

  template = TemplateRF.get(template!);
  if (template!.name == TemplateNameRF.modern && template.version == 'Oval')
    return drawerModernOval;
  if (template.name == TemplateNameRF.material) return drawerMaterialDefault;
}