Gradle updated, fonts added & structure improvements

merge-requests/1/merge
Sikander Saleem 4 years ago
parent ac98216630
commit 8470495332

2
.gitignore vendored

@ -3,7 +3,9 @@
*.log *.log
*.pyc *.pyc
*.swp *.swp
*.lock
.DS_Store .DS_Store
pubspec.lock
.atom/ .atom/
.buildlog/ .buildlog/
.history .history

@ -22,6 +22,11 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file # `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint. # producing the lint.
rules: rules:
always_specify_types: true
always_declare_return_types: true
always_use_package_imports: true
avoid_empty_else: true
avoid_annotating_with_dynamic: true
# avoid_print: false # Uncomment to disable the `avoid_print` rule # avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 30 compileSdkVersion 31
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8

@ -1,12 +1,12 @@
buildscript { buildscript {
ext.kotlin_version = '1.3.50' ext.kotlin_version = '1.6.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

@ -1,12 +1,10 @@
// import 'package:firebase_crashlytics/firebase_crashlytics.dart'; // import 'package:firebase_crashlytics/firebase_crashlytics.dart';
// import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/config/background_loader.dart';
import 'package:mohem_flutter_app/repo/account_repository.dart'; import 'package:mohem_flutter_app/repo/account_repository.dart';
import 'package:injector/injector.dart'; import 'package:injector/injector.dart';
import 'background_loader.dart';
class AppDependencies { class AppDependencies {
static void addDependencies() { static void addDependencies() {
Injector injector = Injector.appInstance; Injector injector = Injector.appInstance;

@ -1,4 +1,5 @@
import 'package:mohem_flutter_app/pages/login/login_screen.dart';
import 'package:mohem_flutter_app/pages/user/splash_page.dart'; import 'package:mohem_flutter_app/pages/user/splash_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -7,22 +8,14 @@ class AppRoutes {
static final String splash = "/splash"; static final String splash = "/splash";
static final String registerSelection = "/registerSelection"; static final String registerSelection = "/registerSelection";
static final String loginVerifyAccount = "/loginVerifyAccount"; static final String loginVerifyAccount = "/loginVerifyAccount";
static final String register = "/register"; static final String login = "/login";
static final String forgetPassword = "/forgetPassword"; static final String forgetPassword = "/forgetPassword";
static final String loginVerification = "/loginVerification"; static final String loginVerification = "/loginVerification";
static final String dashboard = "/dashboard"; static final String dashboard = "/dashboard";
static final String completeProfile = "/completeProfile";
static final String profile1 = "/profile1";
static final String profile2 = "/profile2";
static final String profile3 = "/profile3";
static final String initialRoute = login;
static final String initialRoute = splash;
static final Map<String, WidgetBuilder> routes = { static final Map<String, WidgetBuilder> routes = {
//User login: (context) => LoginScreen(),
splash: (context) => SplashPage(),
}; };
} }

@ -1,16 +1,14 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/config/app_provider.dart'; import 'package:mohem_flutter_app/config/app_provider.dart';
import 'package:mohem_flutter_app/config/dependencies.dart'; import 'package:mohem_flutter_app/config/dependencies.dart';
import 'package:mohem_flutter_app/theme/app_theme.dart'; import 'package:mohem_flutter_app/theme/app_theme.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart'; import 'package:sizer/sizer.dart';
import 'config/localization.dart';
import 'config/routes.dart'; import 'config/routes.dart';
Future<void> main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized(); await EasyLocalization.ensureInitialized();
runApp( runApp(
EasyLocalization( EasyLocalization(
@ -35,7 +33,7 @@ class MyApp extends StatelessWidget {
child: Sizer( child: Sizer(
builder: (context, orientation, deviceType) { builder: (context, orientation, deviceType) {
return MaterialApp( return MaterialApp(
theme: AppTheme.getTheme(), theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "en"),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
localizationsDelegates: context.localizationDelegates, localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales, supportedLocales: context.supportedLocales,

@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
class LoginScreen extends StatefulWidget {
LoginScreen({Key? key}) : super(key: key);
@override
_LoginScreenState createState() {
return _LoginScreenState();
}
}
class _LoginScreenState extends State<LoginScreen> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Row(
children: [
Text("English"),
Text("Arabic"),
],
),
],
),
);
}
}

@ -5,8 +5,6 @@ import 'dart:async';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:path/path.dart';
import 'package:injector/injector.dart';
abstract class IHttpService { abstract class IHttpService {
Future<Response> post(url, Future<Response> post(url,

@ -1,23 +1,53 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/theme/colors.dart';
import 'colors.dart';
class AppTheme { class AppTheme {
static getTheme() => ThemeData( static getTheme(isArabic) => ThemeData(
// This is the theme of your application. fontFamily: isArabic ? 'Cairo' : 'Poppins',
// primarySwatch: Colors.red,
// Try running your application with "flutter run". You'll see the visualDensity: VisualDensity.adaptivePlatformDensity,
// application has a blue toolbar. Then, without quitting the app, try brightness: Brightness.light,
// changing the primarySwatch below to Colors.green and then invoke pageTransitionsTheme: const PageTransitionsTheme(
// "hot reload" (press "r" in the console where you ran "flutter run", builders: {
// or simply save your changes to "hot reload" in a Flutter IDE). TargetPlatform.android: ZoomPageTransitionsBuilder(),
// Notice that the counter didn't reset back to zero; the application TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// is not restarted. },
),
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: const Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: const Color(0xffF8F8F8),
textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey),
canvasColor: Colors.white,
backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: primaryColor, primaryColor: primaryColor,
primarySwatch: Colors.blue, primaryColorDark: primaryColor,
backgroundColor: Colors.white, buttonColor: Colors.black,
primaryTextTheme: TextTheme( toggleableActiveColor: secondaryColor,
headline6: TextStyle(color: Colors.white), indicatorColor: secondaryColor,
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: Color(0xFFE0E0E0),
),
primaryTextTheme: const TextTheme(
bodyText2: TextStyle(color: Colors.white),
),
iconTheme: const IconThemeData(),
textTheme: const TextTheme(
bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6),
headline1: TextStyle(color: Colors.white, letterSpacing: 0.6),
headline2: TextStyle(color: Colors.white, letterSpacing: 0.6),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2),
appBarTheme: AppBarTheme(
color: const Color(0xff515A5D),
brightness: Brightness.light,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],
),
), ),
); );
} }

@ -1,13 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
const Color primaryColor = Colors.white; const Color primaryColor = Color(0xffF8F8F8);
const Color secondaryColor = Color(0xff2BB8A6);
const Color accentColor = Colors.blue; const Color accentColor = Colors.blue;
const Color appBackgroundColor = Colors.white; const Color appBackgroundColor = Colors.white;
Color? accentColorDark = Colors.green[800]; Color? accentColorDark = Colors.green[800];
const Color borderColor = Colors.blueGrey; const Color borderColor = Colors.blueGrey;
Color? borderLightColor = Colors.blueGrey[50]; Color? borderLightColor = Colors.blueGrey[50];
Color backgroudColor = Color backgroudColor = Colors.blueGrey[50]!.withOpacity(0.5);
Colors.blueGrey[50]!.withOpacity(0.5) ?? Colors.transparent;
const Color iconColor = Colors.blueGrey; const Color iconColor = Colors.blueGrey;
Color? headingColor = Colors.blueGrey[800]; Color? headingColor = Colors.blueGrey[800];
Color? txtColor = Colors.blueGrey[500]; Color? txtColor = Colors.blueGrey[500];

@ -63,7 +63,7 @@ Widget mDivider3({double? h}) {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: h ?? 1, height: h ?? 1,
color: borderLightColor!.withOpacity(0.7) ?? Colors.transparent, color: borderLightColor!.withOpacity(0.7)
); );
} }

@ -14,7 +14,7 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.1" version: "2.8.2"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -28,7 +28,7 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
@ -122,7 +122,7 @@ packages:
name: flutter_svg name: flutter_svg
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.22.0" version: "1.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -181,7 +181,7 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10" version: "0.12.11"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -209,14 +209,14 @@ packages:
name: path_drawing name: path_drawing
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.1+1" version: "1.0.0"
path_parsing: path_parsing:
dependency: transitive dependency: transitive
description: description:
name: path_parsing name: path_parsing
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.1" version: "1.0.0"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
@ -272,7 +272,7 @@ packages:
name: permission_handler name: permission_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.1.0" version: "8.3.0"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -424,7 +424,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.2" version: "0.4.3"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -445,7 +445,7 @@ packages:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
win32: win32:
dependency: transitive dependency: transitive
description: description:

@ -33,14 +33,14 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.4
path_provider: ^2.0.4 path_provider: ^2.0.8
injector: ^2.0.0 injector: ^2.0.0
provider: ^6.0.0 provider: ^6.0.1
easy_localization: ^3.0.0 easy_localization: ^3.0.0
http: ^0.13.3 http: ^0.13.4
permission_handler: 7.1.0 permission_handler: ^8.3.0
flutter_svg: ^0.22.0 flutter_svg: ^1.0.0
sizer: ^2.0.15 sizer: ^2.0.15
@ -53,7 +53,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^1.0.0 flutter_lints: ^1.0.4
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
@ -87,17 +87,40 @@ flutter:
# "family" key with the font family name, and a "fonts" key with a # "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For # list giving the asset and other descriptors for the font. For
# example: # example:
# fonts: fonts:
# - family: Schyler - family: Cairo
# fonts: fonts:
# - asset: fonts/Schyler-Regular.ttf - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.eot
# - asset: fonts/Schyler-Italic.ttf - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.otf
# style: italic - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.ttf
# - family: Trajan Pro - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.woff
# fonts: weight: 300
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot
# weight: 700 - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf
- asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf
- asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff
weight: 700
- family: Poppins
fonts:
- asset: assets/fonts/poppins/Poppins-Black.ttf
weight: 900
- asset: assets/fonts/poppins/Poppins-ExtraBold.ttf
weight: 800
- asset: assets/fonts/poppins/Poppins-Bold.ttf
weight: 700
- asset: assets/fonts/poppins/Poppins-SemiBold.ttf
weight: 600
- asset: assets/fonts/poppins/Poppins-Medium.ttf
weight: 500
- asset: assets/fonts/poppins/Poppins-Regular.ttf
weight: 400
- asset: assets/fonts/poppins/Poppins-Light.ttf
weight: 300
- asset: assets/fonts/poppins/Poppins-ExtraLight.ttf
weight: 200
- asset: assets/fonts/poppins/Poppins-Thin.ttf
weight: 100
# #
# For details regarding fonts from package dependencies, # For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages

Loading…
Cancel
Save