added ad provider

This commit is contained in:
Kima
2023-09-05 18:49:14 +02:00
parent fceb4e050f
commit a5a43ea0b9
13 changed files with 217 additions and 7 deletions

View File

@@ -0,0 +1,30 @@
import 'package:filcnaplo/models/ad.dart';
import 'package:flutter/material.dart';
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class AdTile extends StatelessWidget {
const AdTile(this.ad, {Key? key, this.onTap, this.padding}) : super(key: key);
final Ad ad;
final Function()? onTap;
final EdgeInsetsGeometry? padding;
@override
Widget build(BuildContext context) {
return Padding(
padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0),
child: PanelButton(
onPressed: onTap,
title: Column(
children: [
Text(ad.title),
Text(ad.description),
],
),
leading: Image.network(ad.logoUrl.toString()),
trailing: const Icon(FeatherIcons.externalLink),
),
);
}
}

View File

@@ -0,0 +1,18 @@
import 'package:filcnaplo/models/ad.dart';
import 'package:flutter/material.dart';
import 'ad_tile.dart';
class AdViewable extends StatelessWidget {
const AdViewable(this.ad, {Key? key}) : super(key: key);
final Ad ad;
@override
Widget build(BuildContext context) {
return AdTile(
ad,
onTap: () => [],
);
}
}