Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:custom-check-box #4

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 136 additions & 69 deletions example/lib/sources/complete_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class _CompleteFormState extends State<CompleteForm> {
gradient: const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0x00FAF9F9), Color(0xFF94B8D2)],
colors: [
Color(0x00FAF9F9),
Color(0xFF94B8D2),
],
),
);
InfoModalConfig config2 = InfoModalConfig(
Expand Down Expand Up @@ -97,6 +100,7 @@ class _CompleteFormState extends State<CompleteForm> {
'gender': 'Male',
'languages_filter': ['Dart'],
'languages_choice': '5000 - 6000',
'languages_selection': ['5000 - 6000', 'Java'],
},
skipDisabled: true,
child: Column(
Expand Down Expand Up @@ -355,78 +359,141 @@ class _CompleteFormState extends State<CompleteForm> {
FormBuilderValidators.maxLength(3),
]),
),
Builder(builder: (context) {
return AlippoSelectionCardGroups<String>(
autovalidateMode: AutovalidateMode.onUserInteraction,
name: 'languages_choice',
// initialValue: 'Java',
padding:
const EdgeInsets.only(top: 20, bottom: 20, left: 50),
expanded: true,
spacing: 20,
selectedLabelStyle: const TextStyle(
color: Color(0xFFFAF9F9),
fontSize: 18,
fontFamily: 'PP Pangram Sans Rounded',
fontWeight: FontWeight.w700,
letterSpacing: -0.36,
AlippoCustomRadioGroup<String>(
autovalidateMode: AutovalidateMode.onUserInteraction,
name: 'languages_choice',
// initialValue: 'Java',
padding: const EdgeInsets.only(top: 20, bottom: 20, left: 50),
expanded: true,
spacing: 20,
selectedLabelStyle: const TextStyle(
color: Color(0xFFFAF9F9),
fontSize: 18,
fontFamily: 'PP Pangram Sans Rounded',
fontWeight: FontWeight.w700,
letterSpacing: -0.36,
),
unselectedLabelStyle: const TextStyle(
color: Color(0xFF1A4F76),
fontSize: 18,
fontFamily: 'PP Pangram Sans Rounded',
fontWeight: FontWeight.w400,
letterSpacing: -0.36,
),
selectedCardColor: const Color(0xFF1A4F76),
defaultCardColor: const Color(0xFFFAF9F9),
selectedShape: RoundedRectangleBorder(
side: BorderSide(
width: 2,
color: Colors.black.withOpacity(0.36000001430511475),
),
borderRadius: BorderRadius.circular(17),
),
unselectedShape: RoundedRectangleBorder(
side: BorderSide(
width: 2,
color: Colors.black.withOpacity(0.07000000029802322),
),
borderRadius: BorderRadius.circular(17),
),
options: [
SelectionCardOption(
value: '5000 - 6000',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
SelectionCardOption(
value: 'Kotlin',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config2,
),
SelectionCardOption(
value: 'Java',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
const SelectionCardOption(
value: 'Swift',
avatar: Icon(Icons.monetization_on_outlined),
),
SelectionCardOption(
value: 'Objective-C',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
],
onChanged: _onChanged,
validator: FormBuilderValidators.compose([
FormBuilderValidators.minLength(1),
]),
),
AlippoCustomCheckBoxGroup<String>(
autovalidateMode: AutovalidateMode.onUserInteraction,
name: 'languages_selection',
padding: const EdgeInsets.only(top: 20, bottom: 20, left: 50),
expanded: true,
spacing: 20,
selectedLabelStyle: const TextStyle(
color: Color(0xFFFAF9F9),
fontSize: 18,
fontFamily: 'PP Pangram Sans Rounded',
fontWeight: FontWeight.w700,
letterSpacing: -0.36,
),
unselectedLabelStyle: const TextStyle(
color: Color(0xFF1A4F76),
fontSize: 18,
fontFamily: 'PP Pangram Sans Rounded',
fontWeight: FontWeight.w400,
letterSpacing: -0.36,
),
selectedCardColor: const Color(0xFF1A4F76),
defaultCardColor: const Color(0xFFFAF9F9),
selectedShape: RoundedRectangleBorder(
side: BorderSide(
width: 2,
color: Colors.black.withOpacity(0.36000001430511475),
),
borderRadius: BorderRadius.circular(17),
),
unselectedShape: RoundedRectangleBorder(
side: BorderSide(
width: 2,
color: Colors.black.withOpacity(0.07000000029802322),
),
borderRadius: BorderRadius.circular(17),
),
options: [
SelectionCardOption(
value: '5000 - 6000',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
unselectedLabelStyle: const TextStyle(
color: Color(0xFF1A4F76),
fontSize: 18,
fontFamily: 'PP Pangram Sans Rounded',
fontWeight: FontWeight.w400,
letterSpacing: -0.36,
SelectionCardOption(
value: 'Kotlin',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config2,
),
selectedCardColor: const Color(0xFF1A4F76),
defaultCardColor: const Color(0xFFFAF9F9),
selectedShape: RoundedRectangleBorder(
side: BorderSide(
width: 2,
color: Colors.black.withOpacity(0.36000001430511475),
),
borderRadius: BorderRadius.circular(17),
SelectionCardOption(
value: 'Java',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
unselectedShape: RoundedRectangleBorder(
side: BorderSide(
width: 2,
color: Colors.black.withOpacity(0.07000000029802322),
),
borderRadius: BorderRadius.circular(17),
const SelectionCardOption(
value: 'Swift',
avatar: Icon(Icons.monetization_on_outlined),
),
SelectionCardOption(
value: 'Objective-C',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
options: [
SelectionCardOption(
value: '5000 - 6000',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
SelectionCardOption(
value: 'Kotlin',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config2,
),
SelectionCardOption(
value: 'Java',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
SelectionCardOption(
value: 'Swift',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config2,
),
SelectionCardOption(
value: 'Objective-C',
avatar: const Icon(Icons.monetization_on_outlined),
infoModalConfig: config,
),
],
onChanged: _onChanged,
validator: FormBuilderValidators.compose([
FormBuilderValidators.minLength(1),
]),
);
}),
],
onChanged: _onChanged,
validator: FormBuilderValidators.compose([
FormBuilderValidators.minLength(1),
]),
)
],
),
),
Expand Down
3 changes: 2 additions & 1 deletion lib/flutter_form_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ export 'src/widgets/grouped_checkbox.dart';
export 'src/widgets/grouped_radio.dart';
export 'src/options/form_builder_chip_option.dart';
export 'src/options/display_values_enum.dart';
export 'src/alippo_custom_form_components/fields/alippo_selection_card_group/alippo_selection_card_group.dart';
export 'src/alippo_custom_form_components/fields/alippo_selection_card_group/alippo_custom_radio_group.dart';
export 'src/alippo_custom_form_components/fields/alippo_selection_card_group/alippo_custom_checkbox_group.dart';
export 'src/alippo_custom_form_components/fields/alippo_selection_card_group/comp/selection_card_options.dart';
Loading
Loading