add main menu interface

- MainMenu
 - ChatItem (Widget)
 - ChatFolder (Widget)
 - ChatFolders (Widget)
 - ColorTheme
This commit is contained in:
2026-04-10 12:43:08 +03:00
parent 28f4e6b0ef
commit 210b59f8ed
11 changed files with 632 additions and 121 deletions

View File

@@ -0,0 +1,32 @@
import 'dart:io';
import 'package:flutter/material.dart';
class ChatFolder extends StatelessWidget{
Icon ?icon;
Icon iconn = Icon(Icons.folder, size: 50,);
String name;
ChatFolder({super.key, this.icon, required this.name}){
icon ??= Icon(Icons.folder);
iconn = Icon(icon?.icon, size: 50,);
}
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(5, 2, 5, 2),
child: TextButton(
onPressed: () => print(name),
style: ButtonStyle(foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onSurface)),
child:
Row(
children: [
?icon,
SizedBox(width: 2,),
Text(name, style: TextStyle(fontSize: 18),)
],
),
)
);
}
}

View File

@@ -0,0 +1,25 @@
import 'package:client/widgets/chatFoloder.dart';
import 'package:flutter/material.dart';
class ChatFoloders extends StatelessWidget{
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
ChatFolder(name: 'Все чаты', icon: Icon(Icons.chat),),
ChatFolder(name: 'Контакты', icon: Icon(Icons.person),),
ChatFolder(name: 'Групы', icon: Icon(Icons.group),),
ChatFolder(name: 'Папка 1'),
ChatFolder(name: 'Папка 2'),
ChatFolder(name: 'Папка 3'),
ChatFolder(name: 'Папка 4'),
ChatFolder(name: 'Папка 5'),
ChatFolder(name: 'Папка 6'),
ChatFolder(name: 'Папка 7'),
],
),
);
}
}

View File

@@ -0,0 +1,33 @@
import 'dart:io';
import 'package:flutter/material.dart';
class ChatItem extends StatelessWidget{
ChatItem({super.key, });
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: 80,
child: TextButton(
onPressed: () => print('CHAT'),
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onSecondary),
shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.zero)))
),
child: Padding(
padding: EdgeInsetsGeometry.all(5),
child: Row(
children: [
Icon(Icons.person, size: 60,),
SizedBox(width: 10,),
Text('Название', style: TextStyle(fontSize: 18),)
],
)
)
),
);
}
}