Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation of bookmark and Share function and some modification o… #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 45 additions & 9 deletions lib/presentation/widgets/docs_card.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import 'package:edualgo_app_demo/core/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:share/share.dart';

class DocsCard extends StatefulWidget {

@override
_DocsCardState createState() => _DocsCardState();
}

class _DocsCardState extends State<DocsCard> {
List<String> listString =List<String>();
var bookmarkIcon = FontAwesomeIcons.bookmark;


class DocsCard extends StatelessWidget {
@override
Widget build(BuildContext context) {


return Padding(
padding: const EdgeInsets.all(18.0),
child: Card(
Expand Down Expand Up @@ -52,9 +66,9 @@ class DocsCard extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Text(
'Greyhound divisively hello coldly wonderfully marginally far '
'upon excluding.Greyhound divisively hello coldly wonderfully '
'marginally far upon excluding.Greyhound divisively hello '
'coldly wonderfully marginally far upon excluding.',
'upon excluding.Greyhound divisively hello coldly wonderfully '
'marginally far upon excluding.Greyhound divisively hello '
'coldly wonderfully marginally far upon excluding.',
style: TextStyle(
fontFamily: 'Recursive',
fontSize: 15.0,
Expand Down Expand Up @@ -100,24 +114,46 @@ class DocsCard extends StatelessWidget {
width: 10.0,
),
IconButton(
icon: FaIcon(FontAwesomeIcons.bookmark),
icon: FaIcon(bookmarkIcon),
iconSize: 30,
color: kThemeColor,
onPressed: () {},
onPressed: () {
setState(() {
bookmarkIcon == FontAwesomeIcons.bookmark ? bookmarkIcon= FontAwesomeIcons.solidBookmark : bookmarkIcon = FontAwesomeIcons.bookmark;
});

},
),
IconButton(
icon: FaIcon(FontAwesomeIcons.shareAltSquare),
iconSize: 35,
color: kThemeColor,
onPressed: () {},
onPressed: () async {

final RenderBox box = context.findRenderObject();
await Share.share('Card Title ',
subject: 'Code',
sharePositionOrigin: box.localToGlobal(Offset.zero)&box.size
);
// listString.add('images/card1.png');
// await Share.shareFiles(
// listString,
// text: 'Card',
// subject: 'Subject',
// sharePositionOrigin: box.localToGlobal(Offset.zero) & box.size
// );
},
),
],
),
Image.asset('images/card1.png'),
Padding(
padding: const EdgeInsets.only(left: 10,right: 10.0,bottom: 10.0),
child: Image.asset('images/card1.png'),
),
],
),
),
),
);
}
}
}
Loading