button1s function

dynamic button1s(
  1. String text,
  2. IconData icon,
  3. String route,
  4. dynamic callback(
    1. String
    ), {
  5. Decoration? decor,
})

Implementation

button1s(String text, IconData icon, String route, Function(String) callback, {Decoration? decor}) {
  return InkWell(
      onTap: (){
        callback(route);
      },
      child: Container(
          margin: EdgeInsets.only(left: 10, right: 10),
          padding: EdgeInsets.only(left: 10, right: 10, top: 15, bottom: 15),
          decoration: decor,
          child: Row(
            children: [
              Icon(icon, color: aTheme.darkMode ? Colors.white: Colors.black,),
              SizedBox(width: 10,),
              Expanded(child: Text(text, style: aTheme.style14W400,))
            ],
          ))
  );
}