From b5bbf56cb1a604ca357fadf95ad3d886478ec096 Mon Sep 17 00:00:00 2001 From: AhsanRns Date: Tue, 7 May 2024 10:37:52 +0500 Subject: [PATCH] feat: basic app architecture following easel app --- evently/lib/main.dart | 33 ++++++--- evently/lib/utils/evently_app_theme.dart | 73 +++++++++++++++++++ .../Flutter/GeneratedPluginRegistrant.swift | 2 + evently/pubspec.lock | 66 ++++++++++++++++- evently/pubspec.yaml | 1 + 5 files changed, 165 insertions(+), 10 deletions(-) create mode 100644 evently/lib/utils/evently_app_theme.dart diff --git a/evently/lib/main.dart b/evently/lib/main.dart index 5ebe108c9f..620fe85924 100644 --- a/evently/lib/main.dart +++ b/evently/lib/main.dart @@ -1,4 +1,5 @@ import 'package:easy_localization/easy_localization.dart'; +import 'package:evently/utils/evently_app_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -19,6 +20,8 @@ void main() { ); } +final navigatorKey = GlobalKey(); + class MyApp extends StatelessWidget { const MyApp({super.key}); @@ -26,14 +29,26 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return ScreenUtilInit( - minTextAdapt: true, - builder: (BuildContext context, child) => MaterialApp( - title: 'Evently', - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - ), - home: const Placeholder(), - )); + minTextAdapt: true, + builder: (BuildContext context, child) => MaterialApp( + builder: (context, widget) { + ScreenUtil.init(context); + return MediaQuery( + data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), + child: widget!, + ); + }, + localizationsDelegates: context.localizationDelegates, + supportedLocales: context.supportedLocales, + locale: context.locale, + title: 'Evently', + navigatorKey: navigatorKey, + theme: EventlyAppTheme.theme(context), + initialRoute: '/', + routes: { + '/': (context) => const Placeholder(), + }, + ), + ); } } diff --git a/evently/lib/utils/evently_app_theme.dart b/evently/lib/utils/evently_app_theme.dart new file mode 100644 index 0000000000..01924e6214 --- /dev/null +++ b/evently/lib/utils/evently_app_theme.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class EventlyAppTheme { + static const Color kWhite = Color(0xFFFFFFFF); + static const Color kBgColor = Color.fromRGBO(242, 239, 234, 1); + static const Color kGrey = Color(0xFF8D8C8C); + static const Color kLightGreyText = Color(0xFF9B9A9A); + static const Color kLightGrey = Color(0xFFC4C4C4); + static const Color kLightGrey02 = Color(0xFFF2EFEA); + static const Color kDarkGrey02 = Color(0xFF808080); + static const Color kDartGrey = Color(0xFF333333); + static const Color kDartGrey02 = Color(0xFFA1A1A1); + static const Color kLightGrey03 = Color(0xFFD9D9D9); + static const Color kBlack = Colors.black; + static const Color kTransparent = Colors.transparent; + static const Color kBlue = Color(0xFF1212C4); + static const Color kDarkText = Color(0xFF080830); + static const Color kLightText = Color(0xFF464545); + static const Color kNightBlue = Color(0xFF0A004A); + static const Color kLightWhiteBackground = Color(0xFFE5E5E5); + static const Color kRed = Color(0xFFFC4403); + static const Color kWhite02 = Color.fromRGBO(255, 255, 255, 0.2); + static const Color kWhite03 = Color(0xFFFBFBFB); + static const Color kPurple01 = Color.fromRGBO(18, 18, 196, 0.6); + static const Color kDarkBlue = Color.fromRGBO(18, 18, 196, 1); + static const Color kPurple02 = Color(0xFF4534CE); + static const Color kPurple03 = Color(0xFFCBC8F3); + static const Color kLightPurple = Color(0xFFB6B6E8); + static const Color kDarkGreen = Color(0xFF3A8977); + static const Color kYellow = Color(0xFFF3BA2F); + static const Color kLightYellow = Color(0xFFFED564); + static const Color kLightRed = Color(0xFFEF4421); + static const Color kBgWhite = Color(0xFFE5E5E5); + static const Color kLightBlackText = Color(0xFFA0A6AB); + static const Color kpurpleButtonColor = Color(0xFF8F8FCE); + static const Color kpurpleDark = Color(0xFF1212C4); + static const Color kTextGrey = Color(0xFF7A7A8F); + static const Color kGreyIcon = Color(0xFFAEAEAE); + static const Color kDarkPurple = Color(0xff0A004A); + + static const Color kLightGreyColor = Color(0xFFE5E5E5); + static const Color kPurple = Color(0xFF4421CC); + static const Color kHashtagColor = Color(0xFFB6B6E8); + + static const String universalSansFamily = "UniversalSans"; + + static ThemeData theme(BuildContext context) => ThemeData( + primaryColor: kWhite, + textTheme: GoogleFonts.interTextTheme(Theme.of(context).textTheme), + scaffoldBackgroundColor: kWhite, + visualDensity: VisualDensity.standard, + ); + + static Color cardBackground = const Color(0xFFC4C4C4).withOpacity(0.2); + static Color cardBackgroundSelected = const Color(0x801212C4).withOpacity(0.2); + + static TextStyle titleStyle = TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w800, + color: EventlyAppTheme.kBlack, + fontFamily: universalSansFamily, + ); + static TextStyle digitTextStyle = TextStyle( + fontSize: 20.sp, + fontWeight: FontWeight.w800, + color: EventlyAppTheme.kWhite, + fontFamily: universalSansFamily, + ); + + static TextStyle kDeleteHeaderTextStyle = TextStyle(fontSize: 14.sp, fontFamily: 'UniversalSans', color: EventlyAppTheme.kWhite, fontWeight: FontWeight.w600); +} diff --git a/evently/macos/Flutter/GeneratedPluginRegistrant.swift b/evently/macos/Flutter/GeneratedPluginRegistrant.swift index 724bb2ac32..b8e2b22f76 100644 --- a/evently/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/evently/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,10 @@ import FlutterMacOS import Foundation +import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/evently/pubspec.lock b/evently/pubspec.lock index 8af3e0b22a..9b371c0a60 100644 --- a/evently/pubspec.lock +++ b/evently/pubspec.lock @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" cupertino_icons: dependency: "direct main" description: @@ -133,6 +141,30 @@ packages: description: flutter source: sdk version: "0.0.0" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 + url: "https://pub.dev" + source: hosted + version: "6.2.1" + http: + dependency: transitive + description: + name: http + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" intl: dependency: transitive description: @@ -205,6 +237,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + url: "https://pub.dev" + source: hosted + version: "2.1.3" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + url: "https://pub.dev" + source: hosted + version: "2.3.2" path_provider_linux: dependency: transitive description: @@ -354,6 +410,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" vector_math: dependency: transitive description: @@ -396,4 +460,4 @@ packages: version: "1.0.4" sdks: dart: ">=3.3.4 <4.0.0" - flutter: ">=3.19.0" + flutter: ">=3.19.2" diff --git a/evently/pubspec.yaml b/evently/pubspec.yaml index a936584545..c7d428ee02 100644 --- a/evently/pubspec.yaml +++ b/evently/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: cupertino_icons: ^1.0.6 easy_localization: ^3.0.6 flutter_screenutil: ^5.9.0 + google_fonts: ^6.2.1 dev_dependencies: flutter_test: