pit_components 0.0.5 copy "pit_components: ^0.0.5" to clipboard
pit_components: ^0.0.5 copied to clipboard

outdated

PIT components package

Components by PIT #

A bundle that contains our custom components, mostly just override the default Flutter widgets and custom its style and some of its functional.

Note: This plugin is still under development, and some Components might not be available yet or still has so many bugs.

  • The date picker components inspired by flutter_calendar_carousel, I clone it and override some of its functional and add selection types (single, multi or range)

Installation #

First, add pit_components as a dependency in your pubspec.yaml file.

pit_multiple_image_picker: ^0.0.5

Example #

import 'package:pit_components/components/adv_button.dart';
import 'package:pit_components/components/adv_column.dart';
import 'package:pit_components/components/adv_date_picker.dart';
import 'package:pit_components/components/adv_drop_down.dart';
import 'package:pit_components/components/adv_row.dart';
import 'package:pit_components/components/adv_text.dart';
import 'package:pit_components/components/adv_text_field.dart';
import 'package:pit_components/components/adv_text_field_controller.dart';
import 'package:pit_components/components/adv_text_field_plain.dart';
import 'package:pit_components/components/adv_single_digit_inputter.dart';

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  DateTime date;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    AdvTextFieldController controller =
        AdvTextFieldController(label: "Just TextField MaxLines 1", maxLines: 1);
    AdvTextFieldController plainController =
        AdvTextFieldController(label: "Plain TextField");

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        color: Color(0xffFFF1CA),
        child: AdvColumn(
          padding: EdgeInsets.symmetric(horizontal: 16.0),
          onlyInner: false,
          divider: ColumnDivider(16.0),
          children: [
            AdvRow(divider: RowDivider(8.0), children: [
              Expanded(child: AdvTextField(controller: controller)),
              Expanded(child: AdvTextFieldPlain(controller: plainController)),
            ]),
            AdvRow(divider: RowDivider(8.0), children: [
              Expanded(child: AdvButton("Normal", enable: false)),
              Expanded(
                  child:
                      AdvButton("Outlined", onlyBorder: true, enable: false)),
              Expanded(
                  child: AdvButton("Reverse", reverse: true, enable: false))
            ]),
            AdvButton("Small",
                width: double.infinity, buttonSize: ButtonSize.small),
            AdvRow(divider: RowDivider(8.0), children: [
              Expanded(
                child: AdvButtonWithIcon(
                    "", Icon(Icons.ring_volume), Axis.vertical),
              ),
              Expanded(
                  child: AdvButtonWithIcon(
                      "", Icon(Icons.airline_seat_flat_angled), Axis.vertical,
                      onPressed: () {}, onlyBorder: true)),
              Expanded(
                  child: AdvButtonWithIcon(
                      "", Icon(Icons.headset), Axis.vertical,
                      onPressed: () {}, reverse: true)),
            ]),
            Visibility(
                visible: date != null,
                child: AdvText("You picked date => $date")),
            AdvDatePicker(
              onChanged: (List value) {
                setState(() {
                  date = value[0];
                });
              },
              markedDates: [
                MarkedDate(DateTime(2018, 11, 20),
                    "20th November - Maulid Nabi Muhammad")
              ],
            ),
            AdvDropDown(
              onChanged: (String value) {
              },
              items: {
                "data 1": "display 1",
                "data 2": "display 2",
                "data 3": "display 3"
              },
            ),
            AdvSingleDigitInputter(
              text: "12345",
              digitCount: 5,
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

PIT components package

Homepage

License

unknown (LICENSE)

Dependencies

flutter, flutter_range_slider, intl

More

Packages that depend on pit_components