Skip to content

Commit

Permalink
add get premium card
Browse files Browse the repository at this point in the history
  • Loading branch information
firgia committed Oct 26, 2021
1 parent 71a1cd9 commit 30f460b
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 11 deletions.
1 change: 1 addition & 0 deletions assets/images/vector/wavy-bus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/app/constans/assets_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ class ImageVectorPath {
static const _folderPath = "assets/images/vector";
static const happy = "$_folderPath/happy.svg";
static const happy2 = "$_folderPath/happy-2.svg";
static const wavyBus = "$_folderPath/wavy-bus.svg";
}
14 changes: 3 additions & 11 deletions lib/app/features/dashboard/controllers/dashboard_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ class DashboardController extends GetxController {
List<ChattingCardData> getChatting() {
return const [
ChattingCardData(
image: AssetImage(ImageRasterPath.avatar2),
image: AssetImage(ImageRasterPath.avatar6),
isOnline: true,
name: "Susi",
name: "Samantha",
lastMessage: "i added my new tasks",
isRead: false,
totalUnread: 19,
totalUnread: 100,
),
ChattingCardData(
image: AssetImage(ImageRasterPath.avatar3),
Expand All @@ -123,14 +123,6 @@ class DashboardController extends GetxController {
isRead: false,
totalUnread: 1,
),
ChattingCardData(
image: AssetImage(ImageRasterPath.avatar5),
isOnline: false,
name: "Samantha",
lastMessage: "sure, i will",
isRead: false,
totalUnread: 100,
),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'dart:developer';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:project_management/app/constans/app_constants.dart';
import 'package:project_management/app/shared_components/chatting_card.dart';
import 'package:project_management/app/shared_components/get_premium_card.dart';
import 'package:project_management/app/shared_components/list_profil_image.dart';
import 'package:project_management/app/shared_components/progress_card.dart';
import 'package:project_management/app/shared_components/progress_report_card.dart';
Expand Down Expand Up @@ -83,6 +84,13 @@ class DashboardScreen extends GetView<DashboardController> {
onPressedAdd: () {},
),
const SizedBox(height: kSpacing),
Padding(
padding: const EdgeInsets.symmetric(horizontal: kSpacing),
child: GetPremiumCard(onPressed: () {}),
),
const SizedBox(height: kSpacing),
const Divider(thickness: 1),
const SizedBox(height: kSpacing),
_buildRecentMessages(
data: controller.getChatting(),
onPressedMore: () {},
Expand Down
76 changes: 76 additions & 0 deletions lib/app/shared_components/get_premium_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:project_management/app/constans/app_constants.dart';

class GetPremiumCard extends StatelessWidget {
const GetPremiumCard({
required this.onPressed,
this.backgroundColor,
Key? key,
}) : super(key: key);

final Color? backgroundColor;
final Function() onPressed;

@override
Widget build(BuildContext context) {
return Material(
borderRadius: BorderRadius.circular(kBorderRadius),
color: backgroundColor ?? Theme.of(context).cardColor,
child: InkWell(
borderRadius: BorderRadius.circular(kBorderRadius),
onTap: onPressed,
child: Container(
constraints: const BoxConstraints(
minWidth: 250,
maxWidth: 350,
minHeight: 200,
maxHeight: 200,
),
padding: const EdgeInsets.all(10),
child: Stack(
children: [
Align(
alignment: Alignment.topRight,
child: SvgPicture.asset(
ImageVectorPath.wavyBus,
width: 180,
height: 180,
fit: BoxFit.contain,
),
),
const Padding(
padding: EdgeInsets.all(15),
child: _Info(),
),
],
),
),
),
);
}
}

class _Info extends StatelessWidget {
const _Info({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Get\nPremium\nAccount",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
Text(
"To add more members",
style: Theme.of(context).textTheme.caption,
),
],
);
}
}
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'Project Management',
debugShowCheckedModeBanner: false,
theme: AppTheme.basic,
initialRoute: AppPages.initial,
getPages: AppPages.routes,
Expand Down

0 comments on commit 30f460b

Please sign in to comment.