|
@@ -40,13 +40,17 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
FocusNode _focusNode;
|
|
FocusNode _focusNode;
|
|
var _posting = false;
|
|
var _posting = false;
|
|
int joinTime = 0;
|
|
int joinTime = 0;
|
|
|
|
+ ValueNotifier<bool> _postable = ValueNotifier(false);
|
|
|
|
|
|
@override
|
|
@override
|
|
void initState() {
|
|
void initState() {
|
|
initData();
|
|
initData();
|
|
|
|
|
|
_focusNode = FocusNode();
|
|
_focusNode = FocusNode();
|
|
- _controller = TextEditingController();
|
|
|
|
|
|
+ _controller = TextEditingController()
|
|
|
|
+ ..addListener(() {
|
|
|
|
+ _postable.value = _controller.value.text.isNotEmpty;
|
|
|
|
+ });
|
|
|
|
|
|
_isLoading = true;
|
|
_isLoading = true;
|
|
super.initState();
|
|
super.initState();
|
|
@@ -85,7 +89,10 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
list.insert(index, FeedBackInfoData(from: "-1", createTime: now));
|
|
list.insert(index, FeedBackInfoData(from: "-1", createTime: now));
|
|
list.insert(index, FeedBackInfoData(from: "-2", createTime: now));
|
|
list.insert(index, FeedBackInfoData(from: "-2", createTime: now));
|
|
} else {
|
|
} else {
|
|
- list = [FeedBackInfoData(from: "-1", createTime: now), FeedBackInfoData(from: "-2", createTime: now)];
|
|
|
|
|
|
+ list = [
|
|
|
|
+ FeedBackInfoData(from: "-1", createTime: now),
|
|
|
|
+ FeedBackInfoData(from: "-2", createTime: now)
|
|
|
|
+ ];
|
|
joinTime = now;
|
|
joinTime = now;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -96,7 +103,8 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
if (t == 0) {
|
|
if (t == 0) {
|
|
t = e.createTime;
|
|
t = e.createTime;
|
|
}
|
|
}
|
|
- print("$t ${e.createTime} ${day} ${e.createTime + day} ${t > e.createTime + day}");
|
|
|
|
|
|
+ print(
|
|
|
|
+ "$t ${e.createTime} ${day} ${e.createTime + day} ${t > e.createTime + day}");
|
|
if (t > e.createTime + day) {
|
|
if (t > e.createTime + day) {
|
|
fixed.add(FeedBackInfoData(from: "-3", createTime: t));
|
|
fixed.add(FeedBackInfoData(from: "-3", createTime: t));
|
|
}
|
|
}
|
|
@@ -104,7 +112,8 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
t = e.createTime;
|
|
t = e.createTime;
|
|
}
|
|
}
|
|
if (fixed.length > 2) {
|
|
if (fixed.length > 2) {
|
|
- fixed.add(FeedBackInfoData(from: "-3", createTime: fixed[fixed.length - 1].createTime));
|
|
|
|
|
|
+ fixed.add(FeedBackInfoData(
|
|
|
|
+ from: "-3", createTime: fixed[fixed.length - 1].createTime));
|
|
}
|
|
}
|
|
|
|
|
|
data.data = fixed;
|
|
data.data = fixed;
|
|
@@ -117,13 +126,7 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
return Scaffold(
|
|
- appBar: AppBar(
|
|
|
|
- title: Text(
|
|
|
|
- "用户反馈",
|
|
|
|
- style: titleStyle,
|
|
|
|
- ),
|
|
|
|
- leading: buildBackButton(context),
|
|
|
|
- ),
|
|
|
|
|
|
+ appBar: buildAppBar(context, title: "用户反馈"),
|
|
body: Column(
|
|
body: Column(
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
Expanded(
|
|
Expanded(
|
|
@@ -133,177 +136,249 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
builder: (context, model, child) {
|
|
builder: (context, model, child) {
|
|
return _isLoading
|
|
return _isLoading
|
|
? RequestLoadingWidget()
|
|
? RequestLoadingWidget()
|
|
- : CustomScrollView(reverse: (_data.data?.length ?? 0) > 2, slivers: [
|
|
|
|
- SliverList(
|
|
|
|
- delegate: SliverChildListDelegate(
|
|
|
|
- _data.data
|
|
|
|
- .map((e) => e.from == "-3"
|
|
|
|
- ? Center(
|
|
|
|
- child: Padding(
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 8.0),
|
|
|
|
- child: Text(
|
|
|
|
- "${DateFormat.formatTime(e.createTime)}",
|
|
|
|
- style: Theme.of(context).textTheme.bodyText1,
|
|
|
|
- )),
|
|
|
|
- )
|
|
|
|
- : e.from == "-1"
|
|
|
|
- ? Padding(
|
|
|
|
- padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
|
|
|
|
- child: Row(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- children: <Widget>[
|
|
|
|
- CircleAvatar(
|
|
|
|
- backgroundImage: CachedNetworkImageProvider(
|
|
|
|
- "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2661558467,1288211245&fm=26&gp=0.jpg"),
|
|
|
|
- radius: 20,
|
|
|
|
- ),
|
|
|
|
- Space(
|
|
|
|
- width: 12,
|
|
|
|
- ),
|
|
|
|
- CustomPaint(
|
|
|
|
- painter: _BubblePainter(),
|
|
|
|
- child: Padding(
|
|
|
|
- padding: const EdgeInsets.fromLTRB(20.0, 8.0, 12, 8),
|
|
|
|
- child: Container(
|
|
|
|
- child: Text(
|
|
|
|
- "很高兴认识你",
|
|
|
|
- style: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 16),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- )
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
|
|
+ : CustomScrollView(
|
|
|
|
+ reverse: (_data.data?.length ?? 0) > 2,
|
|
|
|
+ slivers: [
|
|
|
|
+ SliverList(
|
|
|
|
+ delegate: SliverChildListDelegate(
|
|
|
|
+ _data.data
|
|
|
|
+ .map((e) => e.from == "-3"
|
|
|
|
+ ? Center(
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding:
|
|
|
|
+ EdgeInsets.symmetric(
|
|
|
|
+ vertical: 8.0),
|
|
|
|
+ child: Text(
|
|
|
|
+ "${DateFormat.formatTime(e.createTime)}",
|
|
|
|
+ style: Theme.of(context)
|
|
|
|
+ .textTheme
|
|
|
|
+ .bodyText1,
|
|
|
|
+ )),
|
|
)
|
|
)
|
|
- : e.from == "-2"
|
|
|
|
|
|
+ : e.from == "-1"
|
|
? Padding(
|
|
? Padding(
|
|
- padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
|
|
|
|
|
|
+ padding: const EdgeInsets
|
|
|
|
+ .symmetric(
|
|
|
|
+ vertical: 8.0,
|
|
|
|
+ horizontal: 12.0),
|
|
child: Row(
|
|
child: Row(
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
+ crossAxisAlignment:
|
|
|
|
+ CrossAxisAlignment
|
|
|
|
+ .start,
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
CircleAvatar(
|
|
CircleAvatar(
|
|
- backgroundImage: CachedNetworkImageProvider(
|
|
|
|
- "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2661558467,1288211245&fm=26&gp=0.jpg"),
|
|
|
|
|
|
+ backgroundImage:
|
|
|
|
+ CachedNetworkImageProvider(
|
|
|
|
+ "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2661558467,1288211245&fm=26&gp=0.jpg"),
|
|
radius: 20,
|
|
radius: 20,
|
|
),
|
|
),
|
|
Space(
|
|
Space(
|
|
width: 12,
|
|
width: 12,
|
|
),
|
|
),
|
|
CustomPaint(
|
|
CustomPaint(
|
|
- painter: _BubblePainter(),
|
|
|
|
|
|
+ painter:
|
|
|
|
+ _BubblePainter(),
|
|
child: Padding(
|
|
child: Padding(
|
|
- padding: const EdgeInsets.fromLTRB(20.0, 8.0, 12, 8),
|
|
|
|
|
|
+ padding:
|
|
|
|
+ const EdgeInsets
|
|
|
|
+ .fromLTRB(
|
|
|
|
+ 20.0,
|
|
|
|
+ 8.0,
|
|
|
|
+ 12,
|
|
|
|
+ 8),
|
|
child: Container(
|
|
child: Container(
|
|
- child: Column(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- children: <Widget>[
|
|
|
|
- Text(
|
|
|
|
- "常见问题",
|
|
|
|
- style: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 16),
|
|
|
|
- ),
|
|
|
|
- Column(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- children: model.data.data
|
|
|
|
- .map((e) => InkWell(
|
|
|
|
- onTap: () {
|
|
|
|
- NavigatorUtil.goPage(context, (context) => FeedbackDetailPage(e));
|
|
|
|
- // NavigatorUtil.go(context, "${Routes.feedbackDetail}?data=${Uri.encodeComponent(json.encode(e))}");
|
|
|
|
- },
|
|
|
|
- child: Padding(
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 5.0),
|
|
|
|
- child: Text("${model.data.data.indexOf(e) + 1}.${e.groupName}",
|
|
|
|
- style: Theme.of(context)
|
|
|
|
- .textTheme
|
|
|
|
- .subtitle1
|
|
|
|
- .copyWith(color: Color(0xff666666), fontSize: 16)),
|
|
|
|
- )))
|
|
|
|
- .toList(),
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
- )),
|
|
|
|
|
|
+ child: Text(
|
|
|
|
+ "很高兴认识你",
|
|
|
|
+ style: Theme.of(
|
|
|
|
+ context)
|
|
|
|
+ .textTheme
|
|
|
|
+ .subtitle1
|
|
|
|
+ .copyWith(
|
|
|
|
+ fontSize:
|
|
|
|
+ 16),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
|
|
+ )
|
|
],
|
|
],
|
|
),
|
|
),
|
|
)
|
|
)
|
|
- : Padding(
|
|
|
|
- padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
|
|
|
|
- child: Row(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- mainAxisAlignment: e.from == "user" ? MainAxisAlignment.end : MainAxisAlignment.start,
|
|
|
|
- children: e.from == "user"
|
|
|
|
- ? <Widget>[
|
|
|
|
- CustomPaint(
|
|
|
|
- painter: _BubblePainterRight(),
|
|
|
|
- child: ConstrainedBox(
|
|
|
|
- constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
|
|
|
|
- child: Container(
|
|
|
|
- padding: EdgeInsets.fromLTRB(12, 6, 20, 8),
|
|
|
|
- child: Column(
|
|
|
|
- children: <Widget>[
|
|
|
|
- Text(
|
|
|
|
- "${e.content}",
|
|
|
|
- style: Theme.of(context)
|
|
|
|
- .textTheme
|
|
|
|
- .subtitle1
|
|
|
|
- .copyWith(fontSize: 16, color: Colors.white),
|
|
|
|
- ),
|
|
|
|
- if (e.images?.isNotEmpty == true)
|
|
|
|
- GridView.count(
|
|
|
|
- physics: new NeverScrollableScrollPhysics(),
|
|
|
|
- shrinkWrap: true,
|
|
|
|
- padding: EdgeInsets.zero,
|
|
|
|
- crossAxisSpacing: 10.0,
|
|
|
|
- crossAxisCount: e.images?.length ?? 0,
|
|
|
|
- children: e.images
|
|
|
|
- .asMap()
|
|
|
|
- .keys
|
|
|
|
- .map((i) => CachedNetworkImage(
|
|
|
|
- imageUrl: e.images[i],
|
|
|
|
- fit: BoxFit.cover,
|
|
|
|
- ))
|
|
|
|
- .toList())
|
|
|
|
- ],
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- ),
|
|
|
|
|
|
+ : e.from == "-2"
|
|
|
|
+ ? Padding(
|
|
|
|
+ padding:
|
|
|
|
+ const EdgeInsets
|
|
|
|
+ .symmetric(
|
|
|
|
+ vertical: 8.0,
|
|
|
|
+ horizontal:
|
|
|
|
+ 12.0),
|
|
|
|
+ child: Row(
|
|
|
|
+ crossAxisAlignment:
|
|
|
|
+ CrossAxisAlignment
|
|
|
|
+ .start,
|
|
|
|
+ children: <Widget>[
|
|
|
|
+ CircleAvatar(
|
|
|
|
+ backgroundImage:
|
|
|
|
+ CachedNetworkImageProvider(
|
|
|
|
+ "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2661558467,1288211245&fm=26&gp=0.jpg"),
|
|
|
|
+ radius: 20,
|
|
|
|
+ ),
|
|
|
|
+ Space(
|
|
|
|
+ width: 12,
|
|
|
|
+ ),
|
|
|
|
+ CustomPaint(
|
|
|
|
+ painter:
|
|
|
|
+ _BubblePainter(),
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding:
|
|
|
|
+ const EdgeInsets
|
|
|
|
+ .fromLTRB(
|
|
|
|
+ 20.0,
|
|
|
|
+ 8.0,
|
|
|
|
+ 12,
|
|
|
|
+ 8),
|
|
|
|
+ child: Container(
|
|
|
|
+ child: Column(
|
|
|
|
+ crossAxisAlignment:
|
|
|
|
+ CrossAxisAlignment
|
|
|
|
+ .start,
|
|
|
|
+ children: <
|
|
|
|
+ Widget>[
|
|
|
|
+ Text(
|
|
|
|
+ "常见问题",
|
|
|
|
+ style: Theme.of(
|
|
|
|
+ context)
|
|
|
|
+ .textTheme
|
|
|
|
+ .subtitle1
|
|
|
|
+ .copyWith(
|
|
|
|
+ fontSize: 16),
|
|
),
|
|
),
|
|
- )),
|
|
|
|
- Space(
|
|
|
|
- width: 12,
|
|
|
|
- ),
|
|
|
|
- CircleAvatar(
|
|
|
|
- backgroundImage: userAvatarProvider(_user?.avatar),
|
|
|
|
- radius: 20,
|
|
|
|
- ),
|
|
|
|
- ]
|
|
|
|
- : <Widget>[
|
|
|
|
- CircleAvatar(
|
|
|
|
- backgroundImage: CachedNetworkImageProvider(
|
|
|
|
- "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2661558467,1288211245&fm=26&gp=0.jpg"),
|
|
|
|
- radius: 20,
|
|
|
|
- ),
|
|
|
|
- Space(
|
|
|
|
- width: 12,
|
|
|
|
|
|
+ Column(
|
|
|
|
+ crossAxisAlignment:
|
|
|
|
+ CrossAxisAlignment
|
|
|
|
+ .start,
|
|
|
|
+ children: model
|
|
|
|
+ .data
|
|
|
|
+ .data
|
|
|
|
+ .map((e) => InkWell(
|
|
|
|
+ onTap: () {
|
|
|
|
+ NavigatorUtil.goPage(context, (context) => FeedbackDetailPage(e));
|
|
|
|
+ // NavigatorUtil.go(context, "${Routes.feedbackDetail}?data=${Uri.encodeComponent(json.encode(e))}");
|
|
|
|
+ },
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 5.0),
|
|
|
|
+ child: Text("${model.data.data.indexOf(e) + 1}.${e.groupName}", style: Theme.of(context).textTheme.subtitle1.copyWith(color: Color(0xff666666), fontSize: 16)),
|
|
|
|
+ )))
|
|
|
|
+ .toList(),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ )),
|
|
),
|
|
),
|
|
- CustomPaint(
|
|
|
|
- painter: _BubblePainter(),
|
|
|
|
- child: ConstrainedBox(
|
|
|
|
- constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
|
|
|
|
- child: Container(
|
|
|
|
- padding: EdgeInsets.fromLTRB(12, 6, 20, 8),
|
|
|
|
- child: Text(
|
|
|
|
- "${e.content}",
|
|
|
|
- style: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 16),
|
|
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ )
|
|
|
|
+ : Padding(
|
|
|
|
+ padding:
|
|
|
|
+ const EdgeInsets
|
|
|
|
+ .symmetric(
|
|
|
|
+ vertical: 8.0,
|
|
|
|
+ horizontal:
|
|
|
|
+ 12.0),
|
|
|
|
+ child: Row(
|
|
|
|
+ crossAxisAlignment:
|
|
|
|
+ CrossAxisAlignment
|
|
|
|
+ .start,
|
|
|
|
+ mainAxisAlignment: e
|
|
|
|
+ .from ==
|
|
|
|
+ "user"
|
|
|
|
+ ? MainAxisAlignment
|
|
|
|
+ .end
|
|
|
|
+ : MainAxisAlignment
|
|
|
|
+ .start,
|
|
|
|
+ children:
|
|
|
|
+ e.from == "user"
|
|
|
|
+ ? <Widget>[
|
|
|
|
+ CustomPaint(
|
|
|
|
+ painter:
|
|
|
|
+ _BubblePainterRight(),
|
|
|
|
+ child:
|
|
|
|
+ ConstrainedBox(
|
|
|
|
+ constraints:
|
|
|
|
+ BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
|
|
|
|
+ child:
|
|
|
|
+ Container(
|
|
|
|
+ padding: EdgeInsets.fromLTRB(12, 6, 20, 8),
|
|
|
|
+ child: Column(
|
|
|
|
+ children: <Widget>[
|
|
|
|
+ Text(
|
|
|
|
+ "${e.content}",
|
|
|
|
+ style: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 16, color: Color(0xff333333)),
|
|
|
|
+ ),
|
|
|
|
+ if (e.images?.isNotEmpty == true)
|
|
|
|
+ GridView.count(
|
|
|
|
+ physics: new NeverScrollableScrollPhysics(),
|
|
|
|
+ shrinkWrap: true,
|
|
|
|
+ padding: EdgeInsets.zero,
|
|
|
|
+ crossAxisSpacing: 10.0,
|
|
|
|
+ crossAxisCount: e.images?.length ?? 0,
|
|
|
|
+ children: e.images
|
|
|
|
+ .asMap()
|
|
|
|
+ .keys
|
|
|
|
+ .map((i) => CachedNetworkImage(
|
|
|
|
+ imageUrl: e.images[i],
|
|
|
|
+ fit: BoxFit.cover,
|
|
|
|
+ ))
|
|
|
|
+ .toList())
|
|
|
|
+ ],
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ )),
|
|
|
|
+ Space(
|
|
|
|
+ width:
|
|
|
|
+ 12,
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- )),
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
- ))
|
|
|
|
- .toList(),
|
|
|
|
- ),
|
|
|
|
- )
|
|
|
|
- ]);
|
|
|
|
|
|
+ CircleAvatar(
|
|
|
|
+ backgroundImage:
|
|
|
|
+ userAvatarProvider(_user?.avatar),
|
|
|
|
+ radius:
|
|
|
|
+ 20,
|
|
|
|
+ ),
|
|
|
|
+ ]
|
|
|
|
+ : <Widget>[
|
|
|
|
+ CircleAvatar(
|
|
|
|
+ backgroundImage:
|
|
|
|
+ CachedNetworkImageProvider("https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2661558467,1288211245&fm=26&gp=0.jpg"),
|
|
|
|
+ radius:
|
|
|
|
+ 20,
|
|
|
|
+ ),
|
|
|
|
+ Space(
|
|
|
|
+ width:
|
|
|
|
+ 12,
|
|
|
|
+ ),
|
|
|
|
+ CustomPaint(
|
|
|
|
+ painter:
|
|
|
|
+ _BubblePainter(),
|
|
|
|
+ child:
|
|
|
|
+ ConstrainedBox(
|
|
|
|
+ constraints:
|
|
|
|
+ BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
|
|
|
|
+ child:
|
|
|
|
+ Container(
|
|
|
|
+ padding: EdgeInsets.fromLTRB(12, 6, 20, 8),
|
|
|
|
+ child: Text(
|
|
|
|
+ "${e.content}",
|
|
|
|
+ style: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 16),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ )),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ ))
|
|
|
|
+ .toList(),
|
|
|
|
+ ),
|
|
|
|
+ )
|
|
|
|
+ ]);
|
|
},
|
|
},
|
|
),
|
|
),
|
|
),
|
|
),
|
|
@@ -319,8 +394,10 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
_postImage();
|
|
_postImage();
|
|
},
|
|
},
|
|
child: Padding(
|
|
child: Padding(
|
|
- padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
|
|
|
|
- child: Image.asset("lib/assets/img/bbs_icon_picture.png"),
|
|
|
|
|
|
+ padding: const EdgeInsets.symmetric(
|
|
|
|
+ vertical: 8.0, horizontal: 12.0),
|
|
|
|
+ child:
|
|
|
|
+ Image.asset("lib/assets/img/bbs_icon_picture.png"),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
Expanded(
|
|
@@ -329,16 +406,25 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
controller: _controller,
|
|
controller: _controller,
|
|
focusNode: _focusNode,
|
|
focusNode: _focusNode,
|
|
keyboardType: TextInputType.multiline,
|
|
keyboardType: TextInputType.multiline,
|
|
|
|
+ strutStyle:
|
|
|
|
+ StrutStyle(forceStrutHeight: true, height: 1.4),
|
|
minLines: 1,
|
|
minLines: 1,
|
|
maxLines: 3,
|
|
maxLines: 3,
|
|
maxLength: 200,
|
|
maxLength: 200,
|
|
|
|
+ style: TextStyle(fontSize: 16.0),
|
|
onChanged: (value) {
|
|
onChanged: (value) {
|
|
- setState(() {
|
|
|
|
|
|
+ setState(() {
|
|
_textFieldValue = value;
|
|
_textFieldValue = value;
|
|
- });
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
decoration: InputDecoration(
|
|
decoration: InputDecoration(
|
|
- counterText: "", hintText: "提交你的反馈...", contentPadding: EdgeInsets.symmetric(vertical: 16.0), border: InputBorder.none),
|
|
|
|
|
|
+ counterText: "",
|
|
|
|
+ hintText: "提交你的反馈...",
|
|
|
|
+ contentPadding:
|
|
|
|
+ EdgeInsets.symmetric(vertical: 16.0),
|
|
|
|
+ border: InputBorder.none,
|
|
|
|
+ hintStyle: TextStyle(color: Color(0xff999999))
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
@@ -350,18 +436,21 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
width: 22,
|
|
width: 22,
|
|
child: CircularProgressIndicator(),
|
|
child: CircularProgressIndicator(),
|
|
)
|
|
)
|
|
- : PrimaryButton(
|
|
|
|
- width: 80,
|
|
|
|
- height: 35,
|
|
|
|
- callback: _textFieldValue.isEmpty
|
|
|
|
- ? null
|
|
|
|
- : () async {
|
|
|
|
|
|
+ :
|
|
|
|
+ ValueListenableBuilder(
|
|
|
|
+ valueListenable: _postable,
|
|
|
|
+ builder: (_, able, __) => PrimaryButton(
|
|
|
|
+ content: "提交",
|
|
|
|
+ width: 80,
|
|
|
|
+ height: 35,
|
|
|
|
+ callback: () async {
|
|
setState(() {
|
|
setState(() {
|
|
_posting = true;
|
|
_posting = true;
|
|
});
|
|
});
|
|
_controller.clear();
|
|
_controller.clear();
|
|
|
|
|
|
- await _postFeedBackpostFeedBack(_textFieldValue);
|
|
|
|
|
|
+ await _postFeedBackpostFeedBack(
|
|
|
|
+ _textFieldValue);
|
|
// ToastUtil.show("提交成功");
|
|
// ToastUtil.show("提交成功");
|
|
|
|
|
|
setState(() {
|
|
setState(() {
|
|
@@ -369,10 +458,12 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
_posting = false;
|
|
_posting = false;
|
|
});
|
|
});
|
|
refresh();
|
|
refresh();
|
|
-// SystemChannels.textInput.invokeMethod('TextInput.hide');
|
|
|
|
},
|
|
},
|
|
- content: "提交",
|
|
|
|
- ),
|
|
|
|
|
|
+ shadow: able == true,
|
|
|
|
+ buttonColor: able == false
|
|
|
|
+ ? Color(0xffFFC400).withOpacity(0.3)
|
|
|
|
+ : null,
|
|
|
|
+ )),
|
|
)
|
|
)
|
|
],
|
|
],
|
|
),
|
|
),
|
|
@@ -417,7 +508,8 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
|
|
|
|
|
|
_postFeedBackpostFeedBack(String content, {int typeId = 0}) async {
|
|
_postFeedBackpostFeedBack(String content, {int typeId = 0}) async {
|
|
typeId == null ? typeId = 0 : typeId = typeId;
|
|
typeId == null ? typeId = 0 : typeId = typeId;
|
|
- await api.postFeedback(typeId, content, extra: await Application.getDeviceInfo());
|
|
|
|
|
|
+ await api.postFeedback(typeId, content,
|
|
|
|
+ extra: await Application.getDeviceInfo());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -464,7 +556,8 @@ class PostActionState extends State<PostAction> with InjectApi {
|
|
Asset asset = imageList[i];
|
|
Asset asset = imageList[i];
|
|
if (upload.containsKey(asset)) continue;
|
|
if (upload.containsKey(asset)) continue;
|
|
ByteData byteData = await asset.getByteData(quality: 85);
|
|
ByteData byteData = await asset.getByteData(quality: 85);
|
|
- File file = File('${directory.path}/${DateTime.now().millisecondsSinceEpoch}_$i.jpg');
|
|
|
|
|
|
+ File file = File(
|
|
|
|
+ '${directory.path}/${DateTime.now().millisecondsSinceEpoch}_$i.jpg');
|
|
List<int> bytes = byteData.buffer.asUint8List().toList();
|
|
List<int> bytes = byteData.buffer.asUint8List().toList();
|
|
print('临时文件 ${file.path} ${bytes.length}');
|
|
print('临时文件 ${file.path} ${bytes.length}');
|
|
file.writeAsBytesSync(bytes);
|
|
file.writeAsBytesSync(bytes);
|
|
@@ -479,7 +572,9 @@ class PostActionState extends State<PostAction> with InjectApi {
|
|
|
|
|
|
_msg.value = "发布中...";
|
|
_msg.value = "发布中...";
|
|
// await Future.delayed(Duration(seconds: 3));
|
|
// await Future.delayed(Duration(seconds: 3));
|
|
- var data = await api.postFeedback(0, '图片', images: json.encode(upload.values.toList()), extra: await Application.getDeviceInfo());
|
|
|
|
|
|
+ var data = await api.postFeedback(0, '图片',
|
|
|
|
+ images: json.encode(upload.values.toList()),
|
|
|
|
+ extra: await Application.getDeviceInfo());
|
|
print(data);
|
|
print(data);
|
|
if (data.code == 0) {
|
|
if (data.code == 0) {
|
|
Navigator.of(context).pop(true);
|
|
Navigator.of(context).pop(true);
|
|
@@ -497,7 +592,10 @@ class PostActionState extends State<PostAction> with InjectApi {
|
|
CircularProgressIndicator(),
|
|
CircularProgressIndicator(),
|
|
Padding(
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 15),
|
|
padding: const EdgeInsets.only(top: 15),
|
|
- child: ValueListenableBuilder(valueListenable: _msg, builder: (BuildContext context, String value, Widget child) => Text(value)),
|
|
|
|
|
|
+ child: ValueListenableBuilder(
|
|
|
|
+ valueListenable: _msg,
|
|
|
|
+ builder: (BuildContext context, String value, Widget child) =>
|
|
|
|
+ Text(value)),
|
|
)
|
|
)
|
|
],
|
|
],
|
|
),
|
|
),
|
|
@@ -505,6 +603,55 @@ class PostActionState extends State<PostAction> with InjectApi {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//class _BubblePainter extends CustomPainter {
|
|
|
|
+// final circular = Radius.circular(10);
|
|
|
|
+// final Paint _paint = Paint()..color = Colors.white;
|
|
|
|
+// final double _bubbleWidth = 10;
|
|
|
|
+//
|
|
|
|
+// @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, _bubbleWidth)
|
|
|
|
+// ..quadraticBezierTo(_bubbleWidth / 3 * 2, _bubbleWidth + 4, 0, _bubbleWidth)
|
|
|
|
+// ..quadraticBezierTo(_bubbleWidth / 3, _bubbleWidth + _bubbleWidth / 2, _bubbleWidth + 1, _bubbleWidth * 2)
|
|
|
|
+// ..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(0xffFFC400);
|
|
|
|
+// final double _bubbleWidth = 10;
|
|
|
|
+//
|
|
|
|
+// @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;
|
|
|
|
+// Path path = Path()
|
|
|
|
+// ..moveTo(left, _bubbleWidth)
|
|
|
|
+// ..quadraticBezierTo(left + _bubbleWidth / 3 * 2, _bubbleWidth + 4, size.width, _bubbleWidth)
|
|
|
|
+// ..quadraticBezierTo(left + _bubbleWidth / 3, _bubbleWidth + _bubbleWidth / 2, left, _bubbleWidth * 2)
|
|
|
|
+// ..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;
|
|
|
|
+// }
|
|
|
|
+//}
|
|
|
|
+
|
|
class _BubblePainter extends CustomPainter {
|
|
class _BubblePainter extends CustomPainter {
|
|
final circular = Radius.circular(10);
|
|
final circular = Radius.circular(10);
|
|
final Paint _paint = Paint()..color = Colors.white;
|
|
final Paint _paint = Paint()..color = Colors.white;
|
|
@@ -516,11 +663,15 @@ class _BubblePainter extends CustomPainter {
|
|
// ..quadraticBezierTo(size.width / 3, size.height,size.width,size.height)..close();
|
|
// ..quadraticBezierTo(size.width / 3, size.height,size.width,size.height)..close();
|
|
Path path = Path()
|
|
Path path = Path()
|
|
..moveTo(_bubbleWidth + 1, _bubbleWidth)
|
|
..moveTo(_bubbleWidth + 1, _bubbleWidth)
|
|
- ..quadraticBezierTo(_bubbleWidth / 3 * 2, _bubbleWidth + 4, 0, _bubbleWidth)
|
|
|
|
- ..quadraticBezierTo(_bubbleWidth / 3, _bubbleWidth + _bubbleWidth / 2, _bubbleWidth + 1, _bubbleWidth * 2)
|
|
|
|
|
|
+ ..quadraticBezierTo(
|
|
|
|
+ _bubbleWidth / 3 * 2, _bubbleWidth + 4, 0, _bubbleWidth)
|
|
|
|
+ ..quadraticBezierTo(_bubbleWidth / 3, _bubbleWidth + _bubbleWidth / 2,
|
|
|
|
+ _bubbleWidth + 1, _bubbleWidth * 2)
|
|
..close();
|
|
..close();
|
|
canvas.drawPath(path, _paint);
|
|
canvas.drawPath(path, _paint);
|
|
- canvas.drawRRect(RRect.fromLTRBR(_bubbleWidth, 0, size.width, size.height, circular), _paint);
|
|
|
|
|
|
+ canvas.drawRRect(
|
|
|
|
+ RRect.fromLTRBR(_bubbleWidth, 0, size.width, size.height, circular),
|
|
|
|
+ _paint);
|
|
}
|
|
}
|
|
|
|
|
|
@override
|
|
@override
|
|
@@ -531,7 +682,7 @@ class _BubblePainter extends CustomPainter {
|
|
|
|
|
|
class _BubblePainterRight extends CustomPainter {
|
|
class _BubblePainterRight extends CustomPainter {
|
|
final circular = Radius.circular(10);
|
|
final circular = Radius.circular(10);
|
|
- final Paint _paint = Paint()..color = Color(0xffFFC400);
|
|
|
|
|
|
+ final Paint _paint = Paint()..color = Color(0xffffe400).withOpacity(0.7);
|
|
final double _bubbleWidth = 10;
|
|
final double _bubbleWidth = 10;
|
|
|
|
|
|
@override
|
|
@override
|
|
@@ -541,11 +692,15 @@ class _BubblePainterRight extends CustomPainter {
|
|
double left = size.width - _bubbleWidth;
|
|
double left = size.width - _bubbleWidth;
|
|
Path path = Path()
|
|
Path path = Path()
|
|
..moveTo(left, _bubbleWidth)
|
|
..moveTo(left, _bubbleWidth)
|
|
- ..quadraticBezierTo(left + _bubbleWidth / 3 * 2, _bubbleWidth + 4, size.width, _bubbleWidth)
|
|
|
|
- ..quadraticBezierTo(left + _bubbleWidth / 3, _bubbleWidth + _bubbleWidth / 2, left, _bubbleWidth * 2)
|
|
|
|
|
|
+ ..quadraticBezierTo(left + _bubbleWidth / 3 * 2, _bubbleWidth + 2,
|
|
|
|
+ size.width, _bubbleWidth)
|
|
|
|
+ ..quadraticBezierTo(left + _bubbleWidth / 3,
|
|
|
|
+ _bubbleWidth + _bubbleWidth / 2, left, _bubbleWidth * 2)
|
|
..close();
|
|
..close();
|
|
canvas.drawPath(path, _paint);
|
|
canvas.drawPath(path, _paint);
|
|
- canvas.drawRRect(RRect.fromLTRBR(0, 0, size.width - _bubbleWidth, size.height, circular), _paint);
|
|
|
|
|
|
+ canvas.drawRRect(
|
|
|
|
+ RRect.fromLTRBR(0, 0, size.width - _bubbleWidth, size.height, circular),
|
|
|
|
+ _paint);
|
|
}
|
|
}
|
|
|
|
|
|
@override
|
|
@override
|