fluffychat/lib/pages/views/new_space_view.dart

56 lines
1.7 KiB
Dart
Raw Normal View History

2021-08-01 08:05:40 +02:00
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import '../new_space.dart';
class NewSpaceView extends StatelessWidget {
final NewSpaceController controller;
const NewSpaceView(this.controller, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
2021-10-14 18:09:30 +02:00
leading: const BackButton(),
2021-08-01 08:05:40 +02:00
title: Text(L10n.of(context).createNewSpace),
elevation: 0,
),
body: MaxWidthBody(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(12.0),
child: TextField(
controller: controller.controller,
autofocus: true,
autocorrect: false,
textInputAction: TextInputAction.go,
onSubmitted: controller.submitAction,
decoration: InputDecoration(
labelText: L10n.of(context).spaceName,
2021-10-14 18:09:30 +02:00
prefixIcon: const Icon(Icons.people_outlined),
2021-08-01 08:05:40 +02:00
hintText: L10n.of(context).enterASpacepName),
),
),
SwitchListTile(
title: Text(L10n.of(context).spaceIsPublic),
value: controller.publicGroup,
onChanged: controller.setPublicGroup,
),
Expanded(
child: Image.asset('assets/private_chat_wallpaper.png'),
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: controller.submitAction,
2021-10-14 18:09:30 +02:00
child: const Icon(Icons.arrow_forward_outlined),
2021-08-01 08:05:40 +02:00
),
);
}
}