add main menu interface
- MainMenu - ChatItem (Widget) - ChatFolder (Widget) - ChatFolders (Widget) - ColorTheme
This commit is contained in:
32
client/lib/widgets/chatFoloder.dart
Normal file
32
client/lib/widgets/chatFoloder.dart
Normal 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),)
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
25
client/lib/widgets/chatFoloders.dart
Normal file
25
client/lib/widgets/chatFoloders.dart
Normal 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'),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
33
client/lib/widgets/chatItem.dart
Normal file
33
client/lib/widgets/chatItem.dart
Normal 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),)
|
||||
],
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user