install help card
This commit is contained in:
		
							parent
							
								
									1a38588ebd
								
							
						
					
					
						commit
						98a84a577b
					
				| @ -155,11 +155,9 @@ class _PeerCardState extends State<_PeerCard> | |||||||
|                 decoration: |                 decoration: | ||||||
|                     BoxDecoration(color: Theme.of(context).backgroundColor), |                     BoxDecoration(color: Theme.of(context).backgroundColor), | ||||||
|                 child: Row( |                 child: Row( | ||||||
|                   mainAxisAlignment: MainAxisAlignment.spaceBetween, |  | ||||||
|                   children: [ |                   children: [ | ||||||
|                     Expanded( |                     Expanded( | ||||||
|                       child: Column( |                       child: Column( | ||||||
|                         mainAxisAlignment: MainAxisAlignment.center, |  | ||||||
|                         children: [ |                         children: [ | ||||||
|                           Row(children: [ |                           Row(children: [ | ||||||
|                             getOnline(4, peer.online), |                             getOnline(4, peer.online), | ||||||
|  | |||||||
| @ -15,6 +15,8 @@ import 'package:provider/provider.dart'; | |||||||
| import 'package:tray_manager/tray_manager.dart'; | import 'package:tray_manager/tray_manager.dart'; | ||||||
| import 'package:window_manager/window_manager.dart'; | import 'package:window_manager/window_manager.dart'; | ||||||
| 
 | 
 | ||||||
|  | import '../widgets/button.dart'; | ||||||
|  | 
 | ||||||
| class DesktopHomePage extends StatefulWidget { | class DesktopHomePage extends StatefulWidget { | ||||||
|   const DesktopHomePage({Key? key}) : super(key: key); |   const DesktopHomePage({Key? key}) : super(key: key); | ||||||
| 
 | 
 | ||||||
| @ -324,16 +326,42 @@ class _DesktopHomePageState extends State<DesktopHomePage> | |||||||
|   Widget buildInstallCard() { |   Widget buildInstallCard() { | ||||||
|     return Container( |     return Container( | ||||||
|       margin: EdgeInsets.only(top: 20), |       margin: EdgeInsets.only(top: 20), | ||||||
|  |       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( |           child: Column( | ||||||
|             mainAxisAlignment: MainAxisAlignment.start, |             mainAxisAlignment: MainAxisAlignment.start, | ||||||
|             crossAxisAlignment: CrossAxisAlignment.start, |             crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|             children: [ |             children: [ | ||||||
|               Text( |               Text( | ||||||
|                 translate("install_tip"), |                 translate("install_tip"), | ||||||
|             style: TextStyle(fontWeight: FontWeight.normal, fontSize: 19), |                 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: () {}) | ||||||
|  |               ]), | ||||||
|             ], |             ], | ||||||
|       ), |           )), | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -6,13 +6,23 @@ import '../../common.dart'; | |||||||
| class Button extends StatefulWidget { | class Button extends StatefulWidget { | ||||||
|   GestureTapCallback onTap; |   GestureTapCallback onTap; | ||||||
|   String text; |   String text; | ||||||
|  |   double? textSize; | ||||||
|   double? minWidth; |   double? minWidth; | ||||||
|   bool isOutline; |   bool isOutline; | ||||||
|  |   double? padding; | ||||||
|  |   Color? textColor; | ||||||
|  |   double? radius; | ||||||
|  |   Color? borderColor; | ||||||
| 
 | 
 | ||||||
|   Button({ |   Button({ | ||||||
|     Key? key, |     Key? key, | ||||||
|     this.minWidth, |     this.minWidth, | ||||||
|     this.isOutline = false, |     this.isOutline = false, | ||||||
|  |     this.textSize, | ||||||
|  |     this.padding, | ||||||
|  |     this.textColor, | ||||||
|  |     this.radius, | ||||||
|  |     this.borderColor, | ||||||
|     required this.onTap, |     required this.onTap, | ||||||
|     required this.text, |     required this.text, | ||||||
|   }) : super(key: key); |   }) : super(key: key); | ||||||
| @ -35,10 +45,10 @@ class _ButtonState extends State<Button> { | |||||||
|           onTap: widget.onTap, |           onTap: widget.onTap, | ||||||
|           child: ConstrainedBox( |           child: ConstrainedBox( | ||||||
|               constraints: BoxConstraints( |               constraints: BoxConstraints( | ||||||
|                 minWidth: widget.minWidth ?? 80.0, |                 minWidth: widget.minWidth ?? 70.0, | ||||||
|               ), |               ), | ||||||
|               child: Container( |               child: Container( | ||||||
|                 height: 27, |                 padding: EdgeInsets.all(widget.padding ?? 4.5), | ||||||
|                 alignment: Alignment.center, |                 alignment: Alignment.center, | ||||||
|                 decoration: BoxDecoration( |                 decoration: BoxDecoration( | ||||||
|                   color: pressed.value |                   color: pressed.value | ||||||
| @ -52,20 +62,21 @@ class _ButtonState extends State<Button> { | |||||||
|                         : hover.value |                         : hover.value | ||||||
|                             ? MyTheme.hoverBorder |                             ? MyTheme.hoverBorder | ||||||
|                             : (widget.isOutline |                             : (widget.isOutline | ||||||
|                                 ? MyTheme.border |                                 ? widget.borderColor ?? MyTheme.border | ||||||
|                                 : MyTheme.button), |                                 : MyTheme.button), | ||||||
|                   ), |                   ), | ||||||
|                   borderRadius: BorderRadius.circular(5), |                   borderRadius: BorderRadius.circular(widget.radius ?? 5), | ||||||
|                 ), |                 ), | ||||||
|                 child: Text( |                 child: Text( | ||||||
|                   translate( |                   translate( | ||||||
|                     widget.text, |                     widget.text, | ||||||
|                   ), |                   ), | ||||||
|                   style: TextStyle( |                   style: TextStyle( | ||||||
|                       fontSize: 12, |                       fontSize: widget.textSize ?? 12.0, | ||||||
|                       color: pressed.value || !widget.isOutline |                       color: pressed.value || !widget.isOutline | ||||||
|                           ? Theme.of(context).backgroundColor |                           ? Theme.of(context).backgroundColor | ||||||
|                           : Theme.of(context).textTheme.titleLarge?.color), |                           : widget.textColor ?? | ||||||
|  |                               Theme.of(context).textTheme.titleLarge?.color), | ||||||
|                 ).marginSymmetric(horizontal: 12), |                 ).marginSymmetric(horizontal: 12), | ||||||
|               )), |               )), | ||||||
|         )); |         )); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user