import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'begats_record_logic.dart';

class BegatsRecordPage extends StatelessWidget {
  BegatsRecordPage({Key? key}) : super(key: key);

  final logic = Get.find<BegatsRecordLogic>();
  final state = Get.find<BegatsRecordLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          '系谱',
          style: TextStyle(
            color: Colors.white,
          ),
        ),
        backgroundColor: Colors.blue,
        centerTitle: true,
        actions: [
          Padding(
            padding: const EdgeInsets.all(5.0),
            child: InkWell(
              child: const Center(
                child: Text('保存'),
              ),
              onTap: () => logic.save(),
            ),
          ),
        ],
      ),
      resizeToAvoidBottomInset:false,
      body: SingleChildScrollView(
        scrollDirection: Axis.horizontal,
        child: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Row(
            mainAxisSize: MainAxisSize.max,
            children: [
              Container(
                child: Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Row(
                      children: [
                        const Text('个体号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            readOnly: true,
                            controller: logic.individualController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '个体号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
              // SizedBox(
              //   width: 1,
              //   height: 300,
              //   child: Container(width: 1,
              //   color: Colors.black,),
              // ),
              Container(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Row(
                      children: [
                        const Text('父登记号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.fatherRegController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '父登记号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('母登记号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.motherRegController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '母登记号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
              Container(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Row(
                      children: [
                        const Text('  祖父号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.ffNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '祖父号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('  祖母号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.fmNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '祖母号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('外祖父号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.mfNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '外祖父号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('外祖母号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.mmNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '外祖母号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
              Container(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Row(
                      children: [
                        const Text('    曾祖父号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.fffNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '曾祖父号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('    曾祖母号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.ffmNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '曾祖母号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('  曾外祖父号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.fmfNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '曾外祖父号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('  曾外祖母号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.fmmNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '曾外祖母号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('外曾父祖父号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.mffNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '外曾父祖父号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('外曾父祖母号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.mfmNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '外曾父祖母号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('外曾外祖父号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.mmfNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '外曾外祖父号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        const Text('外曾外祖母号:'),
                        const SizedBox(
                          height: 5,
                        ),
                        Container(
                          width: 180,
                          height: 50,
                          child: TextField(
                            controller: logic.mmmNumController,
                            onChanged: (text) {
                              // state.filterMotherNo = text;
                            },
                            decoration: const InputDecoration(
                              border: OutlineInputBorder(),
                              // hintText: '外曾外祖母号',
                              contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 2.0),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
