initialized Dashboard Page

This commit is contained in:
Mohammad Salameh
2024-02-20 12:08:59 +03:00
parent 0c390a8062
commit d27063f149
98 changed files with 1704 additions and 824 deletions

View File

@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'custom_text_widget.dart';
class BodyLarge extends StatelessWidget {
const BodyLarge({
required this.text,
super.key,
this.textAlign,
this.style,
this.height,
});
final String text;
final TextAlign? textAlign;
final TextStyle? style;
final double? height;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? context.bodyLarge.copyWith(height: height ?? 1.5),
textAlign: textAlign,
);
}

View File

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/custom_text_widget.dart';
import 'package:syncrow_app/utils/context_extension.dart';
class BodyMedium extends StatelessWidget {
const BodyMedium({
required this.text,
super.key,
this.style,
this.maxLines,
this.overflow,
this.textAlign,
});
final String text;
final TextStyle? style;
final int? maxLines;
final TextOverflow? overflow;
final TextAlign? textAlign;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? context.bodyMedium,
// softWrap: true,
maxLines: maxLines,
// overflow: overflow,
textAlign: textAlign,
);
}

View File

@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/custom_text_widget.dart';
import 'package:syncrow_app/utils/context_extension.dart';
class BodySmall extends StatelessWidget {
const BodySmall({
required this.text,
super.key,
this.style,
this.fontColor,
this.fontSize,
});
final String text;
final TextStyle? style;
final Color? fontColor;
final double? fontSize;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? context.bodySmall,
fontColor: fontColor,
fontSize: fontSize,
);
}

View File

@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class CustomText extends StatelessWidget {
const CustomText(this.text,
{super.key,
this.style,
this.textAlign,
this.onTap,
this.minLines,
this.maxLines,
this.textDirection,
this.fontSize,
this.fontColor});
final String text;
final TextStyle? style;
final TextAlign? textAlign;
final Function()? onTap;
final int? minLines;
final int? maxLines;
final TextDirection? textDirection;
final double? fontSize;
final Color? fontColor;
@override
Widget build(BuildContext context) {
return SelectableText(
text,
style: style!.copyWith(
fontSize: fontSize,
color: fontColor ?? ColorsManager.textPrimaryColor,
),
textAlign: textAlign,
onTap: onTap,
minLines: minLines,
maxLines: maxLines,
textDirection: textDirection,
);
}
}

View File

@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/custom_text_widget.dart';
class DisplayLarge extends StatelessWidget {
const DisplayLarge({
required this.text,
super.key,
this.style,
this.textAlign,
});
final String text;
final TextStyle? style;
final TextAlign? textAlign;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? Theme.of(context).textTheme.displayLarge,
textAlign: textAlign,
// softWrap: true,
);
}

View File

@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'custom_text_widget.dart';
class DisplayMedium extends StatelessWidget {
const DisplayMedium({
required this.text,
super.key,
this.style,
});
final String text;
final TextStyle? style;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? Theme.of(context).textTheme.displayMedium,
);
}

View File

@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'custom_text_widget.dart';
class DisplaySmall extends StatelessWidget {
const DisplaySmall({
required this.text,
super.key,
this.textAlign,
});
final String text;
final TextAlign? textAlign;
@override
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.only(bottom: 20),
child: CustomText(
text,
style: context.displaySmall,
textAlign: textAlign,
),
);
}

View File

@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/context_extension.dart';
class TitleLarge extends StatelessWidget {
const TitleLarge({
required this.text,
super.key,
});
final String text;
@override
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.only(top: 20, bottom: 10),
child: SelectableText(
text,
style: context.titleLarge,
),
);
}

View File

@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'custom_text_widget.dart';
class TitleMedium extends StatelessWidget {
const TitleMedium({
required this.text,
super.key,
this.maxLines,
this.textAlign,
this.style,
});
final String text;
final int? maxLines;
final TextAlign? textAlign;
final TextStyle? style;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? context.titleMedium,
maxLines: maxLines,
textAlign: textAlign,
);
}

View File

@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'custom_text_widget.dart';
class TitleSmall extends StatelessWidget {
const TitleSmall({
required this.text,
super.key,
this.style,
this.textAlign,
});
final String text;
final TextStyle? style;
final TextAlign? textAlign;
@override
Widget build(BuildContext context) => CustomText(
text,
style: style ?? context.titleSmall,
textAlign: textAlign,
);
}