Skip to content

Commit

Permalink
add github link
Browse files Browse the repository at this point in the history
  • Loading branch information
chen56 committed May 11, 2024
1 parent 4d77a53 commit 5c25bc5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
17 changes: 15 additions & 2 deletions notes/flutter_web/lib/routes/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:you_flutter/better_ui.dart';
import 'package:you_flutter/note.dart';
import 'package:you_flutter/router.dart';
import 'package:you_flutter/state.dart';
import 'package:url_launcher/url_launcher.dart';

/// [LayoutBuilder]
Widget build(BuildContext context, Widget child) {
Expand Down Expand Up @@ -40,7 +41,13 @@ class RootLayoutState extends State<RootLayout> {

return Scaffold(
primary: true,
appBar: AppBar(toolbarHeight: 38, title: Text("location: ${route.uri}"), foregroundColor: colors.primaryFixed, backgroundColor: colors.onPrimaryFixed),
appBar: AppBar(toolbarHeight: 38, title: Text("location: ${route.uri}"), foregroundColor: colors.primaryFixed, backgroundColor: colors.onPrimaryFixed, actions: [
TextButton.icon(
onPressed: () => _launchUrl(Uri.parse("https://github.com/chen56/you")),
icon: const Icon(Icons.link),
label: const Text('github'),
),
]),
body: SafeArea(
child: SelectionArea(
child: Row(
Expand Down Expand Up @@ -72,7 +79,7 @@ class RootLayoutState extends State<RootLayout> {
const _NoteTree().flexible$(),
SingleChildScrollView(
// children: [widget.child.align$(alignment: Alignment.topLeft)],
child:widget.child,
child: widget.child,
).expanded$(),
],
),
Expand Down Expand Up @@ -191,3 +198,9 @@ extension _NoteTreeNode on To {
}
}
}

Future<void> _launchUrl(Uri url) async {
if (!await launchUrl(url)) {
throw Exception('Could not launch $url');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import FlutterMacOS
import Foundation

import shared_preferences_foundation
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
6 changes: 6 additions & 0 deletions notes/flutter_web/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

Expand Down
1 change: 1 addition & 0 deletions notes/flutter_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies:
# you_*
you_dart: ^0.0.4
you_flutter: ^0.0.4
url_launcher: ^6.2.6

dev_dependencies:

Expand Down

0 comments on commit 5c25bc5

Please sign in to comment.