import 'package:flutter/material.dart'; import 'package:flutter_modular/flutter_modular.dart'; import 'package:peach/config/_.dart'; import 'package:peach/utils/_.dart'; /// cell 组件 class CellWidget extends StatelessWidget { final Widget leftIcon; final Widget leftText; final Widget rightIcon; final Widget rightText; final Function onTap; final double padding; CellWidget({ this.leftIcon = const Text(""), this.leftText, this.rightIcon = const Icon(Icons.arrow_forward_ios,color: ColorConfig.NoActiveColor,size: 15,), this.rightText = const Text(""), this.onTap, this.padding = 15 }); @override Widget build(BuildContext context) { return Container( alignment: Alignment.centerLeft, color: ColorConfig.WhiteBackColor, child: InkWell( onTap: () { onTap(); }, child: Container( padding: EdgeInsets.only(left: Screen.setFontSize(padding),right: Screen.setFontSize(padding)), height: Screen.setHeight(48), child: Row( children: [ Expanded( child: Container( child: Row( children: [ leftIcon, SizedBox(width: Screen.setWidth(10),), leftText ], ), ), ), rightText, SizedBox(width: Screen.setWidth(10),), rightIcon ], ), ), ), ); } }