YSBase.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. class YSBase extends StatefulWidget {
  4. final Widget yschild;
  5. final String ystitle;
  6. final Widget ysright;
  7. final Color yscolor;
  8. const YSBase({Key key, this.yschild,this.ystitle,this.ysright, this.yscolor}) : super(key: key);
  9. @override
  10. _YSBaseState createState() => _YSBaseState();
  11. }
  12. class _YSBaseState extends State<YSBase> {
  13. @override
  14. Widget build(BuildContext context) {
  15. return Scaffold(
  16. backgroundColor: widget.yscolor==null?Colors.white:widget.yscolor,
  17. appBar: CupertinoNavigationBar(
  18. backgroundColor: Colors.white,
  19. border: Border(bottom: BorderSide(color: Color(0xFFEEEEEE),width: 0.5)),
  20. leading: Container(
  21. height: 30,
  22. width: 20,
  23. margin: EdgeInsets.only(right: 35),
  24. child: CupertinoButton(
  25. padding: EdgeInsets.all(0),
  26. child: Icon(Icons.arrow_back_ios,size: 20,color: Color(0xFF000000),),
  27. onPressed: (){
  28. FocusScope.of(context).unfocus();
  29. Navigator.pop(context);
  30. },
  31. ),
  32. ),
  33. middle: Text(widget.ystitle,style: TextStyle(color: Color(0xFF000000),fontSize: 16,decoration: TextDecoration.none,fontWeight: FontWeight.w600),textAlign: TextAlign.center,),
  34. trailing: widget.ysright,
  35. ),
  36. body: SingleChildScrollView(
  37. child: widget.yschild,
  38. ),
  39. );
  40. }
  41. }