Skip to content

Commit 8fbd3aa

Browse files
Merge pull request #16 from AhmedAbdoElhawary/fix/refactoring
Fix/refactoring
2 parents 1b44d4d + 6a9b2f3 commit 8fbd3aa

File tree

61 files changed

+226
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+226
-302
lines changed

android/app/build.gradle.kts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
1+
import java.util.Properties
2+
import java.io.FileInputStream
3+
14
plugins {
25
id("com.android.application")
36
id("kotlin-android")
47
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
58
id("dev.flutter.flutter-gradle-plugin")
69
}
710

11+
val keystoreProperties = Properties()
12+
val keystorePropertiesFile = rootProject.file("key.properties")
13+
if (keystorePropertiesFile.exists()) {
14+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
15+
}
16+
817
android {
9-
namespace = "com.example.algorithm_visualizer"
18+
namespace = "com.elhawary.algodive"
1019
compileSdk = flutter.compileSdkVersion
1120
ndkVersion = flutter.ndkVersion
1221

22+
signingConfigs {
23+
create("release") {
24+
keyAlias = keystoreProperties["keyAlias"] as String
25+
keyPassword = keystoreProperties["keyPassword"] as String
26+
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
27+
storePassword = keystoreProperties["storePassword"] as String
28+
}
29+
}
30+
1331
compileOptions {
1432
sourceCompatibility = JavaVersion.VERSION_11
1533
targetCompatibility = JavaVersion.VERSION_11
@@ -21,7 +39,7 @@ android {
2139

2240
defaultConfig {
2341
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24-
applicationId = "com.example.algorithm_visualizer"
42+
applicationId = "com.elhawary.algodive"
2543
// You can update the following values to match your application needs.
2644
// For more information, see: https://flutter.dev/to/review-gradle-config.
2745
minSdk = flutter.minSdkVersion
@@ -34,7 +52,7 @@ android {
3452
release {
3553
// TODO: Add your own signing config for the release build.
3654
// Signing with the debug keys for now, so `flutter run --release` works.
37-
signingConfig = signingConfigs.getByName("debug")
55+
signingConfig = signingConfigs.getByName("release")
3856
}
3957
}
4058
}

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
3-
android:label="algorithm_visualizer"
3+
android:label="AlgoDive"
44
android:name="${applicationName}"
55
android:enableOnBackInvokedCallback="true"
66
android:icon="@mipmap/ic_launcher"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.algorithm_visualizer
1+
package com.elhawary.algodive
22

33
import io.flutter.embedding.android.FlutterActivity
44

ios/Runner/Base.lproj/LaunchScreen.storyboard

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina6_12" orientation="portrait" appearance="light"/>
34
<dependencies>
45
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
68
</dependencies>
79
<scenes>
810
<!--View Controller-->
@@ -14,10 +16,15 @@
1416
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
1517
</layoutGuides>
1618
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
19+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
1720
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1821
<subviews>
19-
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI"/>
20-
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"></imageView>
22+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI">
23+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
24+
</imageView>
25+
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
26+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
27+
</imageView>
2128
</subviews>
2229
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2330
<constraints>
@@ -34,11 +41,11 @@
3441
</viewController>
3542
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
3643
</objects>
37-
<point key="canvasLocation" x="53" y="375"/>
44+
<point key="canvasLocation" x="80.916030534351137" y="264.08450704225356"/>
3845
</scene>
3946
</scenes>
4047
<resources>
41-
<image name="LaunchImage" width="1242" height="2688"/>
4248
<image name="LaunchBackground" width="1" height="1"/>
49+
<image name="LaunchImage" width="310.33334350585938" height="672"/>
4350
</resources>
4451
</document>
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina6_12" orientation="portrait" appearance="light"/>
34
<dependencies>
45
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
68
</dependencies>
79
<scenes>
810
<!--Flutter View Controller-->
@@ -14,13 +16,14 @@
1416
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
1517
</layoutGuides>
1618
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
19+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
1820
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2022
</view>
2123
</viewController>
2224
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2325
</objects>
26+
<point key="canvasLocation" x="-15" y="-40"/>
2427
</scene>
2528
</scenes>
2629
</document>

lib/config/themes/app_theme.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class AppTheme {
2525
surfaceTintColor: ColorManager.white,
2626
shadowColor: ColorManager.white,
2727
),
28-
dialogTheme: const DialogThemeData(surfaceTintColor: ColorManager.whiteD5),
28+
dialogTheme: const DialogThemeData(
29+
surfaceTintColor: ColorManager.whiteD5,
30+
backgroundColor: ColorManager.whiteD1,
31+
),
2932
dividerColor: ColorManager.blackOp10,
3033
scaffoldBackgroundColor: ColorManager.white,
3134
iconTheme: const IconThemeData(color: ColorManager.black),
@@ -44,7 +47,7 @@ class AppTheme {
4447
tabBarTheme: _tabBarTheme(),
4548
textTheme: _textTheme(),
4649
dividerTheme: const DividerThemeData(color: ColorManager.whiteD5),
47-
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.blackOp30),
50+
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.blackOp30),
4851
textSelectionTheme: const TextSelectionThemeData(
4952
cursorColor: ColorManager.teal,
5053
selectionColor: ColorManager.blackOp10,
@@ -151,7 +154,10 @@ class AppTheme {
151154
surfaceTintColor: ColorManager.blackL5,
152155
shadowColor: ColorManager.blackL5,
153156
),
154-
dialogTheme: const DialogThemeData(surfaceTintColor: ColorManager.blackL5),
157+
dialogTheme: const DialogThemeData(
158+
surfaceTintColor: ColorManager.blackL5,
159+
backgroundColor: ColorManager.blackL1,
160+
),
155161
dividerColor: ColorManager.whiteOp10,
156162
scaffoldBackgroundColor: ColorManager.blackBlue,
157163
iconTheme: const IconThemeData(color: ColorManager.white),
@@ -169,7 +175,7 @@ class AppTheme {
169175
tabBarTheme: _tabBarDarkTheme(),
170176
textTheme: _textDarkTheme(),
171177
dividerTheme: const DividerThemeData(color: ColorManager.blackL5),
172-
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.whiteOp30),
178+
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.whiteOp30),
173179
textSelectionTheme: const TextSelectionThemeData(
174180
cursorColor: ColorManager.teal,
175181
selectionColor: ColorManager.greyD6,

lib/core/draggable_progress.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ class LinearSliderState extends State<DraggableProgressBar> {
3030
@override
3131
Widget build(BuildContext context) {
3232
return Slider(
33-
activeColor: widget.isActive
34-
? context.getColor(ThemeEnum.mediumBlueColor)
35-
: context.getColor(ThemeEnum.whiteD7Color),
33+
activeColor:
34+
widget.isActive ? context.getColor(ThemeEnum.mediumBlueColor) : context.getColor(ThemeEnum.whiteD7Color),
3635
value: sliderValue,
3736
onChanged: (v) {
3837
setState(() {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
21
enum LanguagesEnum { english, arabic }

lib/core/extensions/navigators.dart

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import 'package:go_router/go_router.dart';
44

55
extension Navigators on BuildContext {
66
String? get currentRoute => ModalRoute.of(this)?.settings.name;
7-
(String?, Object?) get currentRouteSettings => (
8-
ModalRoute.of(this)?.settings.name,
9-
ModalRoute.of(this)?.settings.arguments
10-
);
7+
(String?, Object?) get currentRouteSettings =>
8+
(ModalRoute.of(this)?.settings.name, ModalRoute.of(this)?.settings.arguments);
119
void unFocusKeyboard() {
1210
try {
1311
if (mounted) FocusScope.of(this).unfocus();
@@ -53,9 +51,7 @@ extension Navigators on BuildContext {
5351

5452
final currentValue = currentRouteSettings.$2;
5553

56-
if (currentValue is Map &&
57-
currentRoute == path.name &&
58-
arguments == currentValue[path.pathParamsName]) {
54+
if (currentValue is Map && currentRoute == path.name && arguments == currentValue[path.pathParamsName]) {
5955
return;
6056
}
6157
}
@@ -64,13 +60,8 @@ extension Navigators on BuildContext {
6460
.pushNamed(
6561
path.name,
6662
extra: arguments,
67-
pathParameters: pathParametersRaw ??
68-
(pathParameters.isNotEmpty
69-
? {path.pathParamsName: pathParameters}
70-
: {}),
71-
queryParameters: queryParameters.isNotEmpty
72-
? {path.queryParamsName: queryParameters}
73-
: {},
63+
pathParameters: pathParametersRaw ?? (pathParameters.isNotEmpty ? {path.pathParamsName: pathParameters} : {}),
64+
queryParameters: queryParameters.isNotEmpty ? {path.queryParamsName: queryParameters} : {},
7465
)
7566
.then((value) {
7667
unFocusKeyboard();
@@ -87,8 +78,7 @@ extension Navigators on BuildContext {
8778
.pushReplacementNamed(
8879
path.name,
8980
extra: arguments,
90-
pathParameters:
91-
pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
81+
pathParameters: pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
9282
)
9383
.then((value) {
9484
unFocusKeyboard();
@@ -110,8 +100,7 @@ extension Navigators on BuildContext {
110100
.pushReplacementNamed(
111101
path.name,
112102
extra: arguments,
113-
pathParameters:
114-
pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
103+
pathParameters: pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
115104
)
116105
.then((value) {
117106
unFocusKeyboard();
@@ -133,8 +122,7 @@ extension Navigators on BuildContext {
133122
.pushNamed(
134123
path.name,
135124
extra: arguments,
136-
pathParameters:
137-
pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
125+
pathParameters: pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
138126
)
139127
.then((value) {
140128
unFocusKeyboard();

lib/core/helpers/app_bar/app_bar.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import 'package:algorithm_visualizer/core/widgets/adaptive/text/adaptive_text.da
66
import 'package:flutter/material.dart';
77

88
class CustomAppBar {
9-
static AppBar iconAppBar(
10-
{bool isShadowTransparent = true, bool withBackButton = true}) {
9+
static AppBar iconAppBar({bool isShadowTransparent = true, bool withBackButton = true}) {
1110
return GlobalAppBar(
1211
centerTitle: true,
1312
// title: const AppLogo(),
@@ -110,10 +109,8 @@ class AppBarCheckButton extends StatelessWidget {
110109
Widget build(BuildContext context) {
111110
return IconButton(
112111
icon: enableTap
113-
? const Icon(Icons.check_rounded,
114-
size: secondAppBarIconSize, color: ColorManager.blue)
115-
: const Icon(Icons.check_rounded,
116-
size: secondAppBarIconSize, color: ColorManager.lightBlue),
112+
? const Icon(Icons.check_rounded, size: secondAppBarIconSize, color: ColorManager.blue)
113+
: const Icon(Icons.check_rounded, size: secondAppBarIconSize, color: ColorManager.lightBlue),
117114
onPressed: () {
118115
final onTap = this.onTap;
119116
if (onTap != null) onTap();

0 commit comments

Comments
 (0)