美文网首页
Flutter Tooltip 轻量级点击提示

Flutter Tooltip 轻量级点击提示

作者: 叶秋_YQ | 来源:发表于2019-05-06 18:47 被阅读0次
点击

入口文件

import 'package:flutter/material.dart';
import 'tool_tips_demo.dart';
main(){
  runApp(MyApp());
}
class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue
      ),
      home: ToolTipDemo()
    );
  }
}

方法文件

import 'package:flutter/material.dart';
class ToolTipDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('轻量级提示'),),
      body: Center(
        child: Tooltip(
          // 长按显示的内容
          message: '点鸡',
          child: Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557744149&di=f68af941c41b28a7fd7484165f9c77c4&imgtype=jpg&er=1&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201512%2F12%2F20151212193107_ujGZV.jpeg'),
        ),
      ),
    );
  }
}

相关文章

网友评论

      本文标题:Flutter Tooltip 轻量级点击提示

      本文链接:https://www.haomeiwen.com/subject/ipgdoqtx.html