pos changes

This commit is contained in:
2026-08-06 19:26:53 +05:30
parent cb065a0f69
commit eebd10da6d
42 changed files with 3451 additions and 2531 deletions

View File

@@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import '../constants/asset_paths.dart';
import '../theme/app_colors.dart';
/// The Nearle mark on its tile.
///
/// Every surface that shows the brand — login, sidebar, cashier header —
/// renders this, so the mark cannot drift between them. It replaces the
/// hand-drawn letter "N" in a gradient box that each of those screens used to
/// build for itself.
class BrandMark extends StatelessWidget {
const BrandMark({
super.key,
this.size = 36,
this.radius,
this.onDark = false,
});
final double size;
final double? radius;
/// Set on a coloured background, where the tile needs no border to separate
/// it from what is behind.
final bool onDark;
@override
Widget build(BuildContext context) {
final corner = BorderRadius.circular(radius ?? size * 0.28);
return Container(
width: size,
height: size,
// Clipped, not padded: the mark fills the tile edge to edge and the
// rounded corner does the trimming, so nothing can spill past the box
// whatever aspect ratio the file happens to have.
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: corner,
border: onDark ? null : Border.all(color: AppColors.border),
),
child: Image.asset(
AssetPaths.logo,
fit: BoxFit.fill,
width: size,
height: size,
filterQuality: FilterQuality.medium,
// A missing or undeclared asset would otherwise blank the brand out
// of the sidebar entirely; the letterform is a poor substitute but a
// better failure than nothing.
errorBuilder: (context, _, __) => FittedBox(
fit: BoxFit.contain,
child: Text(
'N',
style: TextStyle(
color: AppColors.primary,
fontWeight: FontWeight.w800,
fontSize: size,
),
),
),
),
);
}
}