This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:flutter/material.dart'; | |
import 'package:pdf/pdf.dart'; | |
import 'package:pdf/widgets.dart' as pdf; | |
import 'package:printing/printing.dart'; | |
import 'package:path_provider/path_provider.dart'; | |
Future<void> pdfGenerator(name) async { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FlatButton( | |
onPressed: () async { | |
String downloadPath = | |
await getApplicationDocumentsDirectoryPath(); | |
if (File('$downloadPath/$name.pdf').existsSync()) { | |
Navigator.pushNamed(context, '/viewer', | |
arguments: {'view': '$downloadPath/$name.pdf'}); | |
} else { | |
Scaffold.of(context).showSnackBar( | |
SnackBar( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FlatButton( | |
onPressed: () async { | |
String downloadPath = | |
await getApplicationDocumentsDirectoryPath(); | |
if (File('$downloadPath/$name.pdf').existsSync()) { | |
ShareExtend.share( | |
File('$downloadPath/$name.pdf').path, 'file'); | |
} else { | |
Scaffold.of(context).showSnackBar( | |
SnackBar( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AppBar( | |
title: Text('Holden'), | |
elevation: 0, | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.only( | |
bottomRight: Radius.circular(50), | |
bottomLeft: Radius.circular(50), | |
), | |
), | |
centerTitle: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FloatingActionButton( | |
heroTag: 'Share', | |
onPressed: () async { | |
final names = homeProvider | |
.xlsxFileTables[homeProvider.xlsxFileSelectedTable] | |
.rows | |
.map((name) => name | |
.toString() | |
.substring(1, name.toString().length - 1)); | |
names.forEach((name) => pdfGenerator(name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
title: 'Flutter Internals', | |
debugShowCheckedModeBanner: true, | |
home: Scaffold( | |
appBar: AppBar( | |
actions: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
flutter: | |
sdk: flutter | |
cupertino_icons: ^0.1.2 | |
flutter_highlight: # setting syntax highlighting & color-scheme of code | |
screenshot: # generating screenshots from widgets | |
provider: # state-management | |
path_provider: # reading/writing files in application document directory | |
share_extend: # sharing files | |
flutter_colorpicker: # picking colors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:platypus/screens/home/home.dart'; | |
import 'package:platypus/providers/home.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter_highlight/theme_map.dart'; | |
import 'package:screenshot/screenshot.dart'; | |
import 'package:platypus/utils/utils.dart'; | |
/// | |
/// Manages states for HomeScreen |