ui cleanup

This commit is contained in:
Christien Rioux 2024-04-10 16:13:08 -04:00
parent 1f99279cd2
commit 23ec185324
26 changed files with 419 additions and 244 deletions

View file

@ -12,8 +12,6 @@ class HomeAccountReadyChat extends StatefulWidget {
}
class HomeAccountReadyChatState extends State<HomeAccountReadyChat> {
final _unfocusNode = FocusNode();
@override
void initState() {
super.initState();
@ -26,7 +24,6 @@ class HomeAccountReadyChatState extends State<HomeAccountReadyChat> {
@override
void dispose() {
_unfocusNode.dispose();
super.dispose();
}
@ -42,8 +39,6 @@ class HomeAccountReadyChatState extends State<HomeAccountReadyChat> {
@override
Widget build(BuildContext context) => SafeArea(
child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(_unfocusNode),
child: buildChatComponent(context),
));
);
}

View file

@ -18,8 +18,6 @@ class AccountPage extends StatefulWidget {
}
class AccountPageState extends State<AccountPage> {
final _unfocusNode = FocusNode();
@override
void initState() {
super.initState();
@ -27,7 +25,6 @@ class AccountPageState extends State<AccountPage> {
@override
void dispose() {
_unfocusNode.dispose();
super.dispose();
}

View file

@ -11,8 +11,6 @@ class ChatsPage extends StatefulWidget {
}
class ChatsPageState extends State<ChatsPage> {
final _unfocusNode = FocusNode();
@override
void initState() {
super.initState();
@ -20,7 +18,6 @@ class ChatsPageState extends State<ChatsPage> {
@override
void dispose() {
_unfocusNode.dispose();
super.dispose();
}

View file

@ -5,9 +5,9 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:preload_page_view/preload_page_view.dart';
import 'package:stylish_bottom_bar/model/bar_items.dart';
import 'package:stylish_bottom_bar/stylish_bottom_bar.dart';
import '../../../../chat/chat.dart';
import '../../../../contact_invitation/contact_invitation.dart';
import '../../../../theme/theme.dart';
import '../../../../tools/tools.dart';
@ -28,8 +28,6 @@ class MainPager extends StatefulWidget {
class MainPagerState extends State<MainPager> with TickerProviderStateMixin {
//////////////////////////////////////////////////////////////////
final _unfocusNode = FocusNode();
var _currentPage = 0;
final pageController = PreloadPageController();
@ -56,7 +54,6 @@ class MainPagerState extends State<MainPager> with TickerProviderStateMixin {
@override
void dispose() {
_unfocusNode.dispose();
pageController.dispose();
super.dispose();
}
@ -127,21 +124,13 @@ class MainPagerState extends State<MainPager> with TickerProviderStateMixin {
});
}
Widget _onNewChatBottomSheetBuilder(
BuildContext sheetContext, BuildContext context) =>
const SizedBox(
height: 200,
child: Center(
child: Text(
'Group and custom chat functionality is not available yet')));
Widget _bottomSheetBuilder(BuildContext sheetContext, BuildContext context) {
if (_currentPage == 0) {
// New contact invitation
return newContactInvitationBottomSheetBuilder(sheetContext, context);
return newContactBottomSheetBuilder(sheetContext, context);
} else if (_currentPage == 1) {
// New chat
return _onNewChatBottomSheetBuilder(sheetContext, context);
return newChatBottomSheetBuilder(sheetContext, context);
} else {
// Unknown error
return debugPage('unknown page');