How can I refactor complicated method with views in Activity or Fragment?

Issue I am learning Clean Code and Refactoring. And my project has many long method with view access, something like this. private fun updateStatusFragmentUI(statusData: StatusListData.StatusData) = with(binding.detail) { with(statusData) { tvCodeDoc.text = getString(R.string.reception_code).format(receptionKey) tvTime.text = createdAt.toFullTimeString() tvName.text = name tvContact.text

Continue reading

How to Refactor a Function in Flutter

Issue import ‘package:flutter/material.dart’; Widget justButton({ String btText = ”, Color bgColor = Colors.blue, Color? txtColor = Colors.white, Color borderColor = Colors.black, void Function() onpressedAction,//here iam getting problem }) { return OutlinedButton( //i wanted to refactor this onpressed onPressed: () {

Continue reading