fix loadLogo
This commit is contained in:
@@ -3089,24 +3089,25 @@ Color? disabledTextColor(BuildContext context, bool enabled) {
|
||||
}
|
||||
|
||||
// max 300 x 60
|
||||
Widget? loadLogo() {
|
||||
bool isFound = true;
|
||||
final image = Image.asset(
|
||||
'assets/logo.png',
|
||||
fit: BoxFit.contain,
|
||||
errorBuilder: (ctx, error, stackTrace) {
|
||||
isFound = false;
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
if (isFound) {
|
||||
return Container(
|
||||
constraints: BoxConstraints(maxWidth: 300, maxHeight: 60),
|
||||
child: image,
|
||||
).marginOnly(left: 12, right: 12, top: 12);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
Widget loadLogo() {
|
||||
return FutureBuilder<ByteData>(
|
||||
future: rootBundle.load('assets/logo.png'),
|
||||
builder: (BuildContext context, AsyncSnapshot<ByteData> snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
final image = Image.asset(
|
||||
'assets/logo.png',
|
||||
fit: BoxFit.contain,
|
||||
errorBuilder: (ctx, error, stackTrace) {
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
return Container(
|
||||
constraints: BoxConstraints(maxWidth: 300, maxHeight: 60),
|
||||
child: image,
|
||||
).marginOnly(left: 12, right: 12, top: 12);
|
||||
}
|
||||
return const Offstage();
|
||||
});
|
||||
}
|
||||
|
||||
Widget loadIcon(double size) {
|
||||
|
||||
Reference in New Issue
Block a user