123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- import 'package:flutter/material.dart';
- import 'package:sport/bean/feed_back.dart';
- import 'package:sport/pages/my/feedback_detail_page.dart';
- import 'package:sport/router/navigator_util.dart';
- import 'package:sport/services/api/inject_api.dart';
- import 'package:sport/widgets/appbar.dart';
- import 'package:sport/widgets/image.dart';
- import 'package:sport/widgets/list_tile.dart';
- import 'package:sport/widgets/loading.dart';
- class FeedbackPage extends StatefulWidget {
- @override
- State<StatefulWidget> createState() => _PageState();
- }
- class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
- @override
- void initState() {
- super.initState();
- }
- @override
- void dispose() {
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- const contentPadding = EdgeInsets.symmetric(horizontal: 0.0);
- return Scaffold(
- backgroundColor: Colors.white,
- body: CustomScrollView(
- slivers: <Widget>[
- buildSliverAppBar(context, "用户反馈"),
- SliverPadding(
- padding: const EdgeInsets.symmetric(horizontal: 12),
- sliver: SliverToBoxAdapter(
- child: FutureBuilder<FeedTypeInfo?>(
- future: loginApi.getFeedBackTypes(),
- builder: (BuildContext context,
- AsyncSnapshot<FeedTypeInfo?> snapshot) {
- List<FeedTypeInfoData> list = snapshot.data?.data ?? [];
- if(list.isEmpty){
- return Center(child: RequestLoadingWidget(),);
- }
- return ListView(
- padding: EdgeInsets.zero,
- physics: NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- children: divideTiles(
- context: context,
- includeLast: true,
- tiles: list
- .map((e) => ListTile(
- title: Text(
- '${e.groupName}',
- style: TextStyle(fontSize: 16.0),
- ),
- trailing: arrowRight5(),
- contentPadding: contentPadding,
- onTap: () => NavigatorUtil.goPage(context,
- (context) => FeedbackDetailPage(e)),
- ))
- .toList(),
- ).toList(),
- );
- },
- ),
- ),
- ),
- ],
- ));
- }
- }
- class BubblePainter extends CustomPainter {
- final circular = Radius.circular(10);
- final Paint _paint = Paint()
- ..color = Colors.white
- ..strokeJoin = StrokeJoin.round;
- final double _bubbleWidth = 6;
- @override
- void paint(Canvas canvas, Size size) {
- // Path path = Path()..moveTo(size.width, size.height / 2)..quadraticBezierTo(size.width / 3*2, size.height / 2 + 50, 0, size.height / 2)
- // ..quadraticBezierTo(size.width / 3, size.height,size.width,size.height)..close();
- Path path = Path()
- ..moveTo(_bubbleWidth + 1, 10)
- ..lineTo(0, 15)
- ..lineTo(0, 16)
- ..lineTo(_bubbleWidth + 1, 21)
- ..close();
- canvas.drawPath(path, _paint);
- canvas.drawRRect(
- RRect.fromLTRBR(_bubbleWidth, 0, size.width, size.height, circular),
- _paint);
- }
- @override
- bool shouldRepaint(CustomPainter oldDelegate) {
- return oldDelegate != this;
- }
- }
- class BubblePainterRight extends CustomPainter {
- final circular = Radius.circular(10);
- final Paint _paint = Paint()
- ..color = Color(0xffffe400).withOpacity(0.7)
- ..strokeJoin = StrokeJoin.round;
- final double _bubbleWidth = 6;
- @override
- void paint(Canvas canvas, Size size) {
- // Path path = Path()..moveTo(size.width, size.height / 2)..quadraticBezierTo(size.width / 3*2, size.height / 2 + 50, 0, size.height / 2)
- // ..quadraticBezierTo(size.width / 3, size.height,size.width,size.height)..close();
- double left = size.width - _bubbleWidth - 1;
- Path path = Path()
- ..moveTo(left, 10)
- ..lineTo(size.width, 15)
- ..lineTo(size.width, 16)
- ..lineTo(left, 21)
- ..close();
- canvas.drawPath(path, _paint);
- canvas.drawRRect(
- RRect.fromLTRBR(0, 0, size.width - _bubbleWidth, size.height, circular),
- _paint);
- }
- @override
- bool shouldRepaint(CustomPainter oldDelegate) {
- return oldDelegate != this;
- }
- }
|