From 98a84a577b6e6353d7e53606e066a7763dfe148e Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 23 Sep 2022 20:18:11 +0800 Subject: [PATCH] install help card --- flutter/lib/common/widgets/peer_card.dart | 2 - .../lib/desktop/pages/desktop_home_page.dart | 48 +++++++++++++++---- flutter/lib/desktop/widgets/button.dart | 23 ++++++--- 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 279af791b..8a3300fd7 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -155,11 +155,9 @@ class _PeerCardState extends State<_PeerCard> decoration: BoxDecoration(color: Theme.of(context).backgroundColor), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: Column( - mainAxisAlignment: MainAxisAlignment.center, children: [ Row(children: [ getOnline(4, peer.online), diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 3aec884aa..16cd305a4 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -15,6 +15,8 @@ import 'package:provider/provider.dart'; import 'package:tray_manager/tray_manager.dart'; import 'package:window_manager/window_manager.dart'; +import '../widgets/button.dart'; + class DesktopHomePage extends StatefulWidget { const DesktopHomePage({Key? key}) : super(key: key); @@ -324,16 +326,42 @@ class _DesktopHomePageState extends State Widget buildInstallCard() { return Container( margin: EdgeInsets.only(top: 20), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - translate("install_tip"), - style: TextStyle(fontWeight: FontWeight.normal, fontSize: 19), - ), - ], - ), + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromARGB(255, 226, 66, 188), + Color.fromARGB(255, 244, 114, 124), + ], + )), + padding: EdgeInsets.all(20), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + translate("install_tip"), + style: TextStyle( + height: 1.5, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 13), + ).marginOnly(bottom: 20), + Row(mainAxisAlignment: MainAxisAlignment.center, children: [ + Button( + padding: 8, + isOutline: true, + text: 'Install', + textColor: Colors.white, + borderColor: Colors.white, + textSize: 20, + radius: 10, + onTap: () {}) + ]), + ], + )), ); } diff --git a/flutter/lib/desktop/widgets/button.dart b/flutter/lib/desktop/widgets/button.dart index 6fcf73836..b8f1bfe83 100644 --- a/flutter/lib/desktop/widgets/button.dart +++ b/flutter/lib/desktop/widgets/button.dart @@ -6,13 +6,23 @@ import '../../common.dart'; class Button extends StatefulWidget { GestureTapCallback onTap; String text; + double? textSize; double? minWidth; bool isOutline; + double? padding; + Color? textColor; + double? radius; + Color? borderColor; Button({ Key? key, this.minWidth, this.isOutline = false, + this.textSize, + this.padding, + this.textColor, + this.radius, + this.borderColor, required this.onTap, required this.text, }) : super(key: key); @@ -35,10 +45,10 @@ class _ButtonState extends State