Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

杨树贤 / kefu_server

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
BlameHistoryPermalink
Switch branch/tag
  • kefu_server
  • ui
  • kefu_flutter
  • lib
  • widgets
  • emoji_panel.dart
  • chenxianqi's avatar
    update kefu_client style · f8f7c88e
    chenxianqi committed 5 years ago
    f8f7c88e
emoji_panel.dart 1.02 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import 'dart:io';
import 'package:flutter/material.dart';
import 'emojis.dart';

typedef EmoJiPanelCallback(String emoji);

class EmoJiPanel extends StatelessWidget {
  EmoJiPanel({this.isShow = false, this.onSelected});
  final bool isShow;
  final EmoJiPanelCallback onSelected;
  @override
  Widget build(BuildContext context) {
    return Offstage(
      offstage: !isShow,
      child: Container(
        width: double.infinity,
        height: 250.0,
        color: Colors.white,
        child: GridView.builder(
            itemCount: emojis.length,
            padding: EdgeInsets.all(6.0),
            gridDelegate:
                SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 11),
            itemBuilder: (ctx, index) {
              return InkWell(
                onTap: () => onSelected(emojis[index]),
                child: Text(
                  "${emojis[index]}",
                  style: TextStyle(fontSize: Platform.isAndroid ? 25 : 30),
                ),
              );
            }),
      ),
    );
  }
}