Solian/lib/widgets/chat/chat_new.dart

54 lines
1.6 KiB
Dart
Raw Normal View History

2024-04-19 11:36:03 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:solian/router.dart';
2024-04-19 11:36:03 +00:00
class ChatNewAction extends StatelessWidget {
final Function onUpdate;
const ChatNewAction({super.key, required this.onUpdate});
2024-04-19 11:36:03 +00:00
@override
Widget build(BuildContext context) {
return SizedBox(
height: 320,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.only(left: 20, top: 20, bottom: 8),
child: Text(
AppLocalizations.of(context)!.chatNew,
style: Theme.of(context).textTheme.headlineSmall,
),
),
2024-04-19 11:48:31 +00:00
Expanded(
child: ListView(
children: [
ListTile(
leading: const Icon(Icons.add),
title: Text(AppLocalizations.of(context)!.chatNewCreate),
onTap: () {
router.pushNamed('chat.channel.editor').then((did) {
if (did == true) {
onUpdate();
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
});
},
2024-04-19 11:48:31 +00:00
),
ListTile(
leading: const Icon(Icons.travel_explore),
title: Text(AppLocalizations.of(context)!.chatNewJoin),
),
],
),
),
2024-04-19 11:36:03 +00:00
],
),
);
}
}