Skip to content

Commit

Permalink
♻️ Refactored code with lints
Browse files Browse the repository at this point in the history
  • Loading branch information
shashiben committed Oct 15, 2021
1 parent f7646e3 commit ff8990c
Show file tree
Hide file tree
Showing 60 changed files with 883 additions and 983 deletions.
11 changes: 0 additions & 11 deletions anaylsis_options.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions lib/app/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import 'package:flutter/material.dart';

mixin lightColor {
//** Theme Colors
static Color primaryColor = Color(0xFF31344B);
static Color backgroundColor = Color(0xFFe6e7ee);
static Color surfaceColor = Color(0xFFe6e7ee);
static Color primaryColor = const Color(0xFF31344B);
static Color backgroundColor = const Color(0xFFe6e7ee);
static Color surfaceColor = const Color(0xFFe6e7ee);

//** Text Colors
static Color textPrimaryColor = Color(0xFF31344B);
static Color textSecondaryColor = Color(0xFF44476A);
static Color textPrimaryColor = const Color(0xFF31344B);
static Color textSecondaryColor = const Color(0xFF44476A);

static Color? dividerColor = Colors.grey[300];
}
Expand Down
13 changes: 7 additions & 6 deletions lib/app/configs.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:flutter/material.dart';
import 'package:portfolio/app/icons.dart';
import 'package:portfolio/core/models/project.dart';
import 'package:portfolio/core/models/skill_display.dart';
import 'package:portfolio/core/models/skill_model.dart';
import 'package:portfolio/core/models/technologies.dart';
import 'package:portfolio/core/models/timeline_experience.dart';

import '../core/models/project.dart';
import '../core/models/skill_display.dart';
import '../core/models/skill_model.dart';
import '../core/models/technologies.dart';
import '../core/models/timeline_experience.dart';
import 'icons.dart';

//*Social Media Links
mixin SocialLinks {
Expand Down
5 changes: 2 additions & 3 deletions lib/app/theme.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import 'package:portfolio/app/colors.dart';
import 'colors.dart';

final neumorphicLightTheme = NeumorphicThemeData(
shadowLightColorEmboss: lightColor.backgroundColor,
intensity: 0.4,
baseColor: lightColor.surfaceColor,
depth: 8,
lightSource: LightSource.topLeft,
iconTheme: IconThemeData(color: lightColor.primaryColor));
final neumorphicDarkTheme = NeumorphicThemeData(
const neumorphicDarkTheme = NeumorphicThemeData(
intensity: 0.3,
shadowDarkColor: darkColor.backgroundColor,
baseColor: darkColor.backgroundColor,
Expand Down
13 changes: 7 additions & 6 deletions lib/core/utils/ScreenUiHelper.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import 'package:portfolio/app/colors.dart';
import 'package:portfolio/app/configs.dart';
import 'package:portfolio/core/utils/scaling.dart';
import 'package:responsive_builder/responsive_builder.dart';

import '../../app/colors.dart';
import '../../app/configs.dart';
import 'scaling.dart';

class ScreenUiHelper {
double? width;
double? height;
Expand Down Expand Up @@ -43,7 +44,7 @@ class ScreenUiHelper {
SizedBox? horizontalSpaceHigh;

ScreenUiHelper.fromContext(BuildContext context) {
var mediaQuery = MediaQuery.of(context);
final mediaQuery = MediaQuery.of(context);

surfaceColor = NeumorphicTheme.of(context)!.isUsingDark
? darkColor.surfaceColor
Expand All @@ -64,8 +65,8 @@ class ScreenUiHelper {
? darkColor.dividerColor
: lightColor.dividerColor;

double screenWidth = mediaQuery.size.width;
double screenHeight = mediaQuery.size.height;
final double screenWidth = mediaQuery.size.width;
final double screenHeight = mediaQuery.size.height;
width = screenWidth;
height = screenHeight;

Expand Down
6 changes: 3 additions & 3 deletions lib/core/utils/adaptive.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:responsive_builder/responsive_builder.dart';
import 'package:flutter/foundation.dart';

enum DisplayType {
desktop,
Expand Down Expand Up @@ -101,7 +101,7 @@ double assignHeight({
double additions = 0,
double subs = 0,
}) {
return (heightOfScreen(context) - (subs) + (additions)) * fraction;
return (heightOfScreen(context) - subs + additions) * fraction;
}

//
Expand All @@ -111,5 +111,5 @@ double assignWidth({
double additions = 0,
double subs = 0,
}) {
return (widthOfScreen(context) - (subs) + (additions)) * fraction;
return (widthOfScreen(context) - subs + additions) * fraction;
}
8 changes: 4 additions & 4 deletions lib/core/utils/architecture_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ScreenBuilder<T extends BaseViewModel> extends StatelessWidget {
final T? viewModel;
final Function(T)? onModelReady;

ScreenBuilder(
const ScreenBuilder(
{Key? key,
this.builder,
this.viewModel,
Expand All @@ -21,12 +21,12 @@ class ScreenBuilder<T extends BaseViewModel> extends StatelessWidget {

@override
Widget build(BuildContext context) {
ScreenUiHelper uiHelpers = ScreenUiHelper.fromContext(context);
final ScreenUiHelper uiHelpers = ScreenUiHelper.fromContext(context);

if (isReactive) {
return ViewModelBuilder<T>.reactive(
disposeViewModel: disposeViewModel,
onModelReady: onModelReady ?? null,
onModelReady: onModelReady,
viewModelBuilder: () => viewModel!,
builder: (context, model, child) => SafeArea(
child: Scaffold(
Expand All @@ -38,7 +38,7 @@ class ScreenBuilder<T extends BaseViewModel> extends StatelessWidget {
builder: (context, model, child) =>
SafeArea(child: builder!(context, uiHelpers, model)),
disposeViewModel: disposeViewModel,
onModelReady: onModelReady ?? null,
onModelReady: onModelReady,
viewModelBuilder: () => viewModel!);
}
}
Expand Down
79 changes: 0 additions & 79 deletions lib/core/utils/bootstrap/bootstrap_constants.dart

This file was deleted.

Loading

0 comments on commit ff8990c

Please sign in to comment.