From f7f29dbbd354443986e7c5464d5369057923a060 Mon Sep 17 00:00:00 2001 From: Jacques Doeleman Date: Wed, 28 Sep 2022 12:09:03 +0200 Subject: [PATCH] Added some more documentation and removed page indicator --- lib/flutter_form.dart | 1 - .../input_number_picker.dart | 9 ++ .../input/input_types/input_types.dart | 2 - .../page_indicator/page_indicator.dart | 94 ------------------- .../page_indicator/page_indicators.dart | 1 - 5 files changed, 9 insertions(+), 98 deletions(-) delete mode 100644 lib/src/widgets/page_indicator/page_indicator.dart delete mode 100644 lib/src/widgets/page_indicator/page_indicators.dart diff --git a/lib/flutter_form.dart b/lib/flutter_form.dart index dd5cd60..edbdbd1 100644 --- a/lib/flutter_form.dart +++ b/lib/flutter_form.dart @@ -1,4 +1,3 @@ export 'src/form.dart'; export 'src/widgets/input/abstractions.dart'; export 'src/widgets/input/input_types/input_types.dart'; -export 'src/widgets/page_indicator/page_indicators.dart'; diff --git a/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart b/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart index 47b0b4f..f48a5a6 100644 --- a/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart +++ b/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart @@ -5,6 +5,12 @@ import 'package:flutter_form/next_shell/translation_service.dart'; import 'numberpicker.dart'; +/// Input for a number used in a [FlutterForm]. +/// +/// [minValue] sets the minimal value of the picker. +/// [maxValue] sets the maximal value of the picker. +/// +/// Standard controller is [FlutterFormInputNumberPickerController]. class FlutterFormInputNumberPicker extends FlutterFormInputWidget { const FlutterFormInputNumberPicker({ Key? key, @@ -37,6 +43,9 @@ class FlutterFormInputNumberPicker extends FlutterFormInputWidget { } } +/// Controller for the numberPicker used by a [FlutterFormInputWidget] used in a [FlutterForm]. +/// +/// Mainly used by [FlutterFormInputNumberPicker]. class NumberPickerFormField extends FormField { NumberPickerFormField({ Key? key, diff --git a/lib/src/widgets/input/input_types/input_types.dart b/lib/src/widgets/input/input_types/input_types.dart index e4e0fbe..11bc2a3 100644 --- a/lib/src/widgets/input/input_types/input_types.dart +++ b/lib/src/widgets/input/input_types/input_types.dart @@ -2,8 +2,6 @@ export 'input_carousel/input_carousel.dart'; export 'input_carousel/input_carousel.dart'; export 'input_email.dart'; export 'input_number_picker/input_number_picker.dart'; -export 'input_number_picker/input_number_picker.dart'; export 'input_password/input_password.dart'; export 'input_plain_text.dart'; -export 'input_plain_text.dart'; export 'input_slider/input_slider.dart'; diff --git a/lib/src/widgets/page_indicator/page_indicator.dart b/lib/src/widgets/page_indicator/page_indicator.dart deleted file mode 100644 index fc33a3e..0000000 --- a/lib/src/widgets/page_indicator/page_indicator.dart +++ /dev/null @@ -1,94 +0,0 @@ -import 'package:flutter/material.dart'; - -abstract class PageIndicator extends StatelessWidget { - const PageIndicator({ - this.steps = 3, - required this.currentStep, - Key? key, - }) : super(key: key); - - final int steps; - final int currentStep; -} - -class PageIndicatorCirlesLine extends PageIndicator { - const PageIndicatorCirlesLine({ - steps = 3, - required currentStep, - Key? key, - }) : super(key: key, steps: steps, currentStep: currentStep); - - @override - Widget build(BuildContext context) { - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - for (var i = 0; i < steps; i++) ...[ - Container( - width: 24, - height: 24, - decoration: BoxDecoration( - color: i <= currentStep - ? Colors.black.withOpacity(0.80) - : const Color(0xFFF3F2F2), - borderRadius: BorderRadius.circular(45), - boxShadow: [ - BoxShadow( - color: - Colors.black.withOpacity(i <= currentStep ? 0.40 : 0.10), - offset: const Offset(0, 2), - blurRadius: 5, - ), - ], - ), - child: i == currentStep - ? Center( - child: Padding( - padding: const EdgeInsets.only(left: 1.5), - child: Text( - (i + 1).toString(), - style: Theme.of(context).textTheme.overline!.copyWith( - fontSize: 12, - fontWeight: FontWeight.w900, - color: const Color(0xFFF3F2F2), - ), - ), - ), - ) - : i < currentStep - ? const Center( - child: Padding( - padding: EdgeInsets.only(left: 1.5), - child: Icon( - Icons.check, - color: Colors.white, - size: 20, - ), - ), - ) - : Container(), - ), - if (i + 1 < steps) - const SizedBox( - width: 4, - ), - if (i + 1 < steps) - Container( - width: 15, - height: 7, - decoration: BoxDecoration( - color: i + 1 <= currentStep - ? Colors.black.withOpacity(0.80) - : const Color(0xFFF3F2F2), - borderRadius: BorderRadius.circular(3.5), - ), - ), - if (i + 1 < steps) - const SizedBox( - width: 4, - ), - ] - ], - ); - } -} diff --git a/lib/src/widgets/page_indicator/page_indicators.dart b/lib/src/widgets/page_indicator/page_indicators.dart deleted file mode 100644 index 6d368e7..0000000 --- a/lib/src/widgets/page_indicator/page_indicators.dart +++ /dev/null @@ -1 +0,0 @@ -export 'page_indicator.dart';