recent activities added.
parent
fe624596a1
commit
e3fbcae6d3
@ -1,11 +1,62 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:test_sa/controllers/providers/api/notifications_provider.dart';
|
||||
import 'package:test_sa/extensions/int_extensions.dart';
|
||||
import 'package:test_sa/extensions/text_extensions.dart';
|
||||
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||
import 'package:test_sa/views/widgets/notifications/notification_item.dart';
|
||||
|
||||
class RecentActivitiesFragment extends StatelessWidget {
|
||||
RecentActivitiesFragment({Key key}) : super(key: key);
|
||||
|
||||
NotificationsProvider _notificationsProvider;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: implement build
|
||||
return Container();
|
||||
_notificationsProvider ??= Provider.of<NotificationsProvider>(context);
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
shadows: const [
|
||||
BoxShadow(
|
||||
color: Color(0x07000000),
|
||||
blurRadius: 14,
|
||||
offset: Offset(0, 0),
|
||||
spreadRadius: 0,
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Recent Activities", style: AppTextStyles.heading5.copyWith(color: AppColor.neutral50)).paddingOnly(top: 16, start: 16, end: 16),
|
||||
ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: _notificationsProvider.notifications.length,
|
||||
separatorBuilder: (context, itemIndex) => 1.divider.paddingOnly(top: 16, bottom: 16),
|
||||
itemBuilder: (context, itemIndex) {
|
||||
// todo add priority & progress tag to show chip
|
||||
return NotificationItem(
|
||||
notification: _notificationsProvider.notifications[itemIndex],
|
||||
onPressed: (notification) {
|
||||
// todo @sikander, check notifications payload, because notification model is different to need to check from backend
|
||||
//Navigator.of(context).pushNamed(FutureRequestServiceDetails.id, arguments: notification.requestId);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/extensions/int_extensions.dart';
|
||||
|
||||
import '../../app_style/app_color.dart';
|
||||
|
||||
class DashboardPageIndicator extends StatelessWidget {
|
||||
final PageController controller;
|
||||
final int index, currentPage;
|
||||
|
||||
const DashboardPageIndicator({
|
||||
Key key,
|
||||
@required this.controller,
|
||||
@required this.index,
|
||||
@required this.currentPage,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool isActive = currentPage == (index + 1);
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
controller.animateToPage(index, duration: const Duration(milliseconds: 500), curve: Curves.ease);
|
||||
},
|
||||
child: Container(
|
||||
width: (isActive ? 30 : 12).toScreenWidth,
|
||||
height: 9.toScreenHeight,
|
||||
decoration: BoxDecoration(color: isActive ? AppColor.green50 : AppColor.neutral40, borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue