Commit 92ff4883 authored by Nilupul Jayasekara's avatar Nilupul Jayasekara

Implement menu card

parent f517e823
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MenuCard extends StatefulWidget { class MenuCard extends StatefulWidget {
const MenuCard({ Key? key }) : super(key: key); const MenuCard({Key? key}) : super(key: key);
@override @override
State<MenuCard> createState() => _MenuCardState(); State<MenuCard> createState() => _MenuCardState();
...@@ -16,10 +16,98 @@ class _MenuCardState extends State<MenuCard> { ...@@ -16,10 +16,98 @@ class _MenuCardState extends State<MenuCard> {
height: 100, height: 100,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(20)), borderRadius: const BorderRadius.all(Radius.circular(20)),
color: Colors.teal[200], color: Colors.teal[200],
), ),
child: getWidgetByIndex(0),
), ),
); );
} }
}
\ No newline at end of file Widget getWidgetByIndex(int index) {
switch (index) {
case 0:
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(
height: 16,
),
Text('LATEST CHECK 29/04/2022 12:47 PM'),
const SizedBox(
height: 20,
),
const Text('WEEKLY ENTRIES', style: TextStyle(fontWeight: FontWeight.bold),),
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 36),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
const Text('In Range'),
Row(
children: [
Icon(
Icons.thumb_up,
size: 30,
),
Text(
'0',
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold),
)
],
),
],
),
Column(
children: [
const Text('Below'),
Row(
children: [
Icon(
Icons.arrow_downward,
size: 30,
),
Text(
'0',
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold),
)
],
),
],
),
Column(
children: [
const Text('Above'),
Row(
children: [
Icon(
Icons.arrow_upward,
size: 30,
),
Text(
'0',
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold),
)
],
),
],
)
],
),
),
],
);
default:
return Container();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment