feat: Initialize project
This commit is contained in:
9
lib/ui/common/app_colors.dart
Normal file
9
lib/ui/common/app_colors.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const Color kcPrimaryColor = Color(0xFF9600FF);
|
||||
const Color kcPrimaryColorDark = Color(0xFF300151);
|
||||
const Color kcDarkGreyColor = Color(0xFF1A1B1E);
|
||||
const Color kcMediumGrey = Color(0xFF474A54);
|
||||
const Color kcLightGrey = Color.fromARGB(255, 187, 187, 187);
|
||||
const Color kcVeryLightGrey = Color(0xFFE3E3E3);
|
||||
const Color kcBackgroundColor = kcDarkGreyColor;
|
||||
3
lib/ui/common/app_strings.dart
Normal file
3
lib/ui/common/app_strings.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
const String ksHomeBottomSheetTitle = 'Build Great Apps!';
|
||||
const String ksHomeBottomSheetDescription =
|
||||
'Stacked is built to help you build better apps. Give us a chance and we\'ll prove it to you. Check out stacked.filledstacks.com to learn more';
|
||||
78
lib/ui/common/ui_helpers.dart
Normal file
78
lib/ui/common/ui_helpers.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const double _tinySize = 5.0;
|
||||
const double _smallSize = 10.0;
|
||||
const double _mediumSize = 25.0;
|
||||
const double _largeSize = 50.0;
|
||||
const double _massiveSize = 120.0;
|
||||
|
||||
const Widget horizontalSpaceTiny = SizedBox(width: _tinySize);
|
||||
const Widget horizontalSpaceSmall = SizedBox(width: _smallSize);
|
||||
const Widget horizontalSpaceMedium = SizedBox(width: _mediumSize);
|
||||
const Widget horizontalSpaceLarge = SizedBox(width: _largeSize);
|
||||
|
||||
const Widget verticalSpaceTiny = SizedBox(height: _tinySize);
|
||||
const Widget verticalSpaceSmall = SizedBox(height: _smallSize);
|
||||
const Widget verticalSpaceMedium = SizedBox(height: _mediumSize);
|
||||
const Widget verticalSpaceLarge = SizedBox(height: _largeSize);
|
||||
const Widget verticalSpaceMassive = SizedBox(height: _massiveSize);
|
||||
|
||||
Widget spacedDivider = const Column(
|
||||
children: <Widget>[
|
||||
verticalSpaceMedium,
|
||||
Divider(color: Colors.blueGrey, height: 5.0),
|
||||
verticalSpaceMedium,
|
||||
],
|
||||
);
|
||||
|
||||
Widget verticalSpace(double height) => SizedBox(height: height);
|
||||
|
||||
double screenWidth(BuildContext context) => MediaQuery.of(context).size.width;
|
||||
double screenHeight(BuildContext context) => MediaQuery.of(context).size.height;
|
||||
|
||||
double screenHeightFraction(BuildContext context,
|
||||
{int dividedBy = 1, double offsetBy = 0, double max = 3000}) =>
|
||||
min((screenHeight(context) - offsetBy) / dividedBy, max);
|
||||
|
||||
double screenWidthFraction(BuildContext context,
|
||||
{int dividedBy = 1, double offsetBy = 0, double max = 3000}) =>
|
||||
min((screenWidth(context) - offsetBy) / dividedBy, max);
|
||||
|
||||
double halfScreenWidth(BuildContext context) =>
|
||||
screenWidthFraction(context, dividedBy: 2);
|
||||
|
||||
double thirdScreenWidth(BuildContext context) =>
|
||||
screenWidthFraction(context, dividedBy: 3);
|
||||
|
||||
double quarterScreenWidth(BuildContext context) =>
|
||||
screenWidthFraction(context, dividedBy: 4);
|
||||
|
||||
double getResponsiveHorizontalSpaceMedium(BuildContext context) =>
|
||||
screenWidthFraction(context, dividedBy: 10);
|
||||
double getResponsiveSmallFontSize(BuildContext context) =>
|
||||
getResponsiveFontSize(context, fontSize: 14, max: 15);
|
||||
|
||||
double getResponsiveMediumFontSize(BuildContext context) =>
|
||||
getResponsiveFontSize(context, fontSize: 16, max: 17);
|
||||
|
||||
double getResponsiveLargeFontSize(BuildContext context) =>
|
||||
getResponsiveFontSize(context, fontSize: 21, max: 31);
|
||||
|
||||
double getResponsiveExtraLargeFontSize(BuildContext context) =>
|
||||
getResponsiveFontSize(context, fontSize: 25);
|
||||
|
||||
double getResponsiveMassiveFontSize(BuildContext context) =>
|
||||
getResponsiveFontSize(context, fontSize: 30);
|
||||
|
||||
double getResponsiveFontSize(BuildContext context,
|
||||
{double? fontSize, double? max}) {
|
||||
max ??= 100;
|
||||
|
||||
var responsiveSize = min(
|
||||
screenWidthFraction(context, dividedBy: 10) * ((fontSize ?? 100) / 100),
|
||||
max);
|
||||
|
||||
return responsiveSize;
|
||||
}
|
||||
Reference in New Issue
Block a user