Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to flutter latest version ⬆️ #1

Merged
merged 12 commits into from
Jul 31, 2023
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
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.8.21'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.2-bin.zip
Empty file modified android/gradlew
100644 → 100755
Empty file.
Binary file removed assets/fonts/Cairo-Medium.ttf
Binary file not shown.
Binary file removed assets/fonts/Cairo-Regular.ttf
Binary file not shown.
Binary file removed assets/fonts/Cairo-SemiBold.ttf
Binary file not shown.
44 changes: 44 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# target 'RunnerTests' do
# inherit! :search_paths
# end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
29 changes: 29 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PODS:
- Flutter (1.0.0)
- integration_test (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- Flutter (from `Flutter`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
integration_test: 13825b8a9334a850581300559b8839134b124670
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126

PODFILE CHECKSUM: b17e1ecfe97aba85f3997d462fe23d9e4313a8d8

COCOAPODS: 1.11.3
7 changes: 5 additions & 2 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -199,10 +199,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -252,6 +254,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -548,4 +551,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
8 changes: 0 additions & 8 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import UIKit
import Flutter
import awesome_notifications

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
Expand All @@ -9,13 +8,6 @@ import awesome_notifications
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)

// This function registers the desired plugins to be used within a notification background action
SwiftAwesomeNotificationsPlugin.setPluginRegistrantCallback { registry in
SwiftAwesomeNotificationsPlugin.register(
with: registry.registrar(forPlugin: "io.flutter.plugins.awesomenotifications.AwesomeNotificationsPlugin")!)
}

return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
6 changes: 4 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion lib/app/components/custom_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CustomButton extends StatelessWidget {
children: [
Text(
text,
style: Get.theme.textTheme.bodyText1?.copyWith(
style: Get.theme.textTheme.bodyLarge?.copyWith(
fontSize: fontSize,
fontWeight: fontWeight,
color: foregroundColor ?? Colors.white,
Expand Down
40 changes: 0 additions & 40 deletions lib/app/components/custom_loading_overlay.dart

This file was deleted.

2 changes: 1 addition & 1 deletion lib/app/components/no_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NoData extends StatelessWidget {
80.verticalSpace,
Image.asset(Constants.noData),
20.verticalSpace,
Text(text ?? 'No Data', style: context.textTheme.headline4),
Text(text ?? 'No Data', style: context.textTheme.displayMedium),
],
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/app/components/product_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ class ProductItem extends StatelessWidget {
],
),
10.verticalSpace,
Text(product.name!, style: theme.textTheme.bodyText2)
Text(product.name!, style: theme.textTheme.bodyMedium)
.animate().fade().slideY(
duration: const Duration(milliseconds: 200),
begin: 1,
curve: Curves.easeInSine,
),
5.verticalSpace,
Text('\$${product.price}', style: theme.textTheme.headline6)
Text('\$${product.price}', style: theme.textTheme.displaySmall)
.animate().fade().slideY(
duration: const Duration(milliseconds: 200),
begin: 2,
Expand Down
7 changes: 5 additions & 2 deletions lib/app/components/screen_title.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class ScreenTitle extends StatelessWidget {
Expand All @@ -15,8 +16,10 @@ class ScreenTitle extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: context.theme.textTheme.headline2),
Divider(thickness: 3, endIndent: dividerEndIndent ?? 250),
Text(title, style: context.theme.textTheme.displayLarge?.copyWith(
fontSize: 42.sp,
)),
Divider(thickness: 3, endIndent: dividerEndIndent ?? 250,),
],
);
}
Expand Down
18 changes: 0 additions & 18 deletions lib/app/data/local/my_shared_pref.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../../../config/translations/localization_service.dart';

class MySharedPref {
// prevent making instance
MySharedPref._();
Expand All @@ -12,7 +9,6 @@ class MySharedPref {

// STORING KEYS
static const String _fcmTokenKey = 'fcm_token';
static const String _currentLocalKey = 'current_local';
static const String _lightThemeKey = 'is_theme_light';

/// init get storage services
Expand All @@ -32,20 +28,6 @@ class MySharedPref {
static bool getThemeIsLight() =>
_sharedPreferences.getBool(_lightThemeKey) ?? true; // todo set the default theme (true for light, false for dark)

/// save current locale
static Future<void> setCurrentLanguage(String languageCode) =>
_sharedPreferences.setString(_currentLocalKey, languageCode);

/// get current locale
static Locale getCurrentLocal(){
String? langCode = _sharedPreferences.getString(_currentLocalKey);
// default language is english
if(langCode == null){
return LocalizationService.defaultLanguage;
}
return LocalizationService.supportedLanguages[langCode]!;
}

/// save generated fcm token
static Future<void> setFcmToken(String token) =>
_sharedPreferences.setString(_fcmTokenKey, token);
Expand Down
8 changes: 4 additions & 4 deletions lib/app/modules/cart/views/cart_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CartView extends GetView<CartController> {
children: [
SvgPicture.asset(Constants.busIcon),
5.verticalSpace,
Text('FREE', style: theme.textTheme.headline6?.copyWith(
Text('FREE', style: theme.textTheme.displaySmall?.copyWith(
color: Colors.white,
)),
],
Expand All @@ -71,20 +71,20 @@ class CartView extends GetView<CartController> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Total:', style: theme.textTheme.bodyText1?.copyWith(
Text('Total:', style: theme.textTheme.bodyLarge?.copyWith(
fontSize: 18.sp,
)),
10.verticalSpace,
Text(
'\$${controller.total.toStringAsFixed(2)}',
style: theme.textTheme.headline3?.copyWith(
style: theme.textTheme.displayLarge?.copyWith(
decoration: TextDecoration.underline,
decorationColor: theme.primaryColor.withOpacity(0.5),
decorationThickness: 1,
color: Colors.transparent,
shadows: [
Shadow(
color: theme.textTheme.headline3!.color!,
color: theme.textTheme.displayLarge!.color!,
offset: const Offset(0, -5)
),
],
Expand Down
12 changes: 7 additions & 5 deletions lib/app/modules/cart/views/widgets/cart_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ class CartItem extends GetView<CartController> {
5.verticalSpace,
Text(
product.name!,
style: theme.textTheme.headline4,
style: theme.textTheme.displayMedium,
overflow: TextOverflow.ellipsis,
),
5.verticalSpace,
Text('Size: ${product.size}', style: theme.textTheme.bodyText2?.copyWith(fontSize: 16.sp)),
Text('Size: ${product.size}', style: theme.textTheme.bodyMedium?.copyWith(fontSize: 16.sp)),
5.verticalSpace,
Text('\$${product.price}', style: theme.textTheme.headline4),
Text('\$${product.price}', style: theme.textTheme.displayLarge?.copyWith(
fontSize: 18.sp,
),),
10.verticalSpace,
GetBuilder<CartController>(
id: 'ProductQuantity',
Expand All @@ -67,7 +69,7 @@ class CartItem extends GetView<CartController> {
child: SvgPicture.asset(Constants.decreaseIcon),
),
10.horizontalSpace,
Text('${product.quantity}', style: theme.textTheme.headline6),
Text('${product.quantity}', style: theme.textTheme.displaySmall),
10.horizontalSpace,
GestureDetector(
onTap: () => controller.onDecreasePressed(product.id!),
Expand All @@ -88,7 +90,7 @@ class CartItem extends GetView<CartController> {
Constants.cancelIcon,
width: 20.w,
height: 20.h,
color: theme.textTheme.bodyText2!.color,
color: theme.textTheme.bodyMedium!.color,
),
),
),
Expand Down
Loading