import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/feedback_page/widgets/feedback_record_item.dart';

class FeedbackRecordPage extends StatefulWidget {
  @override
  _FeedbackRecordPageState createState() => _FeedbackRecordPageState();
}

class _FeedbackRecordPageState extends State<FeedbackRecordPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: _createNav(),
      body: GestureDetector(
        onTap: () {
          FocusScope.of(context).requestFocus(FocusNode());
        },
        child: SafeArea(
          child: ListView.builder(
              itemCount: 10,
              itemBuilder: (context, index) {
                return FeedbackRecordItem();
              }),
        ),
      ),
    );
  }

  // 导航栏
  Widget _createNav() {
    return CupertinoNavigationBar(
      border: Border(
        bottom: BorderSide(
          width: 0.0, // One physical pixel.
          style: BorderStyle.none,
        ),
      ),
      backgroundColor: Colors.white,
      leading: Navigator.canPop(context)
          ? GestureDetector(
              child: Container(
                padding: EdgeInsets.zero,
                child: Icon(
                  Icons.arrow_back_ios,
                  size: 20,
                ),
              ),
              onTap: () {
                if (Navigator.canPop(context)) {
                  Navigator.pop(context);
                }
              },
            )
          : Container(),
      middle: Text(
        '反馈列表',
        style: TextStyle(
          fontSize: 15,
          color: Color(0xff333333),
        ),
      ),
    );
  }
}
