poem_publish.dart 4.28 KB
import 'package:flutter/material.dart';
import 'package:one_poem/res/resources.dart';
import 'package:one_poem/util/toast_utils.dart';
import 'package:one_poem/widgets/my_app_bar.dart';

class PoemPublish extends StatefulWidget {
  const PoemPublish({Key? key, required this.data}) : super(key: key);

  final String data;
  @override
  _PoemPublishState createState() => _PoemPublishState();
}

class _PoemPublishState extends State<PoemPublish> {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
        homeMenuHeader: Container(
          alignment: Alignment.center,
          width: double.infinity,
          child: const Text(
            "发布临境",
            style: TextStyle(
              color: Colors.white,
            ),
          ),
        ),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(
              10.0,
            ),
            child: ConstrainedBox(
              constraints: const BoxConstraints(
                maxHeight: 200,
                maxWidth: double.infinity,
              ),
              child: TextField(
                maxLines: 10,
                decoration: InputDecoration(
                  contentPadding: const EdgeInsets.all(10.0),
                  hintText: '读此一言,仿佛身临其境',
                  border: OutlineInputBorder(
                      borderRadius: BorderRadius.circular(5),
                      borderSide: BorderSide.none),
                  filled: true,
                  fillColor: Colors.grey.shade100,
                ),
              ),
            ),
          ),
          Container(
            padding: const EdgeInsets.all(10.0),
            alignment: Alignment.centerLeft,
            width: double.infinity,
            height: 36.0,
            child: Wrap(
              children: const [
                Icon(
                  Icons.room_outlined,
                  size: 15,
                ),
                Text(
                  "我在此地",
                  style: TextStyle(color: Colors.black45),
                ),
              ],
            ),
          ),
          Container(
            padding: const EdgeInsets.all(10.0),
            alignment: Alignment.centerLeft,
            width: double.infinity,
            height: 36.0,
            child: Wrap(
              children: const [
                Icon(
                  Icons.room_outlined,
                  size: 15,
                ),
                Text(
                  "所用口音",
                  style: TextStyle(color: Colors.black45),
                ),
                Gaps.hGap10,
                Text(
                  "普通话",
                  style: TextStyle(color: Colors.black45),
                ),
              ],
            ),
          ),
          Gaps.vGap24,
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  height: 36.0,
                  alignment: Alignment.center,
                  width: double.infinity,
                  child: const Text(
                    "发布临境,让更多人身临其境",
                    style: TextStyle(fontSize: 12.0),
                  ),
                ),
                Container(
                  height: 48.0,
                  alignment: Alignment.center,
                  width: double.infinity,
                  child: TextButton(
                    style: ButtonStyle(
                      side: MaterialStateProperty.all(
                        const BorderSide(color: Colors.black54, width: 1),
                      ),
                    ),
                    onPressed: () {
                      Toast.show("先不发布了吧。。。。");
                    },
                    child: const Text(
                      "发布",
                      style: TextStyle(color: Colors.black54, fontSize: 15.0),
                    ),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}