Reformatted code

This commit is contained in:
Jonas Franz 2018-09-16 21:47:53 +02:00
parent 4c986b85df
commit 2bb5f7c6a2
No known key found for this signature in database
GPG Key ID: 506AEEBE80BEDECD
6 changed files with 14 additions and 16 deletions

View File

@ -3,12 +3,7 @@ import 'package:flutter/material.dart';
import 'package:crypto/crypto.dart';
class GravatarImageProvider extends NetworkImage {
GravatarImageProvider(String email) : super(
"https://secure.gravatar.com/avatar/" + md5.convert(
email
.trim()
.toLowerCase()
.codeUnits
).toString()
);
GravatarImageProvider(String email)
: super("https://secure.gravatar.com/avatar/" +
md5.convert(email.trim().toLowerCase().codeUnits).toString());
}

View File

@ -16,7 +16,8 @@ class VikunjaGlobal extends StatefulWidget {
VikunjaGlobalState createState() => VikunjaGlobalState();
static VikunjaGlobalState of(BuildContext context) {
var widget = context.inheritFromWidgetOfExactType(_VikunjaGlobalInherited) as _VikunjaGlobalInherited;
var widget = context.inheritFromWidgetOfExactType(_VikunjaGlobalInherited)
as _VikunjaGlobalInherited;
return widget.data;
}
}
@ -93,7 +94,8 @@ class _VikunjaGlobalInherited extends InheritedWidget {
@override
bool updateShouldNotify(_VikunjaGlobalInherited oldWidget) {
return (data.currentUser != null && data.currentUser.id != oldWidget.data.currentUser.id) ||
return (data.currentUser != null &&
data.currentUser.id != oldWidget.data.currentUser.id) ||
data.client != oldWidget.data.client;
}
}

View File

@ -18,4 +18,4 @@ class VikunjaApp extends StatelessWidget {
home: VikunjaGlobal(child: new HomePage(), login: new LoginPage()),
);
}
}
}

View File

@ -15,4 +15,4 @@ class UserTokenPair {
final User user;
final String token;
UserTokenPair(this.user, this.token);
}
}

View File

@ -87,9 +87,10 @@ class HomePageState extends State<HomePage> {
new UserAccountsDrawerHeader(
accountEmail: currentUser == null ? null : Text(currentUser.email),
accountName: currentUser == null ? null : Text(currentUser.username),
currentAccountPicture: currentUser == null ? null : CircleAvatar(
backgroundImage: GravatarImageProvider(currentUser.username)
),
currentAccountPicture: currentUser == null
? null
: CircleAvatar(
backgroundImage: GravatarImageProvider(currentUser.username)),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/graphics/hypnotize.png"),

View File

@ -29,4 +29,4 @@ abstract class TaskService {
abstract class UserService {
Future<UserTokenPair> login(String username, password);
Future<User> get(int userId);
}
}