| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import 'package:flutter/material.dart';
- import 'package:flutter/cupertino.dart';
- import 'OpenRoom.dart'; //创建房间
- class CreateRoom extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- Navigator.of(context).pop();
- },
- child: Scaffold(
- backgroundColor: Color(0xCC000000),
- body: Container(
- child: SizedBox.expand(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- _CreateRoomBtn("创建普通房间"),
- SizedBox(
- height: 36,
- ),
- _CreateRoomBtn("创建官方房间")
- ],
- ),
- ),
- ),
- ),
- );
- }
- }
- class _CreateRoomBtn extends StatelessWidget {
- final String title;
- _CreateRoomBtn(this.title);
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- print(this.title);
- Navigator.push(
- context,
- new CupertinoPageRoute(
- builder: (context) => new OpenRoom(
- roomFlag: this.title == '创建普通房间' ? '0' : '1')));
- },
- child: Container(
- width: 250,
- height: 96,
- decoration: BoxDecoration(
- border: Border.all(width: 1, color: Color(0x80000000)),
- gradient: LinearGradient(
- colors: [Color(0xFF626C85), Color(0xFF3D3E6C)],
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter)),
- child: Center(
- child: Text(
- title,
- style: TextStyle(color: Colors.white, fontSize: 22),
- ),
- ),
- ),
- );
- }
- }
|