flutter_profile/lib/src/widgets/item_builder/item_builder_options.dart

29 lines
1 KiB
Dart
Raw Normal View History

2022-10-31 17:15:05 +01:00
// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
2022-08-26 15:31:42 +02:00
import 'package:flutter/material.dart';
2022-09-20 14:11:38 +02:00
/// ItemBuilderOptions is a class to store all settings for a field in the profile page.
2022-09-22 09:53:26 +02:00
///
2022-09-20 14:11:38 +02:00
/// InputDecoration sets the decoration for all standard textfields. This is overridden if a field specific decoration is set by inputDecorationField.
2022-09-22 09:53:26 +02:00
///
2022-09-20 14:11:38 +02:00
/// inputDecorationField sets the inputdecoration by key of the user data field. So a field can have its own specific decoration.
2022-09-22 09:53:26 +02:00
///
2022-09-20 14:11:38 +02:00
/// Validator can be used to set a validator for the standard textfield.
2022-08-26 15:31:42 +02:00
class ItemBuilderOptions {
ItemBuilderOptions({
2022-08-26 15:31:42 +02:00
this.inputDecoration = const InputDecoration(),
this.inputDecorationField,
2022-08-26 15:31:42 +02:00
this.readOnly = false,
this.validators,
2022-10-28 15:34:24 +02:00
this.keyboardType,
2022-08-26 15:31:42 +02:00
});
final InputDecoration inputDecoration;
final Map<String, InputDecoration>? inputDecorationField;
2022-08-26 15:31:42 +02:00
final bool readOnly;
final Map<String, String? Function(String?)>? validators;
2022-10-28 15:34:24 +02:00
final Map<String, TextInputType>? keyboardType;
2022-08-26 15:31:42 +02:00
}