mirror of
https://github.com/Iconica-Development/flutter_form_wizard.git
synced 2025-05-19 19:03:47 +02:00
Added some more documentation and removed page indicator
This commit is contained in:
parent
fa6994cee5
commit
f7f29dbbd3
5 changed files with 9 additions and 98 deletions
|
@ -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';
|
||||
|
|
|
@ -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<int> {
|
||||
NumberPickerFormField({
|
||||
Key? key,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
]
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
export 'page_indicator.dart';
|
Loading…
Reference in a new issue