getRow method

Widget getRow(
  1. BuildContext context,
  2. int index
)

Implementation

Widget getRow(BuildContext context, int index) {
  return ListTile(
    title: Text(
      "${_environments[index]}",
      style: TextStyle(
          color: getEnv() == "${index}" ? Colors.red : Colors.black),
    ),
    onTap: () {
      if (_environments[index] == "其他") {
        Navigator.of(context).pop();
        inputIpDialog(context, (text) {
          _saveIP(text);
        });
      } else {
        if (_environments[index] != "取消") {
          _saveEnv("$index");
        } else {
          Navigator.of(context).pop();
        }
      }
    },
  );
}