typeBuilder method

Widget typeBuilder(
  1. BuildContext context,
  2. void onTap(),
  3. String currentSelected,
  4. String type,
  5. String icon,
)

Used to build the types as a row

Implementation

Widget typeBuilder(
  BuildContext context,
  void Function() onTap,
  String currentSelected,
  String type,
  String icon,
) {
  return Row(
    children: [
      Container(
        width: 50,
        height: 50,
        padding: const EdgeInsets.all(8.0),
        child: SvgPicture.asset(
          'lib/assets/svg/$icon.svg',
          package: 'flutter_avataaar',
        ),
      ),
      Expanded(
        child: Center(
          child: Text(
            type,
            style: Theme.of(context).textTheme.subtitle2,
          ),
        ),
      ),
      Padding(
        padding: const EdgeInsets.symmetric(vertical: 8.0),
        child: ElevatedButton(
          onPressed: onTap,
          child: Container(
            width: MediaQuery.of(context).size.width * 0.4,
            child: Text(
              currentSelected,
              textAlign: TextAlign.center,
            ),
          ),
        ),
      ),
    ],
  );
}