搜尋套件、儲存庫與 APP 分類

gradient_coloured_buttons 封面
套件詳情v0.1.0

gradient_coloured_buttons

建立視覺上吸引人的按鈕,支援自訂漸層顏色、尺寸與圓角半徑,以提升您的Flutter使用者介面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
29
喜歡數
87
Pub 分數
130

安裝套件

flutter pub add gradient_coloured_buttons

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,讓開發者能夠建立具有完全可自訂漸層顏色、尺寸與圓角的美觀按鈕。它透過提供順暢的色彩過渡與現代視覺吸引力,提升使用者介面,適用於多個平台。此套件易於整合,非常適合希望以動態按鈕設計脫穎而出的應用程式。支援所有主要的 Flutter 平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 透過鮮豔的按鈕增強應用介面
  • 建立互動式操作按鈕元素
  • 設計現代登入或註冊畫面
  • 改進表單中的視覺反饋
  • 為儀表板增添美學魅力
  • 無需額外程式碼即可自訂按鈕樣式

主要特色

  • 完全可自訂的漸變顏色
  • 可調整按鈕尺寸
  • 可設定的邊框圓角
  • 跨平台相容性
  • 透過 pub.dev 的簡單整合
  • 支援線性漸層與徑向漸層

適合對象

  • 尋求視覺精緻的UI設計師
  • 開發現代 Flutter 應用的開發者
  • 需要吸引人互動元素的應用程式
  • 專注於美學與品牌建設的專案
  • 希望快速自定按鈕樣式的團隊

使用建議

  • 可能需要額外的樣式以確保可存取性
  • 漸層在複雜佈局中的效能影響
  • 有限的內建動畫選項
  • 最佳搭配對比度高的文字以提升可讀性
  • 不適合極簡主義設計方法

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Gradient Button

A Flutter package that provides customizable buttons with gradient colors. Enhance your Flutter UI by easily creating buttons with smooth gradient backgrounds.

Features

  • Create buttons with gradient backgrounds using the GradientButton widget.
  • Customize button dimensions, border radius, and more.
  • Easy integration and usage within your Flutter projects.

Getting started

To use this package, add gradient_coloured_buttons as a dependency in your pubspec.yaml file:

dependencies:

gradient_coloured_buttons: ^0.0.7

Example

These are the properties that you can modify:

  • text

  • onPressed

  • gradientColors

  • width

  • height

  • borderRadius

  • textStyle

Usage

//HERE IS THE COMPLETE CODE ...

import 'package:flutter/material.dart';

//Import the package in your Dart file:

import 'package:gradient_coloured_buttons/gradient_coloured_buttons.dart';

void main() {
runApp(GradientButtons());
}

class GradientButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
  return MaterialApp(
    title: 'Gradient Coloured button',
    theme: ThemeData(
      primarySwatch: Colors.blue,
    ),
    home: GradientColouredButton(),
  );
}
}
class GradientColouredButton extends StatefulWidget {
const GradientColouredButton({Key? key}) : super(key: key);

@override
State<GradientColouredButton> createState() => _GradientColouredButtonState();
}

class _GradientColouredButtonState extends State<GradientColouredButton> {
@override
Widget build(BuildContext context) {
  return Scaffold(
    body:
    //      <---content STARTS here--->
    GradientButton(
            text: "Johnson Redonyx Silva",
            textStyle: const TextStyle(fontWeight: FontWeight.bold,fontSize: 15),
            gradientColors: const [Colors.red,Colors.black,Colors.brown],
            width: 200,
            height: 50,
            borderRadius: 30.0,
            onPressed: ()
            {
              print("GradientButton is Pressed");
            }
        ),
    //      <---content ENDS here--->
  );
}
}

Example Image

Example Image

Additional information

This package offers a straightforward solution to apply gradient colors to buttons, enabling you to enhance their visual appeal effortlessly and efficiently.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。