虎視眈々と

Flutter × Firebaseを研究するアプリエンジニア

FlutterでBottom Sheetを出す

下記の方法で行けた

  _showUserInfo(User user, BuildContext context) {
    showModalBottomSheet(
        context: context,
        builder: (_) {
          return Container(
            width: 300,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                ListTile(
                  title: const Text(
                    "Kyat app",
                    style: const TextStyle(fontWeight: FontWeight.bold),
                  ),
                  trailing: CupertinoButton(
                      onPressed: () {
                        Navigator.pop(context);
                      },
                      child: const Text("cancel")),
                ),
                Container(
                  width: 100,
                  height: 100,
                  child: CachedNetworkImage(
                    imageUrl: user.iconUrl,
                  ),
                ),
                const SizedBox(
                  height: 20,
                ),
                Center(child: Text(user.name)),
                Container(
                  margin: const EdgeInsets.all(10),
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[],
                  ),
                ),
              ],
            ),
          );
        });
  }