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
*.pyc
*.swp
*.lock
.DS_Store
pubspec.lock
.atom/
.buildlog/
.history

@ -22,6 +22,11 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
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
# 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"
android {
compileSdkVersion 30
compileSdkVersion 31
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.0'
repositories {
google()
mavenCentral()
}
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"
}
}

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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:flutter/material.dart';
import 'package:mohem_flutter_app/config/background_loader.dart';
import 'package:mohem_flutter_app/repo/account_repository.dart';
import 'package:injector/injector.dart';
import 'background_loader.dart';
class AppDependencies {
static void addDependencies() {
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:flutter/material.dart';
@ -7,22 +8,14 @@ class AppRoutes {
static final String splash = "/splash";
static final String registerSelection = "/registerSelection";
static final String loginVerifyAccount = "/loginVerifyAccount";
static final String register = "/register";
static final String login = "/login";
static final String forgetPassword = "/forgetPassword";
static final String loginVerification = "/loginVerification";
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 = splash;
static final String initialRoute = login;
static final Map<String, WidgetBuilder> routes = {
//User
splash: (context) => SplashPage(),
login: (context) => LoginScreen(),
};
}

@ -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/dependencies.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 'config/localization.dart';
import 'config/routes.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
runApp(
EasyLocalization(
@ -35,7 +33,7 @@ class MyApp extends StatelessWidget {
child: Sizer(
builder: (context, orientation, deviceType) {
return MaterialApp(
theme: AppTheme.getTheme(),
theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "en"),
debugShowCheckedModeBanner: false,
localizationsDelegates: context.localizationDelegates,
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';
import 'package:path/path.dart';
import 'package:injector/injector.dart';
abstract class IHttpService {
Future<Response> post(url,

@ -1,23 +1,53 @@
import 'package:flutter/material.dart';
import 'colors.dart';
import 'package:mohem_flutter_app/theme/colors.dart';
class AppTheme {
static getTheme() => ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
static getTheme(isArabic) => ThemeData(
fontFamily: isArabic ? 'Cairo' : 'Poppins',
primarySwatch: Colors.red,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
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,
primarySwatch: Colors.blue,
backgroundColor: Colors.white,
primaryTextTheme: TextTheme(
headline6: TextStyle(color: Colors.white),
primaryColorDark: primaryColor,
buttonColor: Colors.black,
toggleableActiveColor: secondaryColor,
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';
const Color primaryColor = Colors.white;
const Color primaryColor = Color(0xffF8F8F8);
const Color secondaryColor = Color(0xff2BB8A6);
const Color accentColor = Colors.blue;
const Color appBackgroundColor = Colors.white;
Color? accentColorDark = Colors.green[800];
const Color borderColor = Colors.blueGrey;
Color? borderLightColor = Colors.blueGrey[50];
Color backgroudColor =
Colors.blueGrey[50]!.withOpacity(0.5) ?? Colors.transparent;
Color backgroudColor = Colors.blueGrey[50]!.withOpacity(0.5);
const Color iconColor = Colors.blueGrey;
Color? headingColor = Colors.blueGrey[800];
Color? txtColor = Colors.blueGrey[500];

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

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

@ -33,14 +33,14 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
path_provider: ^2.0.4
cupertino_icons: ^1.0.4
path_provider: ^2.0.8
injector: ^2.0.0
provider: ^6.0.0
provider: ^6.0.1
easy_localization: ^3.0.0
http: ^0.13.3
permission_handler: 7.1.0
flutter_svg: ^0.22.0
http: ^0.13.4
permission_handler: ^8.3.0
flutter_svg: ^1.0.0
sizer: ^2.0.15
@ -53,7 +53,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# 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
# 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
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
fonts:
- family: Cairo
fonts:
- asset: assets/fonts/ar/Cairo-Light/Cairo-Light.eot
- asset: assets/fonts/ar/Cairo-Light/Cairo-Light.otf
- asset: assets/fonts/ar/Cairo-Light/Cairo-Light.ttf
- asset: assets/fonts/ar/Cairo-Light/Cairo-Light.woff
weight: 300
- asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot
- 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,
# see https://flutter.dev/custom-fonts/#from-packages

Loading…
Cancel
Save