fluffychat/lib/pages/new_group/new_group_view.dart

55 lines
1.7 KiB
Dart
Raw Normal View History

2021-04-13 16:28:27 +02:00
import 'package:flutter/material.dart';
2021-10-26 18:50:34 +02:00
2021-04-13 16:28:27 +02:00
import 'package:flutter_gen/gen_l10n/l10n.dart';
2021-11-09 21:32:16 +01:00
import 'package:fluffychat/pages/new_group/new_group.dart';
2021-10-26 18:50:34 +02:00
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
2021-05-22 09:13:47 +02:00
class NewGroupView extends StatelessWidget {
2021-04-13 16:28:27 +02:00
final NewGroupController controller;
2022-01-29 12:35:03 +01:00
const NewGroupView(this.controller, {Key? key}) : super(key: key);
2021-04-13 16:28:27 +02:00
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
2022-01-29 12:35:03 +01:00
title: Text(L10n.of(context)!.createNewGroup),
2021-04-13 16:28:27 +02:00
),
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(
2022-01-29 12:35:03 +01:00
labelText: L10n.of(context)!.optionalGroupName,
2021-10-14 18:09:30 +02:00
prefixIcon: const Icon(Icons.people_outlined),
2022-01-29 12:35:03 +01:00
hintText: L10n.of(context)!.enterAGroupName),
2021-04-13 16:28:27 +02:00
),
),
2021-11-27 10:10:29 +01:00
SwitchListTile.adaptive(
2022-01-29 12:35:03 +01:00
title: Text(L10n.of(context)!.groupIsPublic),
2021-04-13 16:28:27 +02:00
value: controller.publicGroup,
onChanged: controller.setPublicGroup,
),
Expanded(
2021-06-20 12:57:46 +02:00
child: Image.asset('assets/private_chat_wallpaper.png'),
2021-04-13 16:28:27 +02:00
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: controller.submitAction,
2021-10-14 18:09:30 +02:00
child: const Icon(Icons.arrow_forward_outlined),
2021-04-13 16:28:27 +02:00
),
);
}
}