addressFormEntry method

Widget addressFormEntry({
  1. String title = 'Address',
  2. String subTitle = 'the address',
  3. Address? defaultValue,
})

Implementation

Widget addressFormEntry({
  String title = 'Address',
  String subTitle = 'the address',
  // Function(String?)? onSaved,
  Address? defaultValue,
}) {
  return formEntry(
    title: title,
    subTitle: subTitle,
    inputWidget: AddressField(
      formKey: widget.formKey,
      onModified: widget.onModified,
      defaultValue: defaultValue,
      isEdit: isEdit,
    ),
    // inputWidget: Row(
    //   children: [
    //     Expanded(
    //       child: TextFormField(
    //         style: Theme.of(context).textTheme.bodyLarge,
    //         controller: TextEditingController(text: defaultValue!.street),
    //         onChanged: (_) {
    //           widget.formKey.currentState!.save();
    //           if (widget.onModified != null) {
    //             widget.onModified!();
    //           }
    //         },
    //         enabled: isEdit,
    //         decoration: elegentInputDecoration(
    //           hintText: 'Street',
    //           prefix: const Icon(Icons.add_business_outlined),
    //         ),
    //         validator: (value) =>
    //             value!.isEmpty ? 'Street is required' : null,
    //         onSaved: (street) => defaultValue.street = street!,
    //       ),
    //     ),
    //     SizedBox(width: smallPadding),
    //     Expanded(
    //       child: TextFormField(
    //         style: Theme.of(context).textTheme.bodyLarge,
    //         enabled: isEdit,
    //         controller: TextEditingController(text: defaultValue.city),
    //         onChanged: (_) {
    //           widget.formKey.currentState!.save();
    //           if (widget.onModified != null) {
    //             widget.onModified!();
    //           }
    //         },
    //         decoration: elegentInputDecoration(
    //           hintText: 'City',
    //           prefix: const Icon(Icons.location_on_outlined),
    //         ),
    //         validator: (value) => value!.isEmpty ? 'City is required' : null,
    //         onSaved: (city) => defaultValue.city = city!,
    //       ),
    //     ),
    //   ],
    // ),
  );
}