Skip to content

Commit

Permalink
Merge pull request #51 from AmityCo/release-4.0.0-beta05
Browse files Browse the repository at this point in the history
Release 4.0.0-beta05
  • Loading branch information
Zryte authored Aug 30, 2024
2 parents fc54592 + eb690c8 commit 997d6b0
Show file tree
Hide file tree
Showing 89 changed files with 3,564 additions and 790 deletions.
5 changes: 5 additions & 0 deletions assets/Icons/amity_ic_camera_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/Icons/amity_ic_image_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/Icons/amity_ic_upload_error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/Icons/amity_ic_video_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/Icons/ic_create_post_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/Icons/ic_create_stroy_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/Icons/ic_lock_gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@
android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

</manifest>
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.22'
repositories {
google()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
Binary file removed example/flutter_01.png
Binary file not shown.
27 changes: 18 additions & 9 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
7F9BDD59BDC94206078E534D /* [CP] Embed Pods Frameworks */,
A29333122833EFCA73CEEEDE /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -361,6 +362,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
A29333122833EFCA73CEEEDE /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -467,8 +485,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 37Z583JR6K;
ENABLE_BITCODE = NO;
Expand All @@ -479,7 +495,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ekoenterprise.flutterSocialApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -649,8 +664,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 37Z583JR6K;
ENABLE_BITCODE = NO;
Expand All @@ -661,7 +674,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ekoenterprise.flutterSocialApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -675,8 +687,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 37Z583JR6K;
ENABLE_BITCODE = NO;
Expand All @@ -687,7 +697,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ekoenterprise.flutterSocialApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
7 changes: 7 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ class SecondPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: BackButton(
color: Colors.black,
onPressed: () {
AmityUIKit().unRegisterDevice();
Navigator.of(context).pop();
},
),
title: Text('Welcome, $username'),
),
body: Center(
Expand Down
8 changes: 5 additions & 3 deletions example/lib/social_v4_compatible.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:amity_sdk/amity_sdk.dart';
import 'package:amity_uikit_beta_service/v4/utils/config_provider_widget.dart';
import 'package:amity_uikit_beta_service/view/UIKit/social/create_action_bottom_sheet.dart';
import 'package:amity_uikit_beta_service/view/UIKit/social/post_target_page.dart';
import 'package:amity_uikit_beta_service/view/UIKit/social/search_communities.dart';
import 'package:amity_uikit_beta_service/view/social/community_feed.dart';
Expand Down Expand Up @@ -122,10 +123,11 @@ class _CommunityPageState extends State<AmitySocialV4Compatible> {
floatingActionButton: FloatingActionButton(
shape: const CircleBorder(),
onPressed: () {
CreateActionBottomSheet.show(context);
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(body: PostToPage()),
));
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => const Scaffold(body: PostToPage()),
// ));
},
backgroundColor: Provider.of<AmityUIConfiguration>(context)
.appColors
Expand Down
4 changes: 4 additions & 0 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
#include "generated_plugin_registrant.h"

#include <file_selector_linux/file_selector_plugin.h>
#include <open_file_linux/open_file_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) open_file_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "OpenFileLinuxPlugin");
open_file_linux_plugin_register_with_registrar(open_file_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
1 change: 1 addition & 0 deletions example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
open_file_linux
url_launcher_linux
)

Expand Down
4 changes: 4 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import FlutterMacOS
import Foundation

import device_info_plus
import file_selector_macos
import open_file_mac
import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
Expand All @@ -16,7 +18,9 @@ import video_player_avfoundation
import wakelock_plus

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
OpenFilePlugin.register(with: registry.registrar(forPlugin: "OpenFilePlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: amity_uikit_beta_service_example
description: Demonstrates how to use the amity_uikit_beta_service plugin.
version: 1.0.4+6
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
Expand Down
2 changes: 2 additions & 0 deletions lib/amity_uikit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ class AmityUIKit {
await AmityCoreClient.setup(
option: AmityCoreClientOption(
apiKey: apikey,
showLogs: true,
httpEndpoint: amityEndpoint!,
mqttEndpoint: amityMqttEndpoint!,
socketEndpoint: amitySocketEndpoint!),

sycInitialization: true);
stopwatch.stop();
log('setupAmityClient execution time: ${stopwatch.elapsedMilliseconds} ms');
Expand Down
2 changes: 1 addition & 1 deletion lib/components/alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class AmityAlertDialogWithThreeActions {
context: context,
builder: (BuildContext context) {
return CupertinoTheme(
data: const CupertinoThemeData(brightness: Brightness.dark),
data: const CupertinoThemeData(brightness: Brightness.light),
child: CupertinoAlertDialog(
title: Text(title),
content: Text(detailText),
Expand Down
20 changes: 15 additions & 5 deletions lib/v4/core/base_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,22 @@ abstract class NewBaseComponent extends StatelessWidget {

@override
Widget build(BuildContext context) {
configProvider = context.watch<ConfigProvider>();
theme = configProvider.getTheme(pageId, componentId);
if (!isInitialized()) {
configProvider = context.watch<ConfigProvider>();
theme = configProvider.getTheme(pageId, componentId);
}
return buildComponent(context);
}

Widget buildComponent(
BuildContext context);
}
Widget buildComponent(BuildContext context);

bool isInitialized() {
try {
configProvider;
theme;
return true;
} catch (e) {
return false;
}
}
}
2 changes: 2 additions & 0 deletions lib/v4/core/config_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ extension ThemeConfig on ConfigRepository {
backgroundColor: theme?.backgroundColor ?? fallbackTheme.backgroundColor,
baseInverseColor:
theme?.baseInverseColor ?? fallbackTheme.baseInverseColor,
backgroundShade1Color: fallbackTheme.backgroundShade1Color,
highlightColor: fallbackTheme.highlightColor,
);
}

Expand Down
17 changes: 16 additions & 1 deletion lib/v4/core/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class AmityTheme {
final Color baseColorShade4;
final Color alertColor;
final Color backgroundColor;
final Color backgroundShade1Color;
final Color highlightColor;

AmityTheme({
required this.primaryColor,
Expand All @@ -25,6 +27,8 @@ class AmityTheme {
required this.baseColorShade4,
required this.alertColor,
required this.backgroundColor,
required this.backgroundShade1Color,
required this.highlightColor,
});

factory AmityTheme.fromJson(Map<String, dynamic> json) {
Expand All @@ -39,6 +43,10 @@ class AmityTheme {
baseColorShade4: _colorFromHex(json['base_shade4_color']),
alertColor: _colorFromHex(json['alert_color']),
backgroundColor: _colorFromHex(json['background_color']),
backgroundShade1Color: _colorFromHex(json['background_shade1_color']),
highlightColor: _colorFromHex(
json['highlight_color'],
),
);
}

Expand All @@ -63,6 +71,8 @@ class AmityThemeColor {
final Color baseColorShade4;
final Color alertColor;
final Color backgroundColor;
final Color backgroundShade1Color;
final Color highlightColor;

AmityThemeColor({
required this.primaryColor,
Expand All @@ -75,10 +85,11 @@ class AmityThemeColor {
required this.baseColorShade4,
required this.alertColor,
required this.backgroundColor,
required this.backgroundShade1Color,
required this.highlightColor,
});
}


// Enum to define theme styles
enum AmityThemeStyle { light, dark, system }

Expand All @@ -93,6 +104,8 @@ final lightTheme = AmityTheme(
baseColorShade4: const Color(0xFFEBECEF),
alertColor: const Color(0xFFFA4D30),
backgroundColor: const Color(0xFFFFFFFF),
backgroundShade1Color: const Color(0xFFF6F7F8),
highlightColor: const Color(0xFF1054DE),
);

final darkTheme = AmityTheme(
Expand All @@ -106,6 +119,8 @@ final darkTheme = AmityTheme(
baseColorShade4: const Color(0xFF292B32),
alertColor: const Color(0xFFFA4D30),
backgroundColor: const Color(0xFF191919),
backgroundShade1Color: const Color(0xFF40434E),
highlightColor: const Color(0xFF1054DE),
);

enum ColorBlendingOption {
Expand Down
Loading

0 comments on commit 997d6b0

Please sign in to comment.