mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-05-22 07:16:26 +08:00
25
lib/model/responseData.dart
Normal file
25
lib/model/responseData.dart
Normal file
@ -0,0 +1,25 @@
|
||||
class ResponseData{
|
||||
int status;
|
||||
bool success;
|
||||
String message;
|
||||
|
||||
ResponseData(this.status, this.success,this.message);
|
||||
|
||||
ResponseData.fromJson(Map<String, dynamic> json)
|
||||
: status = json['status'],
|
||||
success = json['success'],
|
||||
message=json['message'];
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
{
|
||||
'status': status,
|
||||
'success': success,
|
||||
'messsage': message
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'status: $status ,success: $success,message: ${message.toString()}';
|
||||
}
|
||||
|
||||
}
|
@ -3,6 +3,7 @@ import 'dart:async' show Future;
|
||||
import 'package:fluro/fluro.dart';
|
||||
import 'package:flutter_go/model/version.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
import 'package:flutter_go/model/responseData.dart';
|
||||
|
||||
import './net_utils.dart';
|
||||
import '../model/user_info.dart';
|
||||
|
@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:zefyr/zefyr.dart';
|
||||
import 'package:flutter_go/utils/data_utils.dart';
|
||||
@ -43,20 +45,25 @@ class _issuesMessagePageState extends State<issuesMessagePage> {
|
||||
_submit() {
|
||||
String mk = notusMarkdown.encode(_delta);
|
||||
if (_title.trim().isEmpty) {
|
||||
Fluttertoast.showToast(msg: '标题不能为空',
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
timeInSecForIos: 1,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0);
|
||||
_show('标题不能为空');
|
||||
} else {
|
||||
DataUtils.feedback({'title': _title, "body": mk}).then((result) {
|
||||
print(result);
|
||||
DataUtils.feedback({'title': _title, "body": mk},context).then((result) {
|
||||
_show(result);
|
||||
Navigator.maybePop(context);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_show(String msgs){
|
||||
Fluttertoast.showToast(
|
||||
msg: msgs,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
timeInSecForIos: 1,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0);
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
Reference in New Issue
Block a user