mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
layout web
This commit is contained in:
56
lib/web_layout/menu_sidebar.dart
Normal file
56
lib/web_layout/menu_sidebar.dart
Normal file
@ -0,0 +1,56 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/style.dart';
|
||||
|
||||
class MenuSidebar extends StatelessWidget {
|
||||
const MenuSidebar({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
offset: Offset(4, 0),
|
||||
blurRadius: 10,
|
||||
)
|
||||
],
|
||||
color: ColorsManager.whiteColors,
|
||||
),
|
||||
width: 200,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Community',style: TextStyle(fontSize: 20),),
|
||||
CircleAvatar(
|
||||
backgroundColor: Colors.grey.shade200,
|
||||
child: IconButton(
|
||||
color: ColorsManager.onSecondaryColor,
|
||||
onPressed: () {},
|
||||
icon: const Icon(Icons.add)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20,),
|
||||
TextFormField(
|
||||
controller: TextEditingController(),
|
||||
decoration:textBoxDecoration
|
||||
),
|
||||
Container(height: 100,)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
63
lib/web_layout/web_app_bar.dart
Normal file
63
lib/web_layout/web_app_bar.dart
Normal file
@ -0,0 +1,63 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class WebAppBar extends StatelessWidget {
|
||||
final String? title;
|
||||
final List<Widget>? body;
|
||||
const WebAppBar({super.key,this.title,this.body});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 120,
|
||||
decoration: const BoxDecoration(color:ColorsManager.secondaryColor ),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
title!,style: const TextStyle(
|
||||
fontSize: 30,
|
||||
color: Colors.white),)
|
||||
),
|
||||
if (body != null)
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Wrap(
|
||||
spacing: 15, // Adjust the spacing as needed
|
||||
children: body!,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
IconButton(onPressed: () {},
|
||||
icon: const Icon(Icons.apps_sharp,color: Colors.white,)),
|
||||
const SizedBox(width: 10,),
|
||||
const SizedBox.square(
|
||||
dimension: 40,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
child: SizedBox.square(
|
||||
dimension: 35,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: Colors.grey,
|
||||
child: FlutterLogo(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10,),
|
||||
const Text('mohamamd alnemer ',style: TextStyle(fontSize: 16,color: Colors.white),),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
) ,
|
||||
);
|
||||
}
|
||||
|
||||
// @override
|
||||
// Size get preferredSize => Size.fromHeight(50.0);
|
||||
}
|
54
lib/web_layout/web_scaffold.dart
Normal file
54
lib/web_layout/web_scaffold.dart
Normal file
@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:syncrow_web/utils/assets.dart';
|
||||
import 'package:syncrow_web/web_layout/web_app_bar.dart';
|
||||
import 'menu_sidebar.dart';
|
||||
|
||||
class WebScaffold extends StatelessWidget {
|
||||
final bool enableMenuSideba;
|
||||
final String? appBarTitle;
|
||||
final List<Widget>? appBarBody;
|
||||
final Widget? scaffoldBody;
|
||||
const WebScaffold({super.key,this.appBarTitle,this.appBarBody,this.scaffoldBody,this.enableMenuSideba=true});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
child: SvgPicture.asset(
|
||||
Assets.webBackground,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Opacity(
|
||||
opacity: 0.6,
|
||||
child: WebAppBar(
|
||||
title: appBarTitle,
|
||||
body: appBarBody,
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
if(enableMenuSideba)
|
||||
const MenuSidebar(),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: scaffoldBody!
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user