Skip to content

Flutter operation tips.Flutter 长按弹出,操作提示.

License

Notifications You must be signed in to change notification settings

wuweijian1997/operation_tips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

operation_tips

Flutter operation tips.Flutter 长按弹出,操作提示.

Getting Started

dependencies:
  operation_tips: ^0.1.0

Example

simple.

OperationTips(
  onTap: () {
    onTap('Center');
  },
  title: "Title",
  child: Container(
    width: 100,
    height: 100,
    color: Colors.red,
    alignment: Alignment.center,
    child: Text("Center"),
  ),
),

Use OperationTipsController

class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin{
  OperationTipsController controller;

  @override
    void initState() {
      super.initState();
      controller = OperationTipsController(
        vsync: this,
        direction: TipsDirection.top,
        delegate: DefaultTipsBubbleDelegate(
          color: Colors.blue,
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: Text(
              "Hello world",
              style: TextStyle(color: Colors.white),
            ),
          ),
          onTap: () => onTap('Top'),
        ),
      );
  }

  build() {
    ...
    OperationTips(
          operationTipsController: controller,
          onTap: () {
            print("onTap");
          },
          child: Container(
            width: 100,
            height: 100,
            color: Colors.red,
            alignment: Alignment.center,
            child: Text(text),
          ),
        )
    ...
  }
}

demo.jpg

About

Flutter operation tips.Flutter 长按弹出,操作提示.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages