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

crossword 封面
套件詳情v1.3.2

crossword

一個 Flutter 套件,為您的應用程式提供解決填字遊戲的使用者介面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
295
喜歡數
36
Pub 分數
150

安裝套件

flutter pub add crossword

套件介紹

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

該拼字遊戲套件是一個Flutter程式庫,可讓開發者將互動式拼字遊戲解決功能整合到其應用程式中。它提供可自訂的UI,用於顯示和互動拼字格子,支援橫向與縱向提示。專為遊戲和教育類應用設計,允許使用者直接在格子中輸入答案,並提供即時驗證與反饋。此套件可在所有主要平台相容,包括行動裝置、網頁與桌面,非常適合跨平台拼字遊戲體驗。

適用情境

  • 將填字遊戲融入教育類應用程式
  • 在遊戲應用中添加拼圖挑戰
  • 為網頁和行動裝置創建互動單字遊戲
  • 透過填字遊戲支援語言學習
  • 啟用使用者產生的拼圖內容

主要特色

  • 具備觸控輸入的互動式填字遊戲格子
  • 即時線索導航與高亮
  • 可自訂的拼圖佈局和樣式
  • 跨平台相容性(Android、iOS、Web、macOS、Windows、Linux)
  • 內建的答案驗證與回饋
  • 支援動態拼圖載入

適合對象

  • 教育類應用開發者
  • 尋求謎題機制的遊戲開發者
  • 語言學習應用開發者
  • 跨平台應用建構工具
  • 尋求原生類似拼圖介面的 Flutter 使用者

使用建議

  • 需要結構化的謎題資料(例如,網格和提示)
  • 可能需要額外的邏輯來處理線索提示或得分
  • 性能可能因超大謎題而有所不同
  • 有限的內建拼圖創建工具
  • 依賴外部資料來源取得謎題內容

原始 README

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

NEW: LetterPop Animation

Crossword pub package


GitHub commit activity GitHub contributors GitHub Repo stars GitHub Pub Version Pub Likes Pub Points Pub Popularity


Crossword is a comprehensive solution for seamlessly integrating a crossword puzzle-solving user interface into your Flutter app. With this package, you can effortlessly provide users with an interactive and enjoyable crossword puzzle-solving experience within your application.

Features

  • Customizable Crossword Widget: The package offers a customizable crossword widget that can be easily integrated into any Flutter app. You can adjust the widget's appearance, size, and layout to match your app's design and theme.

  • User-Friendly Interface: The user interface is designed with simplicity and ease of use in mind. Users can intuitively navigate through the puzzle, pan, and select the letters to choose words.

  • Clue Management: Manage crossword clues effortlessly with this package by passing the list of words into the Crossword widget.

Getting started

Installation

You just need to add crossword as a dependency in your pubspec.yaml file.

dependencies:
  crossword: ^1.3.2

Import the package in your Dart code and instantiate the Crossword widget.

Example

To get started add the Crossword widget.

  • letters : takes all the letters as a two-dimentional List
  • spacing : controls the horizontal and vertical spacing in between letters the Crossword panel
  • hints : takes a List of words as clues
Crossword(
   letters: const [
       ["F", "L", "U", "T", "T", "E", "R", "W", "U", "D", "B", "C"],
       ["R", "M", "I", "O", "P", "U", "I", "Q", "R", "L", "E", "G"],
       ["T", "V", "D", "I", "R", "I", "M", "U", "A", "H", "E", "A"],
       ["D", "A", "R", "T", "N", "S", "T", "O", "Y", "J", "R", "M"],
       ["O", "G", "A", "M", "E", "S", "C", "O", "L", "O", "R", "O"],
       ["S", "R", "T", "I", "I", "I", "F", "X", "S", "P", "E", "D"],
       ["Y", "S", "N", "E", "T", "M", "M", "C", "E", "A", "T", "S"],
       ["W", "E", "T", "P", "A", "T", "D", "Y", "L", "M", "N", "U"],
       ["O", "T", "E", "H", "R", "O", "G", "P", "T", "U", "O", "E"],
       ["K", "R", "R", "C", "G", "A", "M", "E", "S", "S", "T", "S"],
       ["S", "E", "S", "T", "L", "A", "O", "P", "U", "P", "E", "S"]
   ],
   spacing: const Offset(30, 30),
   onLineDrawn: (List<String> words) {},
   textStyle: const TextStyle(
   color: Colors.black, fontSize: 16, fontWeight: FontWeight.bold),
   lineDecoration: const LineDecoration(
      lineGradientColors: [
         [Colors.blue, Colors.black, Colors.red],
         [Colors.orange, Colors.black],
      ],
      strokeWidth: 26,
      lineTextStyle: TextStyle(
        color: Colors.white, fontSize: 16, 
        fontWeight: FontWeight.bold),
      ),
    hints: const ["FLUTTER", "GAMES", "UI", "COLORS"],
)

Additional parameters

  • initialLineList: Accepts a List of LineOffset to add initial lines to the crossword -- A LineOffset is a class that takes the start and end positions of the line
  • acceptReversedDirection: accepts a bool to identify while creating the words by touching in the reversed direction, is enabled or not
  • drawCrossLine: accepts a bool, and identifies if the user can interact in the Cross direction or not.
  • drawVerticalLine: accepts a bool, and identifies if the user can interact in the Vertical direction or not.
  • drawHorizontalLine: accepts a bool, and identifies if the user can interact in the Horizontal direction or not.

drawCrossLine, drawVerticalLine, drawHorizontalLine can't be set as false altogether.

  • lineDecoration: Decorate lines to update colors based on the input and clues
  • textStyle: Add styles to the crossword letters
  • transposeMatrix: Transpose the 2x2 matrix
  • alowOverlap: Accepts a bool to identify if the user can overlap the words or not
  • addIncorrectWord: Accepts a bool to identify if the user can draw incorrect lines or not

Line Decoration - parameters

  • lineGradientColors: Accepts a List of List of Colors to update the gradient colors of the lines.
  • incorrectGradientColors: Accepts a List of Colors to update the gradient colors of the lines when the user draws an incorrect line.
  • correctGradientColors: Accepts a List of Colors to update the gradient colors of the lines when the user draws a correct line.
  • strokeWidth: Accepts a double to update the width of the lines.
  • strokeCap: Accepts a StrokeCap to update the stroke cap of the lines.
  • lineTextStyle: Accepts a TextStyle to update the style of the words which are drawn by the user.

Reveal Letter Animation

  • Use a Global Key to access the Crossword widget and call the animate method to animate the letter decoration.
final GlobalKey<CrosswordState> _crosswordState = GlobalKey();
  • Pass the GlobalKey to the Crossword widget
 Crossword(key: _crosswordState);
  • Access the Crossword widget using the global key and call the animate method to animate the letter
//offset is the position of the letter in the crossword
 crosswordState.currentState!.animate(offset: const Offset(7, 3));
  • revealLetterDecoration: Accepts a RevealLetterDecoration to animate the decoration of the letters

  • 'letterPopDecoration': Accepts a LetterPopDecoration to animate the decoration of the specific letter onTouchEvent

Contributions

Contributions are welcome! If you find a bug or want to add a feature, please file an issue

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。