geek_code 2.0.1


A Dart implementation of the Geek Code.

This package is actually a port and cleaned up version of JGeekCode from Java.

Basic ideas

  • This library uses builders to generate the different categories that make up a Geek Code
  • Building a category is done by calling the grade method with a GeekCodeGrade or by calling some of the modifiers (i.e. noKnowledge) instead
  • The geek_code library includes a collection of base classes which are useful for implementing custom Geek Code flavors
  • The geek_code.v312 library is an implementation of the Geek Code v3.12 specification (specified at, which is useful for generating a personal Geek Code

Generating a Geek Code with geek_code.v312

First you must import the library:

import "package:geek_code/geek_code_312.dart";

Start with a GeekCodeV312 object that will contain all the types and categories:

GeekCodeV312 code = new GeekCodeV312([G312.IT, G312.CS]);

The above constructor receives a list of GeekCodeTypes.

Then add categories to the code object using the addCategory(GeekCodeCategory).

All v3.12 categories are globally defined by their code:

code.addCategory(C.grade(new GeekCodeGrade(2))); // Adds the C category (Computers) with a grade of 2 to the code

Generating a Geek Code block is done by callin generate:


Variables and modifiers

As per the v3.12 specification it is possible to set certain modifiers for categories.

code.addCategory( GeekCodeGrade(-2))); // Adds the h category (Housing) with a grade of -2 and adds the "living" modifier to the code

Some modifiers are incompatible with each other:

code.addCategory(; // Throws a GeekCodeError

Some categories have specific modifiers so be sure to consult the documentation for each builder before using it.

Full example

GeekCodeV312 code = new GeekCodeV312([G312.IT, G312.CS] as List<GeekCodeType>)
  ..addCategory(d.crossover(new GeekCodeGrade(0)).living().grade(new GeekCodeGrade(-1)))
  ..addCategory(s.roundness(new BasicGeekCodeCategoryBuilder().grade(new GeekCodeGrade(-1))).grade(new GeekCodeGrade(3)))
  ..addCategory(a.grade(new GeekCodeGrade(-3)))
  ..addCategory(C.grade(new GeekCodeGrade(2)))
  ..addCategory(U.B().grade(new GeekCodeGrade(2)))
  ..addCategory(E.grade(new GeekCodeGrade(-1)))
  ..addCategory(W.grade(new GeekCodeGrade(3)))
  ..addCategory(w.grade(new GeekCodeGrade(-3)))
  ..addCategory(M.grade(new GeekCodeGrade(2)))
  ..addCategory(PS.grade(new GeekCodeGrade(0)))
  ..addCategory(Y.grade(new GeekCodeGrade(0)))
  ..addCategory(tv.grade(new GeekCodeGrade(1)))
  ..addCategory(b.grade(new GeekCodeGrade(1)))
  ..addCategory(DI.grade(new GeekCodeGrade(0)))
  ..addCategory(GCode.grade(new GeekCodeGrade(2)))
  ..addCategory(e.grade(new GeekCodeGrade(0)))
  ..addCategory(h.grade(new GeekCodeGrade(-2)))
  ..addCategory(z.male().grade(new GeekCodeGrade(0)));

Feature requests and bug reports

Please file feature requests and bug reports at the issue tracker.


Kindly refer to the Github repo's releases list

1. Depend on it

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

  geek_code: "^2.0.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:geek_code/geek_code.dart';



Dart implementation of The Geek Code


Meshulam Silk







Apr 12, 2015