added ad provider
This commit is contained in:
30
filcnaplo_mobile_ui/lib/common/widgets/ad/ad_tile.dart
Normal file
30
filcnaplo_mobile_ui/lib/common/widgets/ad/ad_tile.dart
Normal 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),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
18
filcnaplo_mobile_ui/lib/common/widgets/ad/ad_viewable.dart
Normal file
18
filcnaplo_mobile_ui/lib/common/widgets/ad/ad_viewable.dart
Normal 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: () => [],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user