super_hero 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

super_hero #

SuperHeroBanner

  • A Flutter package to generate random super-hero names to be used as placeholder text.
  • Rather than plain old random-word pairs, you can instead fill in with a super-hero name.

Usage : #

Importing the package #

import 'package:super_hero/super_hero.dart';

Retrieving a random super-hero name #

SuperHero.random(); // returns a random super-hero name

Pubspec Set-Up #

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  super_hero: ^1.0.0  # Include this line under the dependencies.

[1.0.1] - 18th January, 2020 #

  • Fully working release (with no dependencies).

example/main.dart

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

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

class SuperHeroIllustrator extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _SuperHeroIllustratorState();
}

class _SuperHeroIllustratorState extends State<SuperHeroIllustrator> {
  String _superHeroName = SuperHero.random();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primarySwatch: Colors.indigo),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: Text('Super Hero Illustrator'),
        ),
        body: Center(
          child: Text(
            _superHeroName,
            style: TextStyle(
              fontSize: 24.0,
              fontWeight: FontWeight.bold,
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.skip_next),
          onPressed: () {
            setState(() {
              _superHeroName = SuperHero.random();
            });
          },
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  super_hero: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:super_hero/super_hero.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
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]
70
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
flutter_test