Skip to content

Commit f6584b9

Browse files
authored
fix: add support for query schemes in example app (AppFlowy-IO#279)
1 parent 070ceb3 commit f6584b9

File tree

4 files changed

+70
-67
lines changed

4 files changed

+70
-67
lines changed

example/android/app/src/main/AndroidManifest.xml

+7
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,11 @@
3131
android:name="flutterEmbedding"
3232
android:value="2" />
3333
</application>
34+
<queries>
35+
<intent>
36+
<action android:name="android.intent.action.VIEW" />
37+
<category android:name="android.intent.category.BROWSABLE" />
38+
<data android:scheme="https" />
39+
</intent>
40+
</queries>
3441
</manifest>

example/ios/Runner/Info.plist

+52-48
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,55 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>$(DEVELOPMENT_LANGUAGE)</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>Example</string>
9-
<key>CFBundleExecutable</key>
10-
<string>$(EXECUTABLE_NAME)</string>
11-
<key>CFBundleIdentifier</key>
12-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13-
<key>CFBundleInfoDictionaryVersion</key>
14-
<string>6.0</string>
15-
<key>CFBundleName</key>
16-
<string>example</string>
17-
<key>CFBundlePackageType</key>
18-
<string>APPL</string>
19-
<key>CFBundleShortVersionString</key>
20-
<string>$(FLUTTER_BUILD_NAME)</string>
21-
<key>CFBundleSignature</key>
22-
<string>????</string>
23-
<key>CFBundleVersion</key>
24-
<string>$(FLUTTER_BUILD_NUMBER)</string>
25-
<key>LSRequiresIPhoneOS</key>
26-
<true/>
27-
<key>UILaunchStoryboardName</key>
28-
<string>LaunchScreen</string>
29-
<key>UIMainStoryboardFile</key>
30-
<string>Main</string>
31-
<key>UISupportedInterfaceOrientations</key>
32-
<array>
33-
<string>UIInterfaceOrientationPortrait</string>
34-
<string>UIInterfaceOrientationLandscapeLeft</string>
35-
<string>UIInterfaceOrientationLandscapeRight</string>
36-
</array>
37-
<key>UISupportedInterfaceOrientations~ipad</key>
38-
<array>
39-
<string>UIInterfaceOrientationPortrait</string>
40-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
41-
<string>UIInterfaceOrientationLandscapeLeft</string>
42-
<string>UIInterfaceOrientationLandscapeRight</string>
43-
</array>
44-
<key>UIViewControllerBasedStatusBarAppearance</key>
45-
<false/>
46-
<key>CADisableMinimumFrameDurationOnPhone</key>
47-
<true/>
48-
<key>UIApplicationSupportsIndirectInputEvents</key>
49-
<true/>
50-
</dict>
51-
</plist>
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>Example</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>example</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>$(FLUTTER_BUILD_NAME)</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>$(FLUTTER_BUILD_NUMBER)</string>
25+
<key>LSRequiresIPhoneOS</key>
26+
<true />
27+
<key>UILaunchStoryboardName</key>
28+
<string>LaunchScreen</string>
29+
<key>UIMainStoryboardFile</key>
30+
<string>Main</string>
31+
<key>UISupportedInterfaceOrientations</key>
32+
<array>
33+
<string>UIInterfaceOrientationPortrait</string>
34+
<string>UIInterfaceOrientationLandscapeLeft</string>
35+
<string>UIInterfaceOrientationLandscapeRight</string>
36+
</array>
37+
<key>UISupportedInterfaceOrientations~ipad</key>
38+
<array>
39+
<string>UIInterfaceOrientationPortrait</string>
40+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
41+
<string>UIInterfaceOrientationLandscapeLeft</string>
42+
<string>UIInterfaceOrientationLandscapeRight</string>
43+
</array>
44+
<key>UIViewControllerBasedStatusBarAppearance</key>
45+
<false />
46+
<key>CADisableMinimumFrameDurationOnPhone</key>
47+
<true />
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true />
50+
<key>LSApplicationQueriesSchemes</key>
51+
<array>
52+
<string>https</string>
53+
</array>
54+
</dict>
55+
</plist>

example/lib/home_page.dart

+10-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ class _HomePageState extends State<HomePage> {
6161
void reassemble() {
6262
super.reassemble();
6363

64-
_jsonString = Future.value(
65-
jsonEncode(_editorState.document.toJson()),
66-
);
64+
_widgetBuilder = (context) => SimpleEditor(
65+
jsonString: _jsonString,
66+
onEditorStateChange: (editorState) {
67+
_editorState = editorState;
68+
_jsonString = Future.value(
69+
jsonEncode(_editorState.document.toJson()),
70+
);
71+
},
72+
);
6773
}
6874

6975
@override
@@ -74,6 +80,7 @@ class _HomePageState extends State<HomePage> {
7480
drawer: _buildDrawer(context),
7581
appBar: AppBar(
7682
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
83+
surfaceTintColor: Colors.transparent,
7784
title: const Text('AppFlowy Editor'),
7885
),
7986
body: SafeArea(child: _buildBody(context)),

example/lib/main.dart

+1-16
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,8 @@ class MyApp extends StatelessWidget {
2323
],
2424
supportedLocales: const [Locale('en', 'US')],
2525
debugShowCheckedModeBanner: false,
26-
home: const MyHomePage(title: 'AppFlowyEditor Example'),
26+
home: const HomePage(),
2727
theme: ThemeData.light(useMaterial3: true),
2828
);
2929
}
3030
}
31-
32-
class MyHomePage extends StatefulWidget {
33-
const MyHomePage({Key? key, required this.title}) : super(key: key);
34-
final String title;
35-
36-
@override
37-
State<MyHomePage> createState() => _MyHomePageState();
38-
}
39-
40-
class _MyHomePageState extends State<MyHomePage> {
41-
@override
42-
Widget build(BuildContext context) {
43-
return const HomePage();
44-
}
45-
}

0 commit comments

Comments
 (0)