Reformatted code
This commit is contained in:
parent
80d55a3518
commit
03fda04afa
|
@ -3,12 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:crypto/crypto.dart';
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
class GravatarImageProvider extends NetworkImage {
|
class GravatarImageProvider extends NetworkImage {
|
||||||
GravatarImageProvider(String email) : super(
|
GravatarImageProvider(String email)
|
||||||
"https://secure.gravatar.com/avatar/" + md5.convert(
|
: super("https://secure.gravatar.com/avatar/" +
|
||||||
email
|
md5.convert(email.trim().toLowerCase().codeUnits).toString());
|
||||||
.trim()
|
|
||||||
.toLowerCase()
|
|
||||||
.codeUnits
|
|
||||||
).toString()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,8 @@ class VikunjaGlobal extends StatefulWidget {
|
||||||
VikunjaGlobalState createState() => VikunjaGlobalState();
|
VikunjaGlobalState createState() => VikunjaGlobalState();
|
||||||
|
|
||||||
static VikunjaGlobalState of(BuildContext context) {
|
static VikunjaGlobalState of(BuildContext context) {
|
||||||
var widget = context.inheritFromWidgetOfExactType(_VikunjaGlobalInherited) as _VikunjaGlobalInherited;
|
var widget = context.inheritFromWidgetOfExactType(_VikunjaGlobalInherited)
|
||||||
|
as _VikunjaGlobalInherited;
|
||||||
return widget.data;
|
return widget.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +94,8 @@ class _VikunjaGlobalInherited extends InheritedWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool updateShouldNotify(_VikunjaGlobalInherited oldWidget) {
|
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;
|
data.client != oldWidget.data.client;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,4 @@ class VikunjaApp extends StatelessWidget {
|
||||||
home: VikunjaGlobal(child: new HomePage(), login: new LoginPage()),
|
home: VikunjaGlobal(child: new HomePage(), login: new LoginPage()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,4 @@ class UserTokenPair {
|
||||||
final User user;
|
final User user;
|
||||||
final String token;
|
final String token;
|
||||||
UserTokenPair(this.user, this.token);
|
UserTokenPair(this.user, this.token);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,9 +87,10 @@ class HomePageState extends State<HomePage> {
|
||||||
new UserAccountsDrawerHeader(
|
new UserAccountsDrawerHeader(
|
||||||
accountEmail: currentUser == null ? null : Text(currentUser.email),
|
accountEmail: currentUser == null ? null : Text(currentUser.email),
|
||||||
accountName: currentUser == null ? null : Text(currentUser.username),
|
accountName: currentUser == null ? null : Text(currentUser.username),
|
||||||
currentAccountPicture: currentUser == null ? null : CircleAvatar(
|
currentAccountPicture: currentUser == null
|
||||||
backgroundImage: GravatarImageProvider(currentUser.username)
|
? null
|
||||||
),
|
: CircleAvatar(
|
||||||
|
backgroundImage: GravatarImageProvider(currentUser.username)),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/graphics/hypnotize.png"),
|
image: AssetImage("assets/graphics/hypnotize.png"),
|
||||||
|
|
|
@ -29,4 +29,4 @@ abstract class TaskService {
|
||||||
abstract class UserService {
|
abstract class UserService {
|
||||||
Future<UserTokenPair> login(String username, password);
|
Future<UserTokenPair> login(String username, password);
|
||||||
Future<User> get(int userId);
|
Future<User> get(int userId);
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user