패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소Fliggy-Mobile/ftoast

ftoast

개발자가 유연하고 간결하며 아름다운 토스트를 만들 수 있도록 도와줍니다.

ftoast 프로젝트 이미지
스타
37
포크
8
최근 푸시(UTC)
2022. 6. 10.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

ftoast

Simple, beautiful Toast

Help developers create flexible, concise and beautiful Toast

Author:Newton(coorchice.cb@alibaba-inc.com)

English | 简体中文

Like it? Please cast your Star 🥰 !

✨ Features

  • Provide a convenient way to create Toast

  • Support primary information, secondary information, and customize their style

  • Support flexible icon view

  • Support to configure corner size and background color

  • Support queue display

  • Support custom Toast style

🛠 Guide

In FToast, developers can easily create a Toast with simple code.

FToast.toast(context, msg: "FToast");

⚙️ Parameters

Param Type Necessary Default desc
context BuildContext true null page environment
toast Widget false null custom toast view, will override the default view
msg String false null main title
msgStyle TextStyle false null main title text style
subMsg String false null Subtitle
subMsgStyle TextStyle false null Subtitle text style
subMsgSpace double false 12.0 Subtitle and main title spacing
corner double false 6.0 Corner
color Color false Colors.black54 Color
duration double false 1800 Impression duration
padding EdgeInsets false EdgeInsets.only(left: 16.0, right: 16.0, top: 16.0, bottom: 16.0) inner spacing
image Widget false null icon
imageDirection AxisDirection false AxisDirection.up position of icon relative to text
imageSpace double false 9.0 distance between icon and text

🔩 Basic

FToast.toast(
  context,

  /// 配置显示时长
  ///
  /// Configure display duration
  duration: 800,

  /// 配置 Msg
  ///
  /// set Msg
  msg: "I'm FToast: ${count++}",

  /// 配置 Msg 样式
  ///
  /// set Msg style
  msgStyle: TextStyle(color: Colors.white),
)

🔆 SubMsg

FToast.toast(
  context,
  msg: "This is Msg",

  /// 配置 subMsg
  ///
  /// set subMsg
  subMsg: "Welcome to use FToast. This is subMsg!",

  /// 配置 SubMsg 样式
  ///
  /// set SubMsg style
  subMsgStyle: TextStyle(color: Colors.white, fontSize: 13),
)

🔳 Image

FToast.toast(
  context,
  msg: "This is Msg",
  subMsg: "Welcome to use FToast. This is subMsg!",

  /// 配置图标
  ///
  /// set image
  image: Icon(
    Icons.star,
    color: Colors.yellow,
  ),

  /// 配置图标相对文本的位置
  ///
  /// set position of icon relative to text
  imageDirection: up,
)

🔩 Custom style

FToast.toast(
  context,
  /// 自定义 Toast 样式
  /// 
  /// Custom Toast style
  toast: FSuper(
    text: "Custom Toast",
    style: TextStyle(color: Colors.grey),
    padding: EdgeInsets.all(12),
    shadowColor: Colors.yellow,
    shadowBlur: 80,
  ),
)

😃 How to use?

Add dependencies in the project pubspec.yaml file:

🌐 pub dependency

dependencies:
  ftoast: ^<version number>

⚠️ Attention,please go to [pub] (https://pub.dev/packages/ftoast) to get the latest version number of FToast

🖥 Git dependency

dependencies:
  ftoast:
    git:
      url: 'git@github.com:Fliggy-Mobile/ftoast.git'
      ref: '<Branch number or tag number>'

⚠️ Attention,please refer to [FToast] (https://github.com/Fliggy-Mobile/ftoast) official project for branch number or tag.

💡 License

Copyright 2020-present Fliggy Android Team <alitrip_android@list.alibaba-inc.com>.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at following link.

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Like it? Please cast your Star 🥰 !

How to run Demo project?

  1. clone project to local

  2. Enter the project example directory and run the following command

flutter create .
  1. Run the demo in example
Fliggy Mobile GitHub avatar
GitHub 작성자

Fliggy Mobile ↗

We create legends

Beijing, China
언어DartShell

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개

  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗