Skip to content

Commit

Permalink
Merge branch 'open-button'
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingcakes85 committed Oct 16, 2022
2 parents e42453e + 8148155 commit 8db0a6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'dart:convert';
import 'dart:io';

import 'package:open_url/open_url.dart';

import 'package:flutter/material.dart';
import 'package:file_picker/file_picker.dart';
import 'package:tgfs_ui/vars.dart';
Expand All @@ -11,7 +13,7 @@ void main() {
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyApp()));
home: const MyApp()));
}

class MyApp extends StatefulWidget {
Expand Down Expand Up @@ -261,7 +263,7 @@ class _MyAppState extends State<MyApp> {
TextButton(
child: const Text('OPEN'),
onPressed: () async {
Navigator.of(context).pop();
await openUrl(filePaths.elementAt(i));
},
),
],
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
open_url:
dependency: "direct main"
description:
name: open_url
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
path:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
file_picker: ^5.2.1
open_url: ^2.0.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 8db0a6e

Please sign in to comment.