fix: add support for query schemes in example app (#279)

This commit is contained in:
Mathias Mogensen 2023-07-03 15:03:19 +02:00 • committed by GitHub
commit f6584b9f48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 67 deletions

View file

@ -31,4 +31,11 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
</manifest>

View file

@ -47,5 +47,9 @@
<true />
<key>UIApplicationSupportsIndirectInputEvents</key>
<true />
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
</array>
</dict>
</plist>

View file

@ -61,9 +61,15 @@ class _HomePageState extends State<HomePage> {
void reassemble() {
super.reassemble();
_widgetBuilder = (context) => SimpleEditor(
jsonString: _jsonString,
onEditorStateChange: (editorState) {
_editorState = editorState;
_jsonString = Future.value(
jsonEncode(_editorState.document.toJson()),
);
},
);
}
@override
@ -74,6 +80,7 @@ class _HomePageState extends State<HomePage> {
drawer: _buildDrawer(context),
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
surfaceTintColor: Colors.transparent,
title: const Text('AppFlowy Editor'),
),
body: SafeArea(child: _buildBody(context)),

View file

@ -23,23 +23,8 @@ class MyApp extends StatelessWidget {
],
supportedLocales: const [Locale('en', 'US')],
debugShowCheckedModeBanner: false,
home: const MyHomePage(title: 'AppFlowyEditor Example'),
home: const HomePage(),
theme: ThemeData.light(useMaterial3: true),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return const HomePage();
}
}