super_hero 1.0.1 copy "super_hero: ^1.0.1" to clipboard
super_hero: ^1.0.1 copied to clipboard

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.

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();
            });
          },
        ),
      ),
    );
  }
}
11
likes
40
pub points
71%
popularity

Publisher

unverified uploader

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.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on super_hero