basic_components 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

Custom Basic Components #

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 basic_components as a dependency in your pubspec.yaml file.

basic_components: ^0.0.18

[1.0.2] - 15 Feb 2020. #

  • buat advtimepicker
  • chooser belum ada measuretext
  • increment kalo error aneh jadinya
  • bikin timepicker
  • tambah margin di button
  • gmn kalo attribute textfield itu dimasukkin ke 1 class aja? jadi smua bs dimodify real time
  • cari tau knp chooser pas bottomsheetnya nongol dia gk kecheck
  • fetch data pertama x kyknya dihapusin aja deh
  • add border width to button

[1.0.1] - 5 Feb 2020. #

  • Group Check dan Group Radio divider garisnya jgn kasi margin horizontal
  • adv checkbox kasi size param
  • Increment padding dsb masi ngaco dan measuretext
  • Increment kalo uda mentok, disable button

[1.0.0+6] - 3 Des 2019. #

  • Fix groupcheck and groupRadio not calling callback

[1.0.0+5] - 3 Des 2019. #

  • Fix groupcheck's items argument from Map<String, Widget> to List
  • Add prefixCheckbox for both GroupCheck and GroupRadio
  • Takeout GroupRadio's timer after user tapped and move it to pickFromChooser

[1.0.0+4] - 2 Des 2019. #

  • Add clear focus when button is pressed
  • Fix Chooser drop icon position when errors

[1.0.0+3] - 2 Des 2019. #

  • Fix increment min amount issue

[1.0.0+2] - 25 Nov 2019. #

  • Fix chooser padding issues

[1.0.0+1] - 23 Nov 2019. #

  • Fix textfield didupdatewidget

[1.0.0] - 23 Nov 2019. #

  • Stable version
  • Fix chooser and add intentType page and bottomsheet
  • Fix datepicker
  • Fix groupcheck
  • Fix increment
  • Add link and theme helper

[0.0.4+5] - 6 Nov 2019. #

  • List Tile add default padding 16.0
  • Fix Adv Button typo
  • Fix Adv Radio Group when stringChildren is null
  • Fix Adv Increment without controller set amount to 0 instead of ""

[0.0.4+4] - 6 Nov 2019. #

  • Button Padding now is customizable from the outside

[0.0.4+3] - 5 Nov 2019. #

  • Fix textfield to set text editing controller's text on initstate

[0.0.4+2] - 30 Oct 2019. #

  • Fix textfield controller

[0.0.4+1] - 27 Oct 2019. #

  • Fix textfield controller

[0.0.4] - 26 Oct 2019. #

  • Fix textfield controller handling that causes the selection always on the start

[0.0.3+2] - 18 Oct 2019. #

  • Fix more bugs

[0.0.3+1] - 18 Oct 2019. #

  • Fix some bugs

[0.0.3] - 18 Oct 2019. #

  • Add AdvLoadingWithBarrier

[0.0.2] - 18 Oct 2019. #

  • Add measure text functionality for AdvIncrement and AdvDatePicker
  • Add padding and margin for AdvTextField, AdvIncrement, and AdvDatePicker
  • Add minDate and maxDate for AdvDatePicker

[0.0.1+1] - 18 Oct 2019. #

  • Change dart file name that fixes import problem.

[0.0.1] - 17 Oct 2019. #

  • Initial release.

example/lib/main.dart

import 'package:basic_components/components/adv_chooser.dart';
import 'package:basic_components/components/adv_column.dart';
import 'package:basic_components/components/adv_date_picker.dart';
import 'package:basic_components/components/adv_group_check.dart';
import 'package:basic_components/components/adv_group_radio.dart';
import 'package:basic_components/components/adv_increment.dart';
import 'package:basic_components/components/adv_row.dart';
import 'package:basic_components/components/adv_text_field.dart';
import 'package:basic_components/components/adv_time_picker.dart';
import 'package:basic_components/components/component_theme.dart';
import 'package:basic_components/components/component_theme_data.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ComponentTheme(
      data: ComponentThemeData(chooser: ChooserTheme(iconColor: Colors.purple)),
      child: MaterialApp(
        title: 'PIT Components Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(title: 'PIT Components Demo Home Page'),
      ),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  AdvTextFieldController controller = AdvTextFieldController();
  AdvIncrementController incrementController =
      AdvIncrementController(amount: 10, minAmount: 0, maxAmount: 15);
  AdvDatePickerController dateController = AdvDatePickerController(
    minDate: DateTime.now(),
    maxDate: DateTime.now().add(Duration(days: 30)),
  );

  AdvGroupRadioController groupRadioController =
      AdvGroupRadioController(text: "Test1", items: {
    "Test1": Icon(Icons.edit_attributes),
    "Test2": Icon(Icons.speaker_notes),
    "Test3": Icon(Icons.speaker_notes_off),
  });

  AdvGroupCheckController groupCheckController =
      AdvGroupCheckController(items: [
    AdvGroupCheckItem(
        value: "Test1", display: Icon(Icons.edit_attributes), isChecked: false),
    AdvGroupCheckItem(
        value: "Test2", display: Icon(Icons.speaker_notes), isChecked: false),
    AdvGroupCheckItem(
        value: "Test3",
        display: Icon(Icons.speaker_notes_off),
        isChecked: false),
  ]);

  @override
  Widget build(BuildContext context) {
    Color c = ComponentTheme.of(context).chooser.iconColor;

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SingleChildScrollView(
        child: Container(
          color: Color(0xffffedd8),
          child: AdvColumn(
            padding: EdgeInsets.symmetric(horizontal: 16.0),
            divider: ColumnDivider(16.0),
            children: [
              SingleChildScrollView(
                scrollDirection: Axis.horizontal,
                child: AdvRow(divider: RowDivider(16.0), children: [
                  Container(
                    child: AdvIncrement(
                      measureText: "01-01-2019",
//                      style: TextStyle(fontSize: 32.0),
                    ),
                  ),
//                  Container(
//                    child: AdvDatePicker(
//                      measureText: "01-01-2019",
////                      style: TextStyle(fontSize: 32.0),
//                    ),
//                  ),
//                  Container(
//                    child: AdvTimePicker(
//                      measureText: "01:00 AM",
////                      style: TextStyle(fontSize: 32.0),
//                    ),
//                  ),
                  AdvChooser(
                    measureText: "Satu",
//                    style: TextStyle(fontSize: 32.0),
                    textAlign: TextAlign.center,
                    items: {
                      "test1": "Satu",
                      "test2": "Dua",
                      "test3": "Tiga",
                      "test4": "Empat",
                    },
                  )
                ]),
              ),
//              AdvTextField(
//                controller: controller
//                  ..prefixIcon = Material(
//                      child: InkWell(
//                    child: Icon(Icons.add),
//                    onTap: () {
//                      Toast.showToast(context, "I'm Tapped!");
//                    },
//                  )),
//                minLines: 3,
//                maxLines: 4,
//                decoration: InputDecoration(
//                  hintText: "Text \n lalala",
//                  prefix: Text("Prefix"),
//                  isDense: true,
//                  helperText: "This is Helper Text",
//                ),
//              ),
//              Text(
//                "Prefix",
//                style: p16.accent.copyWith(color: c),
//              ),
//              TextField(
//                minLines: 3,
//                maxLines: 4,
//                decoration: InputDecoration(
//                  hintText: "Text \n lalala",
//                  labelText: "Latex",
//                  prefix: Text("Prefix"),
//                  prefixIcon: Icon(Icons.add),
//                  helperText: "This is Helper Text",
//                  contentPadding: EdgeInsets.all(8.0),
//                  focusedBorder: OutlineInputBorder(
//                      borderSide: BorderSide(color: Colors.green)),
//                  filled: true,
//                  enabledBorder: OutlineInputBorder(
//                      borderSide: BorderSide(width: 5.0, color: Colors.red)),
//                  errorBorder: InputBorder.none,
//                  focusedErrorBorder: InputBorder.none,
//                  fillColor: Colors.white,
//                  focusColor: Colors.green,
//                  hoverColor: Colors.orange,
//                ),
////                scrollPadding: EdgeInsets.all(16.0),
//              ),
//              AdvRow(
//                padding: EdgeInsets.symmetric(horizontal: 16.0),
//                divider: RowDivider(16.0),
//                children: [
//                  FlatButton(
//                    child: Text("Hide Password!"),
//                    onPressed: () {
//                      controller.obscureText = true;
//                    },
//                  ),
//                  FlatButton(
//                    child: Text("Unhide Password!"),
//                    onPressed: () {
//                      controller.obscureText = false;
//                    },
//                  ),
//                ],
//              ),
//              AdvRow(
//                padding: EdgeInsets.symmetric(horizontal: 16.0),
//                divider: RowDivider(16.0),
//                children: [
//                  FlatButton(
//                    child: Text("Set Error!"),
//                    onPressed: () {
//                      controller.error = "Error!";
//                    },
//                  ),
//                  FlatButton(
//                    child: Text("Unset Error!"),
//                    onPressed: () {
//                      controller.error = null;
//                    },
//                  ),
//                ],
//              ),
//              AdvRow(
//                padding: EdgeInsets.symmetric(horizontal: 16.0),
//                divider: RowDivider(16.0),
//                children: [
//                  FlatButton(
//                    child: Text("Disable!"),
//                    onPressed: () {
//                      controller.enabled = false;
//                    },
//                  ),
//                  FlatButton(
//                    child: Text("Enable!"),
//                    onPressed: () {
//                      controller.enabled = true;
//                    },
//                  ),
//                ],
//              ),
//              AdvRow(
//                padding: EdgeInsets.symmetric(horizontal: 16.0),
//                divider: RowDivider(16.0),
//                children: [
//                  FlatButton(
//                    child: Text("Set Text!"),
//                    onPressed: () {
//                      controller.text = "Date Time = ${DateTime.now()}";
//                    },
//                  ),
//                ],
//              ),
//              Container(
//                color: Colors.white,
//                child: AdvChooser(
//                    style: TextStyle(fontSize: 32.0),
//                    textAlign: TextAlign.center,
//                    items: {
//                      "test1": "Satu",
//                      "test2": "Dua",
//                      "test3": "Tiga",
//                      "test4": "Empat",
//                    }),
//              ),
//              AdvRow(divider: RowDivider(16.0), children: [
//                Container(
//                  color: Colors.white,
//                  child: AdvIncrement(
//                    margin: EdgeInsets.all(16.0),
//                    decoration:
//                        InputDecoration(contentPadding: EdgeInsets.all(8.0)),
//                    measureText: "@@@",
//                    textAlign: TextAlign.center,
//                    controller: incrementController,
//                    addButtonColor: Colors.blue,
//                    style: TextStyle(fontSize: 16),
//                    addButtonShapeBorder: CircleBorder(side: BorderSide()),
//                  ),
//                ),
//                Container(
//                  color: Colors.white,
//                  child: AdvDatePicker(
//                    margin: EdgeInsets.all(8.0),
//                    decoration: InputDecoration(
//                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0)),
//                    measureText: "23-10-2019",
////                    style: Te.green,
//                    textAlign: TextAlign.center,
//                    controller: dateController,
//                    onChanged: (dates) {},
//                  ),
//                ),
//              ]),
//              AdvGroupRadio(
//                controller: groupRadioController,
//                callback: (itemSelected) async {
//                  Navigator.of(context).pop(itemSelected);
//                },
//              ),
//              AdvGroupCheck(
//                controller: groupCheckController,
//                callback: (itemSelected) async {
//                  Navigator.of(context).pop(itemSelected);
//                },
//              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  basic_components: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:basic_components/basic_components.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
61
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [basic_components] that is in a package requiring null.

Health suggestions

Fix lib/components/adv_date_picker.dart. (-1.49 points)

Analysis of lib/components/adv_date_picker.dart reported 3 hints:

line 5 col 8: Unused import: 'package:basic_components/basic_components.dart'.

line 221 col 56: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

line 280 col 59: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

Fix lib/components/adv_increment.dart. (-1.49 points)

Analysis of lib/components/adv_increment.dart reported 3 hints:

line 223 col 31: The member 'hasListeners' can only be used within instance members of subclasses of 'package:flutter/src/foundation/change_notifier.dart'.

line 232 col 56: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

line 288 col 59: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

Fix lib/components/adv_chooser.dart. (-1 points)

Analysis of lib/components/adv_chooser.dart reported 2 hints:

line 249 col 56: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

line 306 col 57: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

Fix additional 28 files with analysis or formatting issues. (-2.50 points)

Additional issues in the following files:

  • lib/components/adv_time_picker.dart (2 hints)
  • lib/components/adv_button.dart (1 hint)
  • lib/components/adv_group_check.dart (1 hint)
  • lib/components/adv_text_field.dart (1 hint)
  • lib/basic_components.dart (Run flutter format to format lib/basic_components.dart.)
  • lib/components/adv_check_box.dart (Run flutter format to format lib/components/adv_check_box.dart.)
  • lib/components/adv_chooser_controller.dart (Run flutter format to format lib/components/adv_chooser_controller.dart.)
  • lib/components/adv_chooser_page.dart (Run flutter format to format lib/components/adv_chooser_page.dart.)
  • lib/components/adv_column.dart (Run flutter format to format lib/components/adv_column.dart.)
  • lib/components/adv_date_picker_controller.dart (Run flutter format to format lib/components/adv_date_picker_controller.dart.)
  • lib/components/adv_group_check_controller.dart (Run flutter format to format lib/components/adv_group_check_controller.dart.)
  • lib/components/adv_group_radio_controller.dart (Run flutter format to format lib/components/adv_group_radio_controller.dart.)
  • lib/components/adv_increment_controller.dart (Run flutter format to format lib/components/adv_increment_controller.dart.)
  • lib/components/adv_row.dart (Run flutter format to format lib/components/adv_row.dart.)
  • lib/components/adv_text.dart (Run flutter format to format lib/components/adv_text.dart.)
  • lib/components/adv_text_field_controller.dart (Run flutter format to format lib/components/adv_text_field_controller.dart.)
  • lib/components/basic/time_picker_widget.dart (Run flutter format to format lib/components/basic/time_picker_widget.dart.)
  • lib/components/calendar_carousel.dart (Run flutter format to format lib/components/calendar_carousel.dart.)
  • lib/components/calendar_day.dart (Run flutter format to format lib/components/calendar_day.dart.)
  • lib/components/calendar_month.dart (Run flutter format to format lib/components/calendar_month.dart.)
  • lib/components/calendar_page.dart (Run flutter format to format lib/components/calendar_page.dart.)
  • lib/components/calendar_year.dart (Run flutter format to format lib/components/calendar_year.dart.)
  • lib/components/component_theme.dart (Run flutter format to format lib/components/component_theme.dart.)
  • lib/components/component_theme_data.dart (Run flutter format to format lib/components/component_theme_data.dart.)
  • lib/helper/string_helper.dart (Run flutter format to format lib/helper/string_helper.dart.)
  • lib/helper/theme_helper.dart (Run flutter format to format lib/helper/theme_helper.dart.)
  • lib/utilities/number_thousand_formatter.dart (Run flutter format to format lib/utilities/number_thousand_formatter.dart.)
  • lib/utilities/toast.dart (Run flutter format to format lib/utilities/toast.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
flutter 0.0.0
intl ^0.16.0 0.16.1
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
path 1.7.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test