add last sync
This commit is contained in:
parent
47d41f58e4
commit
9409f91330
5 changed files with 36 additions and 35 deletions
|
@ -1,6 +1,7 @@
|
||||||
import 'package:badges/badges.dart';
|
import 'package:badges/badges.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:timeago_flutter/timeago_flutter.dart';
|
||||||
|
|
||||||
import 'package:toolheim/data/github_adapter.dart';
|
import 'package:toolheim/data/github_adapter.dart';
|
||||||
import 'package:toolheim/widgets/stats_widget.dart';
|
import 'package:toolheim/widgets/stats_widget.dart';
|
||||||
|
@ -43,8 +44,21 @@ class WarbandRosterScreen extends StatelessWidget {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(github.activeRoster.name),
|
title: Text(github.activeRoster.name),
|
||||||
),
|
),
|
||||||
drawer:
|
drawer: Drawer(
|
||||||
Drawer(child: SingleChildScrollView(child: WarbandDrawerWidget())),
|
child: Column(children: <Widget>[
|
||||||
|
Expanded(child: SingleChildScrollView(child: WarbandDrawerWidget())),
|
||||||
|
Container(
|
||||||
|
color: Colors.brown,
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.bottomLeft,
|
||||||
|
child: Timeago(
|
||||||
|
date: github.lastSync,
|
||||||
|
builder: (_, value) => Text(
|
||||||
|
'Last sync: ' + value,
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
))))
|
||||||
|
])),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
for (var hero in github.activeRoster.heros)
|
for (var hero in github.activeRoster.heros)
|
||||||
|
|
|
@ -44,6 +44,9 @@ class WarbandDrawerWidget extends StatelessWidget {
|
||||||
|
|
||||||
return Column(children: <Widget>[
|
return Column(children: <Widget>[
|
||||||
UserAccountsDrawerHeader(
|
UserAccountsDrawerHeader(
|
||||||
|
currentAccountPicture: CircleAvatar(
|
||||||
|
child: Text(github.activeRoster.campaignPoints.toString() + ' CP'),
|
||||||
|
),
|
||||||
margin: const EdgeInsets.all(0),
|
margin: const EdgeInsets.all(0),
|
||||||
otherAccountsPictures: <Widget>[
|
otherAccountsPictures: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
|
@ -103,16 +106,15 @@ class WarbandDrawerWidget extends StatelessWidget {
|
||||||
badgeColor: Colors.black12,
|
badgeColor: Colors.black12,
|
||||||
shape: BadgeShape.square,
|
shape: BadgeShape.square,
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
badgeContent: Text(roster.campaignPoints.toString() + ' CP',
|
badgeContent: Text(roster.experience().toString() + ' xp',
|
||||||
style: TextStyle(color: Colors.white)),
|
style: TextStyle(color: Colors.white)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Divider()
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void openHelpWebsite() async {
|
void openHelpWebsite() async {
|
||||||
const url = 'http://git.datenhalter.de/aaron/toolheim/wiki/Home';
|
const url = 'https://aaron-fischer.net/';
|
||||||
if (await canLaunch(url)) {
|
if (await canLaunch(url)) {
|
||||||
await launch(url);
|
await launch(url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -478,6 +478,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.5"
|
version: "0.2.5"
|
||||||
|
timeago:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: timeago
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.18"
|
||||||
|
timeago_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: timeago_flutter
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.0"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -28,6 +28,7 @@ dependencies:
|
||||||
preferences:
|
preferences:
|
||||||
localstorage:
|
localstorage:
|
||||||
url_launcher:
|
url_launcher:
|
||||||
|
timeago_flutter:
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
// This is a basic Flutter widget test.
|
|
||||||
//
|
|
||||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
|
||||||
// utility that Flutter provides. For example, you can send tap and scroll
|
|
||||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
|
||||||
// tree, read text, and verify that the values of widget properties are correct.
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
|
|
||||||
import 'package:toolheim/main.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
|
||||||
// Build our app and trigger a frame.
|
|
||||||
await tester.pumpWidget(Toolheim());
|
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
|
||||||
expect(find.text('0'), findsOneWidget);
|
|
||||||
expect(find.text('1'), findsNothing);
|
|
||||||
|
|
||||||
// Tap the '+' icon and trigger a frame.
|
|
||||||
await tester.tap(find.byIcon(Icons.add));
|
|
||||||
await tester.pump();
|
|
||||||
|
|
||||||
// Verify that our counter has incremented.
|
|
||||||
expect(find.text('0'), findsNothing);
|
|
||||||
expect(find.text('1'), findsOneWidget);
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in a new issue