Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
import java.util.Properties
import java.io.FileInputStream

plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}

val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}

android {
namespace = "com.example.algorithm_visualizer"
namespace = "com.elhawary.algodive"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

signingConfigs {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -21,7 +39,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.algorithm_visualizer"
applicationId = "com.elhawary.algodive"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
Expand All @@ -34,7 +52,7 @@ android {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="algorithm_visualizer"
android:label="AlgoDive"
android:name="${applicationName}"
android:enableOnBackInvokedCallback="true"
android:icon="@mipmap/ic_launcher"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithm_visualizer
package com.elhawary.algodive

import io.flutter.embedding.android.FlutterActivity

Expand Down
21 changes: 14 additions & 7 deletions ios/Runner/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<?xml version="1.0" encoding="UTF-8"?>
<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">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -14,10 +16,15 @@
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI"/>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"></imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
Expand All @@ -34,11 +41,11 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="80.916030534351137" y="264.08450704225356"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="1242" height="2688"/>
<image name="LaunchBackground" width="1" height="1"/>
<image name="LaunchImage" width="310.33334350585938" height="672"/>
</resources>
</document>
13 changes: 8 additions & 5 deletions ios/Runner/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<?xml version="1.0" encoding="UTF-8"?>
<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">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
Expand All @@ -14,13 +16,14 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-15" y="-40"/>
</scene>
</scenes>
</document>
14 changes: 10 additions & 4 deletions lib/config/themes/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ class AppTheme {
surfaceTintColor: ColorManager.white,
shadowColor: ColorManager.white,
),
dialogTheme: const DialogThemeData(surfaceTintColor: ColorManager.whiteD5),
dialogTheme: const DialogThemeData(
surfaceTintColor: ColorManager.whiteD5,
backgroundColor: ColorManager.whiteD1,
),
dividerColor: ColorManager.blackOp10,
scaffoldBackgroundColor: ColorManager.white,
iconTheme: const IconThemeData(color: ColorManager.black),
Expand All @@ -44,7 +47,7 @@ class AppTheme {
tabBarTheme: _tabBarTheme(),
textTheme: _textTheme(),
dividerTheme: const DividerThemeData(color: ColorManager.whiteD5),
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.blackOp30),
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.blackOp30),
textSelectionTheme: const TextSelectionThemeData(
cursorColor: ColorManager.teal,
selectionColor: ColorManager.blackOp10,
Expand Down Expand Up @@ -151,7 +154,10 @@ class AppTheme {
surfaceTintColor: ColorManager.blackL5,
shadowColor: ColorManager.blackL5,
),
dialogTheme: const DialogThemeData(surfaceTintColor: ColorManager.blackL5),
dialogTheme: const DialogThemeData(
surfaceTintColor: ColorManager.blackL5,
backgroundColor: ColorManager.blackL1,
),
dividerColor: ColorManager.whiteOp10,
scaffoldBackgroundColor: ColorManager.blackBlue,
iconTheme: const IconThemeData(color: ColorManager.white),
Expand All @@ -169,7 +175,7 @@ class AppTheme {
tabBarTheme: _tabBarDarkTheme(),
textTheme: _textDarkTheme(),
dividerTheme: const DividerThemeData(color: ColorManager.blackL5),
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.whiteOp30),
bottomAppBarTheme: const BottomAppBarThemeData(color: ColorManager.whiteOp30),
textSelectionTheme: const TextSelectionThemeData(
cursorColor: ColorManager.teal,
selectionColor: ColorManager.greyD6,
Expand Down
5 changes: 2 additions & 3 deletions lib/core/draggable_progress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ class LinearSliderState extends State<DraggableProgressBar> {
@override
Widget build(BuildContext context) {
return Slider(
activeColor: widget.isActive
? context.getColor(ThemeEnum.mediumBlueColor)
: context.getColor(ThemeEnum.whiteD7Color),
activeColor:
widget.isActive ? context.getColor(ThemeEnum.mediumBlueColor) : context.getColor(ThemeEnum.whiteD7Color),
value: sliderValue,
onChanged: (v) {
setState(() {
Expand Down
1 change: 0 additions & 1 deletion lib/core/enums/app_settings_enum.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

enum LanguagesEnum { english, arabic }
28 changes: 8 additions & 20 deletions lib/core/extensions/navigators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import 'package:go_router/go_router.dart';

extension Navigators on BuildContext {
String? get currentRoute => ModalRoute.of(this)?.settings.name;
(String?, Object?) get currentRouteSettings => (
ModalRoute.of(this)?.settings.name,
ModalRoute.of(this)?.settings.arguments
);
(String?, Object?) get currentRouteSettings =>
(ModalRoute.of(this)?.settings.name, ModalRoute.of(this)?.settings.arguments);
void unFocusKeyboard() {
try {
if (mounted) FocusScope.of(this).unfocus();
Expand Down Expand Up @@ -53,9 +51,7 @@ extension Navigators on BuildContext {

final currentValue = currentRouteSettings.$2;

if (currentValue is Map &&
currentRoute == path.name &&
arguments == currentValue[path.pathParamsName]) {
if (currentValue is Map && currentRoute == path.name && arguments == currentValue[path.pathParamsName]) {
return;
}
}
Expand All @@ -64,13 +60,8 @@ extension Navigators on BuildContext {
.pushNamed(
path.name,
extra: arguments,
pathParameters: pathParametersRaw ??
(pathParameters.isNotEmpty
? {path.pathParamsName: pathParameters}
: {}),
queryParameters: queryParameters.isNotEmpty
? {path.queryParamsName: queryParameters}
: {},
pathParameters: pathParametersRaw ?? (pathParameters.isNotEmpty ? {path.pathParamsName: pathParameters} : {}),
queryParameters: queryParameters.isNotEmpty ? {path.queryParamsName: queryParameters} : {},
)
.then((value) {
unFocusKeyboard();
Expand All @@ -87,8 +78,7 @@ extension Navigators on BuildContext {
.pushReplacementNamed(
path.name,
extra: arguments,
pathParameters:
pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
pathParameters: pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
)
.then((value) {
unFocusKeyboard();
Expand All @@ -110,8 +100,7 @@ extension Navigators on BuildContext {
.pushReplacementNamed(
path.name,
extra: arguments,
pathParameters:
pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
pathParameters: pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
)
.then((value) {
unFocusKeyboard();
Expand All @@ -133,8 +122,7 @@ extension Navigators on BuildContext {
.pushNamed(
path.name,
extra: arguments,
pathParameters:
pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
pathParameters: pathParameters.isEmpty ? {} : {path.pathParamsName: pathParameters},
)
.then((value) {
unFocusKeyboard();
Expand Down
9 changes: 3 additions & 6 deletions lib/core/helpers/app_bar/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import 'package:algorithm_visualizer/core/widgets/adaptive/text/adaptive_text.da
import 'package:flutter/material.dart';

class CustomAppBar {
static AppBar iconAppBar(
{bool isShadowTransparent = true, bool withBackButton = true}) {
static AppBar iconAppBar({bool isShadowTransparent = true, bool withBackButton = true}) {
return GlobalAppBar(
centerTitle: true,
// title: const AppLogo(),
Expand Down Expand Up @@ -110,10 +109,8 @@ class AppBarCheckButton extends StatelessWidget {
Widget build(BuildContext context) {
return IconButton(
icon: enableTap
? const Icon(Icons.check_rounded,
size: secondAppBarIconSize, color: ColorManager.blue)
: const Icon(Icons.check_rounded,
size: secondAppBarIconSize, color: ColorManager.lightBlue),
? const Icon(Icons.check_rounded, size: secondAppBarIconSize, color: ColorManager.blue)
: const Icon(Icons.check_rounded, size: secondAppBarIconSize, color: ColorManager.lightBlue),
onPressed: () {
final onTap = this.onTap;
if (onTap != null) onTap();
Expand Down
1 change: 0 additions & 1 deletion lib/core/helpers/app_bar/back_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class CustomAppBarBackButton extends StatelessWidget {
Widget build(BuildContext context) {
return IconButton(
icon: const CustomBackButtonIcon(),

onPressed: () {
Navigator.maybePop(context);
},
Expand Down
12 changes: 4 additions & 8 deletions lib/core/helpers/custom_alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class CustomAlertDialog {
final BuildContext context;
CustomAlertDialog(this.context);

Future<bool?> openDialog(DialogParameters parameters,
{bool barrierDismissible = true}) {
Future<bool?> openDialog(DialogParameters parameters, {bool barrierDismissible = true}) {
return showDialog<bool>(
context: context,
barrierDismissible: barrierDismissible,
Expand Down Expand Up @@ -90,8 +89,7 @@ class _Content extends StatelessWidget {
children: [
Padding(
padding: REdgeInsets.symmetric(vertical: 10),
child: BoldText(parameters.actionText,
color: ThemeEnum.redColor),
child: BoldText(parameters.actionText, color: ThemeEnum.redColor),
),
],
),
Expand All @@ -100,8 +98,7 @@ class _Content extends StatelessWidget {
const CustomDivider(withHeight: false),
InkWell(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(_borderRadius.r),
bottomRight: Radius.circular(_borderRadius.r)),
bottomLeft: Radius.circular(_borderRadius.r), bottomRight: Radius.circular(_borderRadius.r)),
onTap: () {
final onTapCancel = parameters.onTapCancel;
if (onTapCancel != null) onTapCancel();
Expand All @@ -117,8 +114,7 @@ class _Content extends StatelessWidget {
children: [
Padding(
padding: REdgeInsets.symmetric(vertical: 10),
child: RegularText(parameters.cancelText,
color: ThemeEnum.focusColor),
child: RegularText(parameters.cancelText, color: ThemeEnum.focusColor),
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/core/helpers/random_int.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class CustomRandom {

return numbers.sublist(0, length);
}
}
}
1 change: 0 additions & 1 deletion lib/core/helpers/random_text.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class HashCode {
static String generateIdentifier(List<String> userIds) {
userIds.sort();
Expand Down
10 changes: 3 additions & 7 deletions lib/core/helpers/storage/app_settings/app_settings_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ part 'app_settings_state.dart';

// Define your StateNotifierProvider
final appSettingsProvider =
StateNotifierProvider<AppSettingsNotifier, AppSettingsState>(
(ref) => AppSettingsNotifier());
StateNotifierProvider<AppSettingsNotifier, AppSettingsState>((ref) => AppSettingsNotifier());

class AppSettingsNotifier extends StateNotifier<AppSettingsState> {
AppSettingsNotifier() : super(AppSettingsState.initial());
Expand All @@ -25,8 +24,7 @@ class AppSettingsNotifier extends StateNotifier<AppSettingsState> {

LanguagesEnum get languageSelected => languageSelectedChar.language;

String get languageSelectedChar =>
_languageSelectedChar ?? _getLanguageSelectedChar;
String get languageSelectedChar => _languageSelectedChar ?? _getLanguageSelectedChar;
String get _getLanguageSelectedChar => _storage.read(_langSveKey) ?? "en";

bool get isLangEnglish => languageSelected == LanguagesEnum.english;
Expand Down Expand Up @@ -84,9 +82,7 @@ class AppSettingsNotifier extends StateNotifier<AppSettingsState> {
ThemeMode get modeSelected => _selectedMode ?? _getModeSelected;

ThemeMode get _getModeSelected =>
(_storage.read(_modeSveKey) ?? "light") == "light"
? ThemeMode.light
: ThemeMode.dark;
(_storage.read(_modeSveKey) ?? "light") == "light" ? ThemeMode.light : ThemeMode.dark;

bool get isThemeLight => modeSelected == ThemeMode.light;
}
4 changes: 1 addition & 3 deletions lib/core/helpers/svg_picture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ class CustomAssetsSvg extends StatelessWidget {
path,
height: size?.r,
semanticsLabel: semanticLabel,
colorFilter: color == null
? null
: ColorFilter.mode(context.getColor(color), BlendMode.srcIn),
colorFilter: color == null ? null : ColorFilter.mode(context.getColor(color), BlendMode.srcIn),
);
}
}
Loading