Skip to content

Commit

Permalink
🚀 Add PrivacyPolicymenu.
Browse files Browse the repository at this point in the history
  • Loading branch information
iota9star committed Sep 24, 2022
1 parent a43fe93 commit ab9c51d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
security unlock-keychain -p $MACOS_CERTIFICATES_PWD build.keychain
security import Certificates.p12 -k build.keychain -P $MACOS_CERTIFICATES_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CERTIFICATES_PWD build.keychain
/usr/bin/codesign --force --deep -s $MACOS_IDENTITY ./$MACOS_APP_RELEASE_PATH/mikan_flutter.app
/usr/bin/codesign --force --deep -s $MACOS_IDENTITY ./$MACOS_APP_RELEASE_PATH/MikanProject.app
brew install create-dmg
cd $MACOS_APP_RELEASE_PATH
create-dmg \
Expand All @@ -133,14 +133,14 @@ jobs:
--window-size 800 529 \
--icon-size 130 \
--text-size 14 \
--icon "mikan_flutter.app" 260 250 \
--hide-extension "mikan_flutter.app" \
--icon "MikanProject.app" 260 250 \
--hide-extension "MikanProject.app" \
--app-drop-link 540 250 \
--hdiutil-quiet \
"mikan_flutter.dmg" \
"mikan_flutter.app"
"MikanProject.dmg" \
"MikanProject.app"
cd ../../../../../
mv $MACOS_APP_RELEASE_PATH/mikan_flutter.dmg macos-release.dmg
mv $MACOS_APP_RELEASE_PATH/MikanProject.dmg macos-release.dmg
- name: Release build
uses: ncipollo/release-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/fragments/bangumi_cover_scroll_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class _BangumiCoverScrollListFragmentState
padding: edge16,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 120,
maxCrossAxisExtent: 200,
crossAxisSpacing: 16.0,
mainAxisSpacing: 16.0,
childAspectRatio: 3 / 4,
Expand Down
48 changes: 44 additions & 4 deletions lib/ui/fragments/settings_fragment.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:extended_sliver/extended_sliver.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mikan_flutter/internal/image_provider.dart';
Expand All @@ -13,6 +14,7 @@ import 'package:mikan_flutter/ui/fragments/fonts_fragment.dart';
import 'package:mikan_flutter/ui/fragments/theme_panel_fragment.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';

@immutable
class SettingsFragment extends StatelessWidget {
Expand Down Expand Up @@ -44,6 +46,7 @@ class SettingsFragment extends StatelessWidget {
_buildFontManager(context, theme),
_buildSection("更多"),
_buildLicense(context, theme),
_buildPrivacyPolicy(context, theme),
_buildCheckUpdate(context, theme),
sliverSizedBoxH24,
],
Expand Down Expand Up @@ -212,11 +215,48 @@ class SettingsFragment extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: const [
Text(
"开源协议",
style: textStyle16B500,
textAlign: TextAlign.left,
Expanded(
child: Text(
"开源协议",
style: textStyle16B500,
textAlign: TextAlign.left,
),
),
Icon(FluentIcons.chevron_right_24_regular),
],
),
),
),
);
}

Widget _buildPrivacyPolicy(final BuildContext context, ThemeData theme) {
return SliverToBoxAdapter(
child: Container(
margin: edgeH16T8,
decoration: BoxDecoration(
borderRadius: borderRadius16,
color: theme.backgroundColor,
),
child: MaterialButton(
onPressed: () {
launchUrlString(
"https://github.com/iota9star/mikan_flutter/blob/master/PrivacyPolicy.md");
},
padding: edgeH16,
shape: const RoundedRectangleBorder(borderRadius: borderRadius16),
height: 48.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: const [
Expanded(
child: Text(
"隐私政策",
style: textStyle16B500,
textAlign: TextAlign.left,
),
),
Icon(FluentIcons.chevron_right_24_regular),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.12.2'
platform :osx, '10.12'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
18 changes: 12 additions & 6 deletions macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
1BACB5CDF99DE9EE65A0DEDD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* mikan_flutter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = mikan_flutter.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* MikanProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MikanProject.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -114,7 +114,7 @@
33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* mikan_flutter.app */,
33CC10ED2044A3C60003C045 /* MikanProject.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -196,7 +196,7 @@
);
name = Runner;
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* mikan_flutter.app */;
productReference = 33CC10ED2044A3C60003C045 /* MikanProject.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -443,14 +443,16 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = CHR83T9WY5;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.2;
PRODUCT_BUNDLE_IDENTIFIER = io.nichijou.flutter.mikan;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -571,14 +573,16 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = CHR83T9WY5;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.2;
PRODUCT_BUNDLE_IDENTIFIER = io.nichijou.flutter.mikan;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -593,14 +597,16 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = CHR83T9WY5;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.2;
PRODUCT_BUNDLE_IDENTIFIER = io.nichijou.flutter.mikan;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand Down
8 changes: 4 additions & 4 deletions macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "mikan_flutter.app"
BuildableName = "MikanProject.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -31,7 +31,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "mikan_flutter.app"
BuildableName = "MikanProject.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -54,7 +54,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "mikan_flutter.app"
BuildableName = "MikanProject.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -71,7 +71,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "mikan_flutter.app"
BuildableName = "MikanProject.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand Down
4 changes: 2 additions & 2 deletions macos/Runner/Configs/AppInfo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// 'flutter create' template.

// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = mikan_flutter
PRODUCT_NAME = MikanProject

// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = io.nichijou.flutter.mikan

// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2021 io.nichijou.flutter. All rights reserved.
PRODUCT_COPYRIGHT = Copyright © 2021 nichijou.io. All rights reserved.

0 comments on commit ab9c51d

Please sign in to comment.