Pipeline card: set columns

This commit is contained in:
Arthi-chaud
2022-01-22 11:11:12 +01:00
parent dc3d5e9ed0
commit 8d27e69691
4 changed files with 41 additions and 7 deletions
-2
View File
@@ -1,5 +1,3 @@
/// Enumeration of Services that trigger pipelines
enum Service { youtube, discord, gmail, github, twitter, spotify }
// Class for a service (Youtube, Gmail, ...)
class Service {
+8 -1
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:mobile/src/models/pipeline.dart';
import 'package:mobile/src/widgets/aeris_page.dart';
import 'package:mobile/src/widgets/pipeline_card.dart';
@@ -8,6 +9,12 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const AerisPage(body: ARCard());
return AerisPage(body: PipelineCard(pipeline: Pipeline(
id: 10,
name: "My Action",
triggerCount: 10,
lastTrigger: DateTime.now(),
enabled: true,
parameters: {})));
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ class AerisPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
body: body,
backgroundColor: Theme.of(context).primaryColor,
backgroundColor: Theme.of(context).colorScheme.primary,
appBar: displayAppbar ? AppBar(
title: const Text("AERIS"),
centerTitle: true,
+32 -3
View File
@@ -1,10 +1,39 @@
import 'package:flutter/material.dart';
import 'package:mobile/src/models/pipeline.dart';
/// Widget for Action-reaction card on home page
class PipelineCard extends StatelessWidget {
// Pipeline base object
final Pipeline pipeline;
const PipelineCard({Key? key, required this.pipeline}) : super(key: key);
@override
Widget build(BuildContext context) {
return Card(
child: Container(
width: double.infinity,
padding: const EdgeInsets.all(25),
child: Row(children: [
Expanded(
flex: 4,
child: Column(
children: [Text(pipeline.name)],
)),
Expanded(flex: 4, child: Column(children: [Text(pipeline.name)])),
Expanded(
flex: 2,
child: Column(
children: const [
Icon(
Icons.arrow_forward_ios,
color: Colors.grey,
)
],
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center)),
])),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(25))));
}
}
}