chat -> direct
This commit is contained in:
parent
253a6179de
commit
064e54c5ef
|
|
@ -113,11 +113,11 @@ class DidvanIcons {
|
|||
IconData(0xe82b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData chart_solid =
|
||||
IconData(0xe82c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData chats_light =
|
||||
static const IconData directs_light =
|
||||
IconData(0xe82d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData chats_regular =
|
||||
static const IconData directs_regular =
|
||||
IconData(0xe82e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData chats_solid =
|
||||
static const IconData directs_solid =
|
||||
IconData(0xe82f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData check_light =
|
||||
IconData(0xe830, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import 'package:didvan/pages/home/chat/widgets/message_box.dart';
|
||||
import 'package:didvan/pages/home/direct/widgets/message_box.dart';
|
||||
import 'package:didvan/models/view/app_bar_data.dart';
|
||||
import 'package:didvan/widgets/didvan/scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Chat extends StatelessWidget {
|
||||
const Chat({Key? key}) : super(key: key);
|
||||
class Direct extends StatelessWidget {
|
||||
const Direct({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -5,7 +5,7 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter_vibrate/flutter_vibrate.dart';
|
||||
import 'package:record/record.dart';
|
||||
|
||||
class ChatState extends CoreProvier {
|
||||
class DirectState extends CoreProvier {
|
||||
final _recorder = Record();
|
||||
|
||||
File? recordedFile;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/constants/app_icons.dart';
|
||||
import 'package:didvan/pages/home/chat/chat_state.dart';
|
||||
import 'package:didvan/pages/home/direct/direct_state.dart';
|
||||
import 'package:didvan/widgets/audio_visualizer.dart';
|
||||
import 'package:didvan/widgets/didvan/icon_button.dart';
|
||||
import 'package:didvan/widgets/didvan/text.dart';
|
||||
|
|
@ -22,7 +22,7 @@ class MessageBox extends StatelessWidget {
|
|||
),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
child: Consumer<ChatState>(
|
||||
child: Consumer<DirectState>(
|
||||
builder: (context, state, child) {
|
||||
if (state.isRecording) {
|
||||
return const _Recording();
|
||||
|
|
@ -41,7 +41,7 @@ class _Typing extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final state = context.read<ChatState>();
|
||||
final state = context.read<DirectState>();
|
||||
return Row(
|
||||
children: [
|
||||
DidvanIconButton(
|
||||
|
|
@ -74,7 +74,7 @@ class _Recording extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final state = context.read<ChatState>();
|
||||
final state = context.read<DirectState>();
|
||||
return Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
|
|
@ -111,7 +111,7 @@ class _RecordChecking extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final state = context.read<ChatState>();
|
||||
final state = context.read<DirectState>();
|
||||
return Row(
|
||||
children: [
|
||||
DidvanIconButton(
|
||||
|
|
@ -8,8 +8,8 @@ import 'package:didvan/widgets/didvan/scaffold.dart';
|
|||
import 'package:didvan/widgets/didvan/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChatList extends StatelessWidget {
|
||||
const ChatList({Key? key}) : super(key: key);
|
||||
class DirectList extends StatelessWidget {
|
||||
const DirectList({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -27,7 +27,7 @@ class ChatList extends StatelessWidget {
|
|||
|
||||
Widget _itemBuilder(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.chat),
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.direct),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
import 'package:didvan/providers/core_provider.dart';
|
||||
|
||||
class ChatListState extends CoreProvier {}
|
||||
class DirectListState extends CoreProvier {}
|
||||
|
|
@ -34,7 +34,8 @@ class Profile extends StatelessWidget {
|
|||
MenuItem(
|
||||
title: 'پیامها',
|
||||
icon: DidvanIcons.message_regular,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.chatList),
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed(Routes.directList),
|
||||
),
|
||||
const DidvanDivider(),
|
||||
MenuItem(
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class RadarItem extends StatelessWidget {
|
|||
Spacer(),
|
||||
DidvanText('2'),
|
||||
SizedBox(width: 4),
|
||||
Icon(DidvanIcons.chats_regular),
|
||||
Icon(DidvanIcons.directs_regular),
|
||||
SizedBox(width: 16),
|
||||
DidvanText('10'),
|
||||
SizedBox(width: 4),
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:didvan/pages/authentication/authentication.dart';
|
||||
import 'package:didvan/pages/authentication/authentication_state.dart';
|
||||
import 'package:didvan/pages/home/chat/chat.dart';
|
||||
import 'package:didvan/pages/home/chat/chat_state.dart';
|
||||
import 'package:didvan/pages/home/direct/direct.dart';
|
||||
import 'package:didvan/pages/home/direct/direct_state.dart';
|
||||
import 'package:didvan/pages/home/home.dart';
|
||||
import 'package:didvan/pages/home/home_state.dart';
|
||||
import 'package:didvan/pages/home/news/news_details/news_details.dart';
|
||||
import 'package:didvan/pages/home/news/news_details/news_details_state.dart';
|
||||
import 'package:didvan/pages/home/profile/chat_list/chat_list.dart';
|
||||
import 'package:didvan/pages/home/profile/chat_list/chat_list_state.dart';
|
||||
import 'package:didvan/pages/home/profile/direct_list/direct_list.dart';
|
||||
import 'package:didvan/pages/home/profile/direct_list/direct_list_state.dart';
|
||||
import 'package:didvan/pages/home/profile/edit_profile/edit_profile.dart';
|
||||
import 'package:didvan/pages/home/profile/settings/settings.dart';
|
||||
import 'package:didvan/pages/home/profile/settings/settings_state.dart';
|
||||
|
|
@ -68,18 +68,18 @@ class RouteGenerator {
|
|||
child: const NewsDetails(),
|
||||
),
|
||||
);
|
||||
case Routes.chatList:
|
||||
case Routes.directList:
|
||||
return _createRoute(
|
||||
ChangeNotifierProvider<ChatListState>(
|
||||
create: (context) => ChatListState(),
|
||||
child: const ChatList(),
|
||||
ChangeNotifierProvider<DirectListState>(
|
||||
create: (context) => DirectListState(),
|
||||
child: const DirectList(),
|
||||
),
|
||||
);
|
||||
case Routes.chat:
|
||||
case Routes.direct:
|
||||
return _createRoute(
|
||||
ChangeNotifierProvider<ChatState>(
|
||||
create: (context) => ChatState(),
|
||||
child: const Chat(),
|
||||
ChangeNotifierProvider<DirectState>(
|
||||
create: (context) => DirectState(),
|
||||
child: const Direct(),
|
||||
),
|
||||
);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ class Routes {
|
|||
static const String settings = '/settings';
|
||||
static const String radarDetails = '/radar-details';
|
||||
static const String newsDetails = '/news-details';
|
||||
static const String chatList = '/chat-list';
|
||||
static const String chat = '/chat';
|
||||
static const String directList = '/direct-list';
|
||||
static const String direct = '/direct';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class FloatingNavigationBar extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(width: 4),
|
||||
const Icon(
|
||||
DidvanIcons.chats_regular,
|
||||
DidvanIcons.directs_regular,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue