Webstore (Web App)
Shared Components
Source code for the core web layout and navigation components used across the Webstore.
Shared Architecture Source
The shared feature contains components that define the global look and feel of the application.
import 'package:flutter/material.dart';
import 'package:fluxy/fluxy.dart';
import '../home/home.controller.dart';
import 'web_navbar.dart';
class WebLayout extends StatelessWidget {
final Widget child;
const WebLayout({super.key, required this.child});
@override
Widget build(BuildContext context) {
final ctrl = Fluxy.find<HomeController>();
return Fx.scaffold(
backgroundColor: const Color(0xFFF8FAFC),
body: Fx.stack(
children: [
child, // Page Content
const Positioned(top: 0, left: 0, right: 0, child: WebNavbar()),
Positioned.fill(
child: Fx(() => Stack(
children: [
FxWeb.drawer(
isOpen: ctrl.isMobileMenuOpen.value,
onClose: () => ctrl.toggleMobileMenu(),
fromRight: false,
child: _buildMobileMenuContent(ctrl),
),
FxWeb.drawer(
isOpen: ctrl.isCartOpen.value,
onClose: () => ctrl.toggleCart(),
child: _buildCartContent(ctrl),
)
]
)),
),
],
),
);
}
}