Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2023-01-29 08:36:04 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2fa8222913192d775cdf8456de160db0ee7c8692
2fa82229
1 parent
5643485a
Fix demo project
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
18 deletions
demo/lib/app.dart
demo/lib/examples/calendar.dart
demo/lib/examples/document.dart
demo/pubspec.yaml
demo/lib/app.dart
View file @
2fa8222
...
...
@@ -117,7 +117,7 @@ class MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
final
appDocDir
=
await
getApplicationDocumentsDirectory
();
final
appDocPath
=
appDocDir
.
path
;
final
file
=
File
(
appDocPath
+
'/'
+
'
document.pdf'
);
final
file
=
File
(
'
$appDocPath
/
document.pdf'
);
print
(
'Save as file
${file.path}
...'
);
await
file
.
writeAsBytes
(
bytes
);
await
OpenFile
.
open
(
file
.
path
);
...
...
demo/lib/examples/calendar.dart
View file @
2fa8222
...
...
@@ -93,7 +93,7 @@ class Calendar extends StatelessWidget {
}
if
(
date
.
day
==
1
)
{
text
+=
'
'
+
DateFormat
.
MMM
().
format
(
date
)
;
text
+=
'
${DateFormat.MMM().format(date)}
'
;
}
return
Container
(
...
...
@@ -109,12 +109,12 @@ class Calendar extends StatelessWidget {
@override
Widget
build
(
Context
context
)
{
final
_date
=
date
??
DateTime
.
now
();
final
_year
=
year
??
_date
.
year
;
final
_month
=
month
??
_date
.
month
;
final
localDate
=
date
??
DateTime
.
now
();
final
localYear
=
year
??
localDate
.
year
;
final
localMnth
=
month
??
localDate
.
month
;
final
start
=
DateTime
(
_year
,
_month
,
1
,
12
);
final
end
=
DateTime
(
_year
,
_month
+
1
,
1
,
12
).
subtract
(
final
start
=
DateTime
(
localYear
,
localMnth
,
1
,
12
);
final
end
=
DateTime
(
localYear
,
localMnth
+
1
,
1
,
12
).
subtract
(
const
Duration
(
days:
1
),
);
...
...
@@ -148,9 +148,9 @@ class Calendar extends StatelessWidget {
children:
List
<
Widget
>.
generate
(
42
,
(
int
index
)
{
final
d
=
start
.
add
(
Duration
(
days:
index
-
startId
));
final
currentMonth
=
index
>=
startId
&&
index
<
endId
;
final
currentDay
=
d
.
year
==
_date
.
year
&&
d
.
month
==
_date
.
month
&&
d
.
day
==
_date
.
day
;
final
currentDay
=
d
.
year
==
localDate
.
year
&&
d
.
month
==
localDate
.
month
&&
d
.
day
==
localDate
.
day
;
return
Container
(
foregroundDecoration:
BoxDecoration
(
border:
Border
(
...
...
@@ -170,7 +170,7 @@ class Calendar extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
title
(
context
,
DateTime
(
_year
,
_mo
nth
)),
title
(
context
,
DateTime
(
localYear
,
localM
nth
)),
head
,
Expanded
(
child:
body
),
],
...
...
demo/lib/examples/document.dart
View file @
2fa8222
...
...
@@ -62,7 +62,7 @@ Future<Uint8List> generateDocument(
pw
.
RichText
(
text:
pw
.
TextSpan
(
children:
[
pw
.
TextSpan
(
text:
DateTime
.
now
().
year
.
toString
()
+
'
\n
'
,
text:
'
${DateTime.now().year}
\n
'
,
style:
pw
.
TextStyle
(
fontWeight:
pw
.
FontWeight
.
bold
,
color:
PdfColors
.
grey600
,
...
...
demo/pubspec.yaml
View file @
2fa8222
...
...
@@ -10,18 +10,20 @@ environment:
dependencies
:
flutter
:
sdk
:
flutter
intl
:
^0.1
7
.0
intl
:
^0.1
8
.0
open_file
:
^3.2.1
path_provider
:
^2.0.2
printing
:
^5.3.0
url_launcher
:
^6.0.6
path_provider
:
^2.0.12
pdf
:
printing
:
url_launcher
:
^6.1.8
vector_math
:
^2.1.4
dev_dependencies
:
# flutter_launcher_icons: ^0.10.0
flutter_lints
:
^
1.0.4
flutter_lints
:
^
2.0.1
flutter_test
:
sdk
:
flutter
test
:
^1.
16.5
test
:
^1.
22.0
dependency_overrides
:
pdf
:
...
...
Please
register
or
login
to post a comment