Profile View
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Future<bool> showAlertDialog({
|
||||
BuildContext context,
|
||||
@required String title,
|
||||
@required String contentMessage,
|
||||
String confirmText,
|
||||
String cancelText,
|
||||
}) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(contentMessage),
|
||||
actions: [
|
||||
if (cancelText != null)
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(false);
|
||||
},
|
||||
child: Text(cancelText),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(true);
|
||||
},
|
||||
child: Text(confirmText),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,28 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:le_kiosque_by_gcs/model/magazine.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/view/pdf_reader.dart';
|
||||
|
||||
class ItemMagLarge extends StatelessWidget {
|
||||
const ItemMagLarge({
|
||||
Key key,
|
||||
this.magazine,
|
||||
@required this.magazine,
|
||||
}) : super(key: key);
|
||||
|
||||
final Magazine magazine;
|
||||
|
||||
void showPdfReader(BuildContext context, String magazineUrl) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return PdfReader(
|
||||
pdfUrl: magazine.magazineUrl,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 235,
|
||||
width: 168,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5)
|
||||
),
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(
|
||||
"https://miningandbusiness.com/wp-content/uploads/2021/02/03f19c3a-1d92-4be7-ac54-f52b37e626ad-561x771.jpg"),
|
||||
fit: BoxFit.cover,
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
showPdfReader(context, magazine.magazineUrl);
|
||||
},
|
||||
child: Container(
|
||||
height: 235,
|
||||
width: 168,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5),
|
||||
),
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(magazine.urlCover),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,8 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:le_kiosque_by_gcs/model/magazine.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/view/detailmag/detail_mag.dart';
|
||||
|
||||
import 'item_mag_small.dart';
|
||||
|
||||
showDetailCategoryMagazine({
|
||||
BuildContext context,
|
||||
List<Magazine> magazines,
|
||||
String rowTitle,
|
||||
}) {
|
||||
showBottomSheet(
|
||||
//barrierColor: Colors.black87,
|
||||
backgroundColor: Colors.black87,
|
||||
context: context,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
builder: (builder) {
|
||||
return DetailMagazine(
|
||||
magazines: magazines,
|
||||
toolbarTitle: rowTitle,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class ItemMagRow extends StatelessWidget {
|
||||
const ItemMagRow({
|
||||
Key key,
|
||||
@@ -22,11 +42,27 @@ class ItemMagRow extends StatelessWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16, top: 26),
|
||||
child: Text(
|
||||
rowTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
rowTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => showDetailCategoryMagazine(
|
||||
context: context,
|
||||
magazines: magazines,
|
||||
rowTitle: rowTitle,
|
||||
),
|
||||
child: Text(
|
||||
'Détails',
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFF25ADF3)),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:le_kiosque_by_gcs/model/magazine.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/custom/item_mag_large.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/view/detailmag/detail_mag.dart';
|
||||
|
||||
import 'item_mag_row.dart';
|
||||
import 'item_mag_small.dart';
|
||||
|
||||
class ItemMagRowNewest extends StatelessWidget {
|
||||
@@ -11,6 +13,8 @@ class ItemMagRowNewest extends StatelessWidget {
|
||||
}) : super(key: key);
|
||||
|
||||
final List<Magazine> magazines;
|
||||
final title = "Nouveautés";
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -21,11 +25,27 @@ class ItemMagRowNewest extends StatelessWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16, top: 26),
|
||||
child: Text(
|
||||
"Nouveautés",
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => showDetailCategoryMagazine(
|
||||
context: context,
|
||||
magazines: magazines,
|
||||
rowTitle: title,
|
||||
),
|
||||
child: Text(
|
||||
'Détails',
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFF25ADF3)),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:le_kiosque_by_gcs/model/magazine.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/pdf_reader.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/view/pdf_reader.dart';
|
||||
|
||||
class ItemMagSmall extends StatelessWidget {
|
||||
const ItemMagSmall({Key key, this.magazine}) : super(key: key);
|
||||
@@ -20,8 +21,7 @@ class ItemMagSmall extends StatelessWidget {
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(
|
||||
"https://miningandbusiness.com/wp-content/uploads/2021/02/03f19c3a-1d92-4be7-ac54-f52b37e626ad-561x771.jpg"),
|
||||
image: NetworkImage(magazine.urlCover),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
@@ -34,7 +34,7 @@ class ItemMagSmall extends StatelessWidget {
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return PdfReader(
|
||||
pdfUrl: "http://www.africau.edu/images/default/sample.pdf",
|
||||
pdfUrl: magazine.magazineUrl,
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user