|
|
@@ -0,0 +1,110 @@
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import '../styles/colors.dart';
|
|
|
+import 'dart:ui';
|
|
|
+import '../styles/totast.dart';
|
|
|
+import 'package:flutter_redux/flutter_redux.dart';
|
|
|
+import '../redux/AppState.dart';
|
|
|
+import '../net/HttpManager.dart';
|
|
|
+import '../net/Result.dart';
|
|
|
+
|
|
|
+class BindGame extends StatefulWidget {
|
|
|
+ @override
|
|
|
+ BindGameState createState() => BindGameState();
|
|
|
+}
|
|
|
+
|
|
|
+class BindGameState extends State<BindGame> {
|
|
|
+ String bindName = '';
|
|
|
+ bool isBind = false;
|
|
|
+
|
|
|
+ void bindEvent() async{
|
|
|
+ if (bindName == '') {
|
|
|
+ Toast.show(context, '请输入绑定角色名称', 1500, 'info');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+Toast.show(context, '加载中', -1, 'loading');
|
|
|
+ Result res = await HttpManager.post("assets/uploadFile", data: {
|
|
|
+
|
|
|
+ });
|
|
|
+ Toast.hide();
|
|
|
+ if (res.success) {
|
|
|
+
|
|
|
+ } else {}
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return new WillPopScope(
|
|
|
+ child: Scaffold(
|
|
|
+ appBar: AppBar(
|
|
|
+ backgroundColor: PRIMARY_COLOR,
|
|
|
+ title: Text('绑定账号'),
|
|
|
+ centerTitle: true,
|
|
|
+ elevation: 0,
|
|
|
+ ),
|
|
|
+ body: Container(
|
|
|
+ color: BG_SUB_COLOR,
|
|
|
+ padding: EdgeInsets.all(15),
|
|
|
+ child: Column(
|
|
|
+ children: <Widget>[
|
|
|
+ Container(
|
|
|
+ height: 220,
|
|
|
+ width: double.infinity,
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 15, horizontal: 34),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ image: DecorationImage(
|
|
|
+ image: AssetImage('images/img_chijizhanchang.png'),
|
|
|
+ fit: BoxFit.cover)),
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ children: _bindWidegt(),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Widget> _bindWidegt() {
|
|
|
+ List<Widget> widgetList = [];
|
|
|
+ if (isBind) {
|
|
|
+ } else {
|
|
|
+ widgetList = [
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(bottom: 10),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(2)),
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ height: 40,
|
|
|
+ child: TextField(
|
|
|
+ style: TextStyle(
|
|
|
+ color: Color(0xFFAF4946), fontWeight: FontWeight.w500),
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ decoration: InputDecoration(
|
|
|
+ hintText: '请输入刺激战场游戏昵称',
|
|
|
+ border: InputBorder.none,
|
|
|
+ hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
|
|
|
+ onChanged: (value) {
|
|
|
+ setState(() {
|
|
|
+ bindName = value;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: 40,
|
|
|
+ child: RaisedButton(
|
|
|
+ textTheme: ButtonTextTheme.primary,
|
|
|
+ child: Text('绑定角色'),
|
|
|
+ onPressed: () {
|
|
|
+ bindEvent();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ return widgetList;
|
|
|
+ }
|
|
|
+}
|