自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

聊聊 Flutter 2021 中的按鈕

開發(fā) 前端
在本文中,我們將介紹令人驚嘆的 Flutter 按鈕,它們可以幫助所有初學者或?qū)I(yè)人士為現(xiàn)代應用程序設計漂亮的 UI。

[[432217]]

在本文中,我們將介紹令人驚嘆的 Flutter 按鈕,它們可以幫助所有初學者或?qū)I(yè)人士為現(xiàn)代應用程序設計漂亮的 UI。

首先讓我告訴你關于 Flutter 中按鈕的一件重要事情,在flutter最新版本中以下Buttons在fluter中被廢棄了:

廢棄的 推薦的替代
RaisedButton ElevatedButton
OutlineButton OutlinedButton
FlatButton TextButton

那么讓我們來探索一下 Flutter 中的按鈕。

Elevated Button

StadiumBorder

  1. ElevatedButton( 
  2.   onPressed: (){}, 
  3.   child: Text('Button'), 
  4.   style: ElevatedButton.styleFrom( 
  5.   shadowColor: Colors.green, 
  6.   shape: StadiumBorder(), 
  7.   padding: EdgeInsets.symmetric(horizontal: 35,vertical: 20)), 

RoundedRectangleBorder

  1. ElevatedButton( 
  2.   onPressed: (){}, 
  3.   child: Text('Button'), 
  4.   style: ElevatedButton.styleFrom( 
  5.   shadowColor: Colors.green, 
  6.   shape: RoundedRectangleBorder( 
  7.   borderRadius: BorderRadius.circular(12), 
  8.       ), 
  9.    ), 
  10. ), 

CircleBorder

  1. ElevatedButton( 
  2.   onPressed: () {}, 
  3.   child: Text('Button'), 
  4.   style: ElevatedButton.styleFrom( 
  5.     shape: CircleBorder(), 
  6.     padding: EdgeInsets.all(24), 
  7.   ), 

BeveledRectangleBorder

  1. ElevatedButton( 
  2.   onPressed: () {}, 
  3.   child: Text('Button'), 
  4.   style: ElevatedButton.styleFrom( 
  5.     shape: BeveledRectangleBorder( 
  6.       borderRadius: BorderRadius.circular(12) 
  7.     ), 
  8.   ), 

Outlined Button

StadiumBorder

  1. OutlinedButton( 
  2.   onPressed: () {}, 
  3.   child: Text('Button'), 
  4.   style: OutlinedButton.styleFrom( 
  5.     shape: StadiumBorder(), 
  6.   ), 

RoundedRectangleBorder

  1. OutlinedButton( 
  2.   onPressed: () {}, 
  3.   child: Text('Button'), 
  4.   style: OutlinedButton.styleFrom( 
  5.     shape: BeveledRectangleBorder( 
  6.       borderRadius: BorderRadius.circular(12), 
  7.     ), 
  8.   ), 

CircleBorder

  1. OutlinedButton( 
  2.   onPressed: () {}, 
  3.   child: Text('Button'), 
  4.   style: OutlinedButton.styleFrom( 
  5.     shape: CircleBorder(), 
  6.     padding: EdgeInsets.all(24), 
  7.   ), 

BeveledRectangleBorder

  1. OutlinedButton( 
  2.   onPressed: () {}, 
  3.   child: Text('Button'), 
  4.   style: OutlinedButton.styleFrom( 
  5.     shape: BeveledRectangleBorder( 
  6.       borderRadius: BorderRadius.circular(12), 
  7.     ), 
  8.   ), 

原文:https://medium.com/@waseemakram.jpb/button-cheat-sheet-in-flutter-2021-1db38501d5f2

 

責任編輯:武曉燕 來源: 前端全棧開發(fā)者
相關推薦

2022-02-21 07:02:16

CSSbeautiful按鈕

2023-07-05 08:15:41

按鈕PRSHT.H函數(shù)

2023-01-04 07:46:10

單選按鈕雙擊效果

2021-11-17 08:11:35

MySQL

2023-11-09 11:56:28

MySQL死鎖

2021-08-31 07:54:24

SQLDblink查詢

2024-04-26 00:00:00

Rust檢查器代碼

2021-06-08 13:29:56

FlutterReact Nativ開發(fā)

2021-03-08 00:11:02

Spring注解開發(fā)

2023-07-28 09:54:14

SQL數(shù)據(jù)Excel

2022-05-11 09:01:54

Swift類型系統(tǒng)幻象類型

2024-04-15 00:00:00

RabbitMQ死信隊列消息

2022-07-04 08:54:39

Swift處理器項目

2021-09-03 06:46:34

SQL分組集功能

2022-08-03 08:11:58

數(shù)據(jù)測試同類型

2021-08-16 08:12:04

SQLMerge用法

2022-04-02 08:14:02

JavaThreadLoca數(shù)據(jù)

2023-08-29 09:46:12

SQLCTE遞歸

2021-11-09 06:55:03

SQLServer排序

2021-08-16 06:56:21

Slice數(shù)組類型內(nèi)存
點贊
收藏

51CTO技術棧公眾號