mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-11 12:43:12 +08:00
fix loadLogo
This commit is contained in:
parent
48842b6f2a
commit
fb12ee7f2a
@ -3089,24 +3089,25 @@ Color? disabledTextColor(BuildContext context, bool enabled) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// max 300 x 60
|
// max 300 x 60
|
||||||
Widget? loadLogo() {
|
Widget loadLogo() {
|
||||||
bool isFound = true;
|
return FutureBuilder<ByteData>(
|
||||||
final image = Image.asset(
|
future: rootBundle.load('assets/logo.png'),
|
||||||
'assets/logo.png',
|
builder: (BuildContext context, AsyncSnapshot<ByteData> snapshot) {
|
||||||
fit: BoxFit.contain,
|
if (snapshot.hasData) {
|
||||||
errorBuilder: (ctx, error, stackTrace) {
|
final image = Image.asset(
|
||||||
isFound = false;
|
'assets/logo.png',
|
||||||
return Container();
|
fit: BoxFit.contain,
|
||||||
},
|
errorBuilder: (ctx, error, stackTrace) {
|
||||||
);
|
return Container();
|
||||||
if (isFound) {
|
},
|
||||||
return Container(
|
);
|
||||||
constraints: BoxConstraints(maxWidth: 300, maxHeight: 60),
|
return Container(
|
||||||
child: image,
|
constraints: BoxConstraints(maxWidth: 300, maxHeight: 60),
|
||||||
).marginOnly(left: 12, right: 12, top: 12);
|
child: image,
|
||||||
} else {
|
).marginOnly(left: 12, right: 12, top: 12);
|
||||||
return null;
|
}
|
||||||
}
|
return const Offstage();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget loadIcon(double size) {
|
Widget loadIcon(double size) {
|
||||||
|
@ -110,7 +110,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
Widget buildLeftPane(BuildContext context) {
|
Widget buildLeftPane(BuildContext context) {
|
||||||
final isIncomingOnly = bind.isIncomingOnly();
|
final isIncomingOnly = bind.isIncomingOnly();
|
||||||
final isOutgoingOnly = bind.isOutgoingOnly();
|
final isOutgoingOnly = bind.isOutgoingOnly();
|
||||||
final logo = loadLogo();
|
|
||||||
final children = <Widget>[
|
final children = <Widget>[
|
||||||
if (!isOutgoingOnly) buildPresetPasswordWarning(),
|
if (!isOutgoingOnly) buildPresetPasswordWarning(),
|
||||||
if (bind.isCustomClient())
|
if (bind.isCustomClient())
|
||||||
@ -133,12 +132,11 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
),
|
),
|
||||||
).marginOnly(top: 6),
|
).marginOnly(top: 6),
|
||||||
),
|
),
|
||||||
if (logo != null)
|
Align(
|
||||||
Align(
|
alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
child: loadLogo(),
|
||||||
child: logo.marginOnly(bottom: 0.0),
|
),
|
||||||
),
|
buildTip(context),
|
||||||
buildTip(context, logo),
|
|
||||||
if (!isOutgoingOnly) buildIDBoard(context),
|
if (!isOutgoingOnly) buildIDBoard(context),
|
||||||
if (!isOutgoingOnly) buildPasswordBoard(context),
|
if (!isOutgoingOnly) buildPasswordBoard(context),
|
||||||
FutureBuilder<Widget>(
|
FutureBuilder<Widget>(
|
||||||
@ -413,7 +411,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTip(BuildContext context, Widget? logo) {
|
buildTip(BuildContext context) {
|
||||||
final isOutgoingOnly = bind.isOutgoingOnly();
|
final isOutgoingOnly = bind.isOutgoingOnly();
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding:
|
||||||
|
Loading…
Reference in New Issue
Block a user