gender_selector 1.0.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

gender_selector #

A Flutter Package for gender selector widget for the app.

The goal of this project is to provide an ultimate widget for selecting the gender

The source code is 100% Dart, and everything resides in the /lib folder.

Happy learning. 👍

Show some ❤️ and star the repo to support the project

GitHub stars GitHub forks GitHub watchers GitHub followers Twitter Follow

Open Source Love License

Screenshots #

Medium Article #

Medium Article

Installation #

First Include this dependency in your pubspec.yaml

gender_selector:

Then import it in your code.

Widget #

GenderSelector(
  margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 10,),
  selectedGender: Gender.FEMALE,
  onChanged: (gender) async {

    setState(() {
      if(gender == Gender.FEMALE) {
        selectedGender = "female";
      } else {
        selectedGender = "male";
      }
    });

  },

)

Contribution Guide #

This project is open to all kinds of contribution in all of its categories. Together, we can make it the ultimate Gender Selector available for free, for everyone, forever.

For resource contribution, just follow the following format: [reference-name](link) - Description, and raise a Pull Request. If you want to contribute multiple resources, raise separate PRs for each of them. Please consider adding resources maintaining the default sorting order of the category, like alphabetical sorting.

If you have any suggestion for including more categories, feel free to open a Github issue for us to have more discussion on it. Please DO NOT contribute low-quality, spammy or self-promotional stuff. Let's keep this project clean and useful.

If you feel that a particular resource(s)/template(s) available here is not a good fit for this project and should be removed, feel free to let me know by opening an issue.

❤️ Found this project useful? #

If you found this project useful, then please consider giving it a ⭐ on Github and sharing it with your friends via social media.

Project Created & Maintained By

Dhruvil Patel & Nirav Patel (BZZZARD)

Donate #

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of ☕

License #

Copyright 2019 Dhruvil Patel

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

## Getting Started

For help getting started with Flutter, view our online
[documentation](https://flutter.io/).

[1.0.6] - Release

  • Readme.md Improved

[1.0.5] - Release

  • Readme.md changed

[1.0.4] - Release

  • Readme.md changed

[1.0.3] - Release

  • New Example Added

[1.0.2] - Release

  • Image Loading Issue Solved

[1.0.1] - Release

  • Image Loading Issue Solved

[1.0.0] - Release

  • First Stable Release

[0.0.4] - Release

  • Minor Changes

[0.0.3] - Release

  • Minor Changes

[0.0.2] - Release

  • Example Added

[0.0.1] - Release

  • A Flutter widget for adding gender selection in the app.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:gender_selector/gender_selector.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter 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> {
 
  @override
  Widget build(BuildContext context) {
  
    return Scaffold(
      appBar: AppBar(
       
        title: Text(widget.title),
      ),
      body: Center(
       
        child: GenderSelector(
          onChanged: (gender) {
            print(gender);
          },
        ),

      ),
      
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  gender_selector: ^1.0.6

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:gender_selector/gender_selector.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

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

Analysis of lib/gender_selector.dart reported 1 hint:

line 7 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: GenderSelector.maleimg, GenderSelector.femaleimg, GenderSelector.maletxt, GenderSelector.femaletxt, GenderSelector.padding, GenderSelector.margin, GenderSelector.selectedGender, GenderSelector.onChanged

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 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test