Skip to content

Commit

Permalink
Open flchart.dev when user clicks on the fl_chart logo
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Oct 7, 2023
1 parent 396b2e1 commit 79e6ec7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions example/lib/presentation/menu/app_menu.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/urls.dart';
import 'package:fl_chart_app/util/app_helper.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -30,11 +31,19 @@ class AppMenuState extends State<AppMenu> {
color: AppColors.itemsBackground,
child: Column(
children: [
const SafeArea(
SafeArea(
child: AspectRatio(
aspectRatio: 3,
child: Center(
child: FlChartBanner(),
child: InkWell(
onTap: () async {
final url = Uri.parse(Urls.flChartUrl);
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
child: const FlChartBanner(),
),
),
),
),
Expand Down
1 change: 1 addition & 0 deletions example/lib/urls.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:fl_chart_app/util/app_helper.dart';

class Urls {
static const flChartUrl = 'https://flchart.dev';
static String getChartSourceCodeUrl(ChartType chartType, int sampleNumber) {
final chartDir = chartType.name.toLowerCase();
return 'https://github.com/imaNNeo/fl_chart/blob/master/example/lib/presentation/samples/$chartDir/${chartDir}_chart_sample$sampleNumber.dart';
Expand Down

0 comments on commit 79e6ec7

Please sign in to comment.