first commit
This commit is contained in:
6
lib/core/constant_variables/const_enums.dart
Normal file
6
lib/core/constant_variables/const_enums.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
///___________Party_Payment_type
|
||||
enum PartyOpeningBalanceType {
|
||||
due,
|
||||
advance,
|
||||
}
|
||||
4
lib/core/constant_variables/local_data_saving_keys.dart
Normal file
4
lib/core/constant_variables/local_data_saving_keys.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
class LocalDataBaseSavingKey {
|
||||
static String skipOnBodingKey = 'skip_on_boding';
|
||||
static String tokenKey = 'token';
|
||||
}
|
||||
27
lib/core/theme/_app_colors.dart
Normal file
27
lib/core/theme/_app_colors.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'dart:ui';
|
||||
|
||||
abstract class DAppColors {
|
||||
static const kPrimary = Color(0xffC52127);
|
||||
static const kOnPrimary = Color(0xffFFFFFF);
|
||||
|
||||
static const kSecondary = Color(0xff808191);
|
||||
static const kOnSecondary = Color(0xffFFFFFF);
|
||||
|
||||
static const kSurfaceLight = Color(0xffFFFFFF);
|
||||
static const kOnSurfaceLight = Color(0xff1F1F1F);
|
||||
|
||||
static const kPrimaryContainerLight = Color(0xffFFFFFF);
|
||||
static const kOnPrimaryContainerLight = Color(0xff1F1F1F);
|
||||
|
||||
static const kBorder = Color(0xff7E7E7E);
|
||||
|
||||
static const kNeutral700 = Color(0xff4D4D4D);
|
||||
|
||||
static const kNeutralColor = Color(0xff09160C);
|
||||
static const kDividerColor = Color(0xFFD7D9DE);
|
||||
|
||||
static const kWarning = Color(0xffFF900C);
|
||||
static const kInfo = Color(0xff2400FF);
|
||||
static const kSuccess = Color(0xff00B243);
|
||||
static const kError = Color(0xffF23B3D);
|
||||
}
|
||||
195
lib/core/theme/theme.dart
Normal file
195
lib/core/theme/theme.dart
Normal file
@@ -0,0 +1,195 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mobile_pos/constant.dart';
|
||||
|
||||
import '_app_colors.dart';
|
||||
|
||||
abstract class AcnooTheme {
|
||||
static const _fontFamily = 'NotoSans';
|
||||
|
||||
static ThemeData kLightTheme(BuildContext context) {
|
||||
final mainTheme = ThemeData.light();
|
||||
final textTheme = _getTextTheme(mainTheme.textTheme);
|
||||
return mainTheme.copyWith(
|
||||
textTheme: textTheme,
|
||||
scaffoldBackgroundColor: Colors.transparent,
|
||||
snackBarTheme: _getSnackBarTheme(),
|
||||
appBarTheme: const AppBarTheme(
|
||||
surfaceTintColor: Colors.white,
|
||||
titleTextStyle: TextStyle(
|
||||
fontSize: 20,
|
||||
fontFamily: 'NotoSans',
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
dropdownMenuTheme: const DropdownMenuThemeData(
|
||||
textStyle: TextStyle(color: kTitleColor, fontSize: 16.0, fontWeight: FontWeight.normal),
|
||||
menuStyle: MenuStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(Colors.white),
|
||||
surfaceTintColor: WidgetStatePropertyAll(Colors.white),
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
hintStyle: TextStyle(color: kNeutralColor, fontSize: 14.0, fontWeight: FontWeight.normal),
|
||||
labelStyle: TextStyle(color: kTitleColor, fontSize: 16.0, fontWeight: FontWeight.normal),
|
||||
iconColor: kGreyTextColor,
|
||||
contentPadding: EdgeInsets.only(left: 10.0, right: 7.0),
|
||||
),
|
||||
),
|
||||
dialogBackgroundColor: Colors.white,
|
||||
dividerTheme: const DividerThemeData(
|
||||
color: DAppColors.kDividerColor,
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
suffixIconColor: kGreyTextColor,
|
||||
iconColor: kGreyTextColor,
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
focusColor: kMainColor,
|
||||
outlineBorder: const BorderSide(color: Color(0xFFD7D9DE), width: 1.0),
|
||||
hintStyle: const TextStyle(color: kNeutralColor, fontSize: 16.0, fontWeight: FontWeight.normal),
|
||||
labelStyle: const TextStyle(color: kTitleColor, fontSize: 16.0, fontWeight: FontWeight.normal),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
borderSide: const BorderSide(color: kMainColor, width: 1.0),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
borderSide: const BorderSide(color: Color(0xFFD7D9DE), width: 1.0),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
borderSide: const BorderSide(color: Color(0xFFb00020), width: 1.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
borderSide: const BorderSide(color: DAppColors.kPrimary, width: 1.0),
|
||||
),
|
||||
contentPadding: const EdgeInsets.only(left: 10.0, right: 7.0),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
borderSide: const BorderSide(color: Color(0xFFD7D9DE), width: 1.0),
|
||||
),
|
||||
filled: false,
|
||||
fillColor: Colors.white,
|
||||
),
|
||||
colorScheme: const ColorScheme.light(surface: kWhite, primary: kMainColor, primaryContainer: kWhite, outline: kBorderColor),
|
||||
elevatedButtonTheme: _getElevatedButtonTheme(textTheme),
|
||||
outlinedButtonTheme: _getOutlineButtonTheme,
|
||||
pageTransitionsTheme: PageTransitionsTheme(
|
||||
builders: {
|
||||
TargetPlatform.android: CustomPageTransitionBuilder(),
|
||||
TargetPlatform.iOS: CustomPageTransitionBuilder(),
|
||||
// You can define transitions for other platforms if needed
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//------------------Elevated Button Theme------------------//
|
||||
static const _buttonPadding = EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
vertical: 12,
|
||||
);
|
||||
|
||||
//------------------snackbar theme------------------------
|
||||
static SnackBarThemeData _getSnackBarTheme() {
|
||||
return const SnackBarThemeData(
|
||||
backgroundColor: Color(0xff333333), // Change this to your desired color
|
||||
actionTextColor: Colors.white, // Change action button text color if needed
|
||||
contentTextStyle: TextStyle(color: Colors.white), // Change the toast message color
|
||||
);
|
||||
}
|
||||
|
||||
static const _buttonDensity = VisualDensity.standard;
|
||||
|
||||
static ElevatedButtonThemeData _getElevatedButtonTheme(TextTheme baseTextTheme) {
|
||||
return ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: _buttonPadding,
|
||||
visualDensity: _buttonDensity,
|
||||
foregroundColor: DAppColors.kOnPrimary,
|
||||
backgroundColor: DAppColors.kPrimary,
|
||||
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'NotoSans'),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||
minimumSize: const Size.fromHeight(48),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
static final _getOutlineButtonTheme = OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
visualDensity: _buttonDensity,
|
||||
padding: _buttonPadding,
|
||||
side: const BorderSide(color: kMainColor),
|
||||
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'NotoSans'),
|
||||
foregroundColor: kMainColor,
|
||||
minimumSize: const Size.fromHeight(48),
|
||||
),
|
||||
);
|
||||
|
||||
static TextTheme _getTextTheme(TextTheme baseTextTheme) {
|
||||
return baseTextTheme.copyWith(
|
||||
displayLarge: baseTextTheme.displayLarge?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
displayMedium: baseTextTheme.displayMedium?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
displaySmall: baseTextTheme.displaySmall?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
headlineLarge: baseTextTheme.headlineLarge?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
headlineMedium: baseTextTheme.headlineMedium?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
headlineSmall: baseTextTheme.headlineSmall?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
titleLarge: baseTextTheme.titleLarge?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
titleMedium: baseTextTheme.titleMedium?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
titleSmall: baseTextTheme.titleSmall?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
bodyLarge: baseTextTheme.bodyLarge?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
bodyMedium: baseTextTheme.bodyMedium?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
bodySmall: baseTextTheme.bodySmall?.copyWith(fontFamily: _fontFamily, color: kNeutralColor),
|
||||
labelLarge: baseTextTheme.labelLarge?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
labelMedium: baseTextTheme.labelMedium?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
labelSmall: baseTextTheme.labelSmall?.copyWith(
|
||||
fontFamily: _fontFamily,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomPageTransitionBuilder extends PageTransitionsBuilder {
|
||||
@override
|
||||
Widget buildTransitions<T>(
|
||||
PageRoute<T> route,
|
||||
BuildContext context,
|
||||
Animation<double> animation,
|
||||
Animation<double> secondaryAnimation,
|
||||
Widget child,
|
||||
) {
|
||||
return FadeTransition(
|
||||
opacity: Tween<double>(begin: 0.0, end: 1.0).animate(CurvedAnimation(parent: animation, curve: Curves.easeInOut)),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
29
lib/core/thermal_receipt_widgets/sale_receipt_widget.dart
Normal file
29
lib/core/thermal_receipt_widgets/sale_receipt_widget.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../thermal priting invoices/model/print_transaction_model.dart';
|
||||
|
||||
final GlobalKey screenshotGlobalKey = GlobalKey();
|
||||
|
||||
class SaleReceiptWidget extends StatelessWidget {
|
||||
const SaleReceiptWidget({super.key, required this.paperSize, required this.model});
|
||||
final String paperSize;
|
||||
final PrintSalesTransactionModel model;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RepaintBoundary(
|
||||
key: screenshotGlobalKey,
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
width: paperSize == "58 mm" ? 384 : 576,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(model.personalInformationModel.data?.companyName ?? "", style: Theme.of(context).textTheme.titleLarge),
|
||||
Text(model.personalInformationModel.data?.address ?? "", style: Theme.of(context).textTheme.bodyLarge),
|
||||
Text(model.personalInformationModel.data?.phoneNumber ?? "", style: Theme.of(context).textTheme.bodyLarge),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user