Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qmsd-flutter-user-feedback
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PublicSource
qmsd-flutter-user-feedback
Commits
c9324d97
Commit
c9324d97
authored
Apr 10, 2023
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加角标
parent
11987ff9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
57 deletions
+101
-57
ic_feedback_corner.png
images/ic_feedback_corner.png
+0
-0
user_feedback_imgs.dart
lib/config/user_feedback_imgs.dart
+1
-0
user_feedback_strings.dart
lib/config/user_feedback_strings.dart
+1
-0
user_feedback_page.dart
lib/user_feedback_page.dart
+99
-57
No files found.
images/ic_feedback_corner.png
0 → 100644
View file @
c9324d97
1004 Bytes
lib/config/user_feedback_imgs.dart
View file @
c9324d97
class
UserFeedBackImgs
{
static
String
get
user_feedback_camare
=>
"images/ic_feedback_camare.png"
;
static
String
get
user_feedback_del
=>
"images/ic_feedback_img_del.png"
;
static
String
get
user_feedback_corner
=>
"images/ic_feedback_corner.png"
;
}
\ No newline at end of file
lib/config/user_feedback_strings.dart
View file @
c9324d97
class
UserFeedBackString
{
static
String
get
current_name
=>
"qmsd_flutter_user_feedback"
;
static
String
get
title
=>
"意见反馈"
;
static
String
get
feedback_type
=>
"问题类型"
;
static
String
get
feedback_type_a
=>
"产品建议"
;
...
...
lib/user_feedback_page.dart
View file @
c9324d97
...
...
@@ -13,7 +13,6 @@ import 'package:image_picker/image_picker.dart';
import
'package:qmsd_flutter_user_feedback/config/user_feedback_imgs.dart'
;
import
'package:qmsd_flutter_user_feedback/request/user_feedback_client.dart'
;
import
'package:photo_manager/photo_manager.dart'
;
import
'config/user_feedback_strings.dart'
;
class
UserFeedBackPage
extends
StatefulWidget
{
...
...
@@ -109,47 +108,65 @@ class _UserFeedBackPageState extends State<UserFeedBackPage> {
_getFeedTypeSin
(
int
feedType
)
{
return
Expanded
(
child:
GestureDetector
(
onTap:
()
=>
setState
(()
{
_feedType
=
feedType
;
}),
child:
Container
(
margin:
EdgeInsets
.
only
(
top:
10
,
left:
feedType
==
2
?
6
:
0
,
right:
feedType
==
1
?
6
:
0
),
padding:
const
EdgeInsets
.
all
(
10
),
decoration:
BoxDecoration
(
color:
_feedType
==
feedType
?
CommonColor
.
colorMainGreen
:
CommonColor
.
colorF8
,
borderRadius:
BorderRadius
.
circular
(
4
)),
child:
Text
.
rich
(
TextSpan
(
children:
[
TextSpan
(
text:
feedType
==
1
?
UserFeedBackString
.
feedback_type_a
:
UserFeedBackString
.
feedback_type_b
,
style:
TextStyle
(
color:
CommonColor
.
color33
,
fontSize:
15
,
fontWeight:
FontWeight
.
w600
)),
const
TextSpan
(
text:
"
\n
"
,
),
TextSpan
(
text:
feedType
==
1
?
UserFeedBackString
.
feedback_type_a_tip
:
UserFeedBackString
.
feedback_type_b_tip
,
style:
TextStyle
(
color:
CommonColor
.
colorBlack
,
fontSize:
12
,
height:
2
,
fontWeight:
FontWeight
.
w500
))
]),
textAlign:
TextAlign
.
center
,
overflow:
TextOverflow
.
ellipsis
,
),
),
));
child:
SizedBox
(
height:
70
,
child:
Stack
(
children:
[
Positioned
(
left:
0
,
top:
10
,
right:
0
,
bottom:
0
,
child:
GestureDetector
(
onTap:
()
=>
setState
(()
{
_feedType
=
feedType
;
}),
child:
Container
(
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
only
(
left:
feedType
==
2
?
6
:
0
,
right:
feedType
==
1
?
6
:
0
),
padding:
EdgeInsets
.
only
(
top:
8
),
decoration:
BoxDecoration
(
color:
_feedType
==
feedType
?
CommonColor
.
colorMainGreen
:
CommonColor
.
colorF8
,
borderRadius:
BorderRadius
.
circular
(
4
)),
child:
Column
(
children:
[
Text
(
feedType
==
1
?
UserFeedBackString
.
feedback_type_a
:
UserFeedBackString
.
feedback_type_b
,
style:
TextStyle
(
color:
CommonColor
.
color33
,
fontSize:
15
,
fontWeight:
FontWeight
.
w600
)),
Text
(
feedType
==
1
?
UserFeedBackString
.
feedback_type_a_tip
:
UserFeedBackString
.
feedback_type_b_tip
,
style:
TextStyle
(
color:
CommonColor
.
colorBlack
,
fontSize:
12
,
height:
2
,
overflow:
TextOverflow
.
ellipsis
,
fontWeight:
FontWeight
.
w500
)),
]),
),
)),
Positioned
(
right:
feedType
==
1
?
6
:
0
,
bottom:
0
,
child:
Visibility
(
visible:
_feedType
==
feedType
,
child:
Image
.
asset
(
UserFeedBackImgs
.
user_feedback_corner
,
height:
16
,
package:
UserFeedBackString
.
current_name
,
),
))
],
)));
}
_feedbackDes
()
{
...
...
@@ -215,20 +232,41 @@ class _UserFeedBackPageState extends State<UserFeedBackPage> {
fontSize:
17
,
),
),
GridView
.
builder
(
shrinkWrap:
true
,
physics:
const
BouncingScrollPhysics
(),
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
4
,
childAspectRatio:
1
,
SizedBox
(
height:
90
,
child:
Stack
(
children:
[
Positioned
(
left:
0
,
top:
10
,
right:
0
,
bottom:
0
,
child:
GridView
.
builder
(
shrinkWrap:
true
,
physics:
const
BouncingScrollPhysics
(),
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
4
,
childAspectRatio:
1
,
),
itemCount:
imgFeed
.
length
<
3
?
imgFeed
.
length
+
1
:
3
,
itemBuilder:
(
context
,
index
)
{
// return Image.file(File(imgAD[index].path));
return
index
<
imgFeed
.
length
?
_singleAD
(
index
)
:
_imgAdd
(
index
);
},
)),
Positioned
(
right:
0
,
bottom:
0
,
child:
Text
(
"
${imgFeed.length}
/3"
,
style:
TextStyle
(
fontSize:
13
,
color:
CommonColor
.
colorBB
),
)),
],
),
itemCount:
imgFeed
.
length
+
1
,
itemBuilder:
(
context
,
index
)
{
// return Image.file(File(imgAD[index].path));
return
index
==
imgFeed
.
length
?
_imgAdd
(
index
)
:
_singleAD
(
index
);
},
),
],
),
...
...
@@ -265,7 +303,7 @@ class _UserFeedBackPageState extends State<UserFeedBackPage> {
child:
Image
.
asset
(
UserFeedBackImgs
.
user_feedback_del
,
width:
18
,
package:
"qmsd_flutter_user_feedback"
,
package:
UserFeedBackString
.
current_name
,
)),
)
],
...
...
@@ -294,7 +332,7 @@ class _UserFeedBackPageState extends State<UserFeedBackPage> {
child:
Image
.
asset
(
UserFeedBackImgs
.
user_feedback_camare
,
width:
14
,
package:
"qmsd_flutter_user_feedback"
,
package:
UserFeedBackString
.
current_name
,
)),
const
TextSpan
(
text:
'
\n
'
,
...
...
@@ -336,6 +374,10 @@ class _UserFeedBackPageState extends State<UserFeedBackPage> {
}
getLostData
(
int
pos
)
async
{
if
(
imgFeed
.
length
>=
3
)
{
QmToast
.
toast
(
"最多选3张图片"
);
return
;
}
final
ImagePicker
picker
=
ImagePicker
();
final
XFile
?
image
=
await
picker
.
pickImage
(
source
:
ImageSource
.
gallery
,
imageQuality:
70
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment