custom_radio_button 0.0.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 77

custom_radio_button #

pub package

A Flutter package for iOS and Android for Custom Radio Button.

Demo #

Installation #

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

iOS #

No configuration required - the plugin should work out of the box.

Android #

No configuration required - the plugin should work out of the box.

Code for the Square Radio Group widget #

import 'package:custom_radio_button/custom_radio_button.dart';
import 'package:custom_radio_button/radio_model.dart';

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String _selectedValue;
  
 
  @override
  Widget build(BuildContext context) {
  List<RadioModel> priorityList = new List<RadioModel>();
        priorityList.add(new RadioModel(false, null, 'Heigh', Colors.redAccent));
        priorityList
            .add(new RadioModel(false, null, 'Medium', Colors.deepPurple));
        priorityList
            .add(new RadioModel(false, null, 'Slight', Colors.blueAccent));
        priorityList
            .add(new RadioModel(false, null, 'Normal', Colors.purpleAccent));
    return CustomRadioGroupWidget(
                           onChanged: getvalue,
                           isSquareRadioGroup: true,
                           radioList: priorityList,
                         );
  }
  void getvalue(Map value) {
      _selectedValue = value;
    }
}

Code for the Round Radio Group widget #

import 'package:custom_radio_button/custom_radio_button.dart';
import 'package:custom_radio_button/radio_model.dart';

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String _selectedValue;
  
 
  @override
  Widget build(BuildContext context) {
  List<RadioModel> incidentTypeList = new List<RadioModel>();
        incidentTypeList.add(new RadioModel(
            false,
            Icon(
              Icons.whatshot,
              color: Colors.blue,
            ),
            'Fire',
            Colors.red));
        incidentTypeList.add(new RadioModel(
            false,
            Icon(
              Icons.face,
              color: Colors.red,
            ),
            'Near Miss',
            Colors.deepPurple));
        incidentTypeList.add(new RadioModel(
            false,
            Icon(
              Icons.directions_car,
              color: Colors.deepOrange,
            ),
            'Accident',
            Colors.blueAccent));
        incidentTypeList.add(new RadioModel(
            false,
            Icon(
              Icons.directions_run,
              color: Colors.greenAccent,
            ),
            'Theft',
            Colors.purpleAccent));
        incidentTypeList.add(new RadioModel(
            false,
            Icon(
              Icons.business,
              color: Colors.yellow,
            ),
            'Property damage',
            Colors.greenAccent));
    return CustomRadioGroupWidget(
                           onChanged: getvalue,
                           isSquareRadioGroup: false,
                           radioList: incidentTypeList,
                         );
  }
  void getvalue(Map value) {
      _selectedValue = value;
    }
}

Code for the Full page Radio Group Widget #

import 'package:custom_radio_button/full_page_radio_group.dart';

class RadioGroupPage extends StatelessWidget {
  final Map mapData;
  const RadioGroupPage({Key key, this.mapData}) : super(key: key);

  @override
  Widget build(BuildContext context) {
   

    return new FullPageRadioGroup(
        
        isSquareRadioGroup: false,
        title: "What happended?",
        route: "/fourth",
        mapData: mapData,
        mapKey: 'incidentType');
  }
}

[0.0.3]

  • Disable landScape Mode

[0.0.2]

  • add MIT License

[0.0.1]

  • Initial release

Use this package as a library

1. Depend on it

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


dependencies:
  custom_radio_button: ^0.0.3

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:custom_radio_button/custom_radio_button.dart';
  
Version Uploaded Documentation Archive
0.0.3 Apr 4, 2019 Go to the documentation of custom_radio_button 0.0.3 Download custom_radio_button 0.0.3 archive
0.0.2 Apr 3, 2019 Go to the documentation of custom_radio_button 0.0.2 Download custom_radio_button 0.0.2 archive
0.0.1 Apr 3, 2019 Go to the documentation of custom_radio_button 0.0.1 Download custom_radio_button 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
72
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
56
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Jun 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/full_page_radio_group.dart. (-0.50 points)

Analysis of lib/full_page_radio_group.dart reported 1 hint:

line 9 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: FullPageRadioGroup.mapData, FullPageRadioGroup.radioList, FullPageRadioGroup._selectedValue

Fix lib/utils.dart. (-0.50 points)

Analysis of lib/utils.dart reported 1 hint:

line 11 col 9: 'child' is deprecated and shouldn't be used.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

The package description is too short. (-15 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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and custom_radio_button.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Update README.md. (-4 points)

2 image links are insecure (e.g. http://sheikhsoft.com/screensort/custom_radio_button_1.png), use https URLs instead.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test