import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:toolheim/data/github_adapter.dart';
import 'package:toolheim/data/warband_roster.dart' as roster;
import 'package:toolheim/widgets/stats_widget.dart';

class UnitScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    GitHubAdapter github = Provider.of<GitHubAdapter>(context);

    final roster.Hero hero = ModalRoute.of(context).settings.arguments;

    return Scaffold(
        appBar: AppBar(
            actions: <Widget>[
              CircleAvatar(
                child: Text(hero.experience.toString()),
                backgroundColor: Colors.green,
                foregroundColor: Colors.greenAccent,
              ),
            ],
            title: Column(
              children: <Widget>[
                Text(hero.name),
                Text(
                  hero.type,
                  textAlign: TextAlign.left,
                  style: TextStyle(fontSize: 12, fontWeight: FontWeight.normal),
                )
              ],
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
            )),
        body: Column(
          children: <Widget>[StatsWidget(hero.stats)],
        ));
  }
}
