feat: update home page
This commit is contained in:
@@ -20,6 +20,8 @@ class Button extends StatelessWidget {
|
||||
this.fontSize = 16.0,
|
||||
this.elevation,
|
||||
this.labelStyle,
|
||||
this.mainAxisAlignment = MainAxisAlignment.center,
|
||||
this.crossAxisAlignment = CrossAxisAlignment.center,
|
||||
});
|
||||
|
||||
const Button.outlined({
|
||||
@@ -37,6 +39,8 @@ class Button extends StatelessWidget {
|
||||
this.fontSize = 16.0,
|
||||
this.elevation,
|
||||
this.labelStyle,
|
||||
this.mainAxisAlignment = MainAxisAlignment.center,
|
||||
this.crossAxisAlignment = CrossAxisAlignment.center,
|
||||
});
|
||||
|
||||
final Function() onPressed;
|
||||
@@ -52,6 +56,8 @@ class Button extends StatelessWidget {
|
||||
final bool disabled;
|
||||
final double fontSize;
|
||||
final TextStyle? labelStyle;
|
||||
final MainAxisAlignment mainAxisAlignment;
|
||||
final CrossAxisAlignment crossAxisAlignment;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -70,8 +76,8 @@ class Button extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: mainAxisAlignment,
|
||||
crossAxisAlignment: crossAxisAlignment,
|
||||
children: [
|
||||
icon ?? const SizedBox.shrink(),
|
||||
if (icon != null) const SizedBox(width: 10.0),
|
||||
@@ -104,7 +110,8 @@ class Button extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: mainAxisAlignment,
|
||||
crossAxisAlignment: crossAxisAlignment,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
icon ?? const SizedBox.shrink(),
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
import 'package:enaklo_pos/core/components/spaces.dart';
|
||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomModalDialog extends StatelessWidget {
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
final Widget child;
|
||||
final VoidCallback? onClose;
|
||||
|
||||
const CustomModalDialog(
|
||||
{super.key,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
required this.child,
|
||||
this.onClose});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: AppColors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 200,
|
||||
maxWidth: 600,
|
||||
minHeight: 200,
|
||||
maxHeight: 600,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColors.primary,
|
||||
const Color.fromARGB(255, 67, 69, 195)
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppColors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
if (subtitle != null)
|
||||
Text(
|
||||
subtitle ?? '',
|
||||
style: TextStyle(
|
||||
color: AppColors.grey,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
IconButton(
|
||||
icon: Icon(Icons.close, color: AppColors.white),
|
||||
onPressed: () {
|
||||
if (onClose != null) {
|
||||
onClose!();
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
child,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
ThemeData getApplicationTheme = ThemeData(
|
||||
primaryColor: AppColors.primary,
|
||||
scaffoldBackgroundColor: AppColors.white,
|
||||
appBarTheme: AppBarTheme(
|
||||
color: AppColors.white,
|
||||
elevation: 0,
|
||||
titleTextStyle: GoogleFonts.quicksand(
|
||||
color: AppColors.primary,
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
iconTheme: const IconThemeData(
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
fontFamily: GoogleFonts.quicksand().fontFamily,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: AppColors.primary),
|
||||
useMaterial3: true,
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(color: AppColors.primary),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(color: AppColors.primary),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(color: AppColors.primary),
|
||||
),
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user