Reformatted code
This commit is contained in:
parent
4c986b85df
commit
2bb5f7c6a2
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,4 @@ class VikunjaApp extends StatelessWidget {
|
|||
home: VikunjaGlobal(child: new HomePage(), login: new LoginPage()),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,4 +15,4 @@ class UserTokenPair {
|
|||
final User user;
|
||||
final String token;
|
||||
UserTokenPair(this.user, this.token);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -29,4 +29,4 @@ abstract class TaskService {
|
|||
abstract class UserService {
|
||||
Future<UserTokenPair> login(String username, password);
|
||||
Future<User> get(int userId);
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue