mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-03-10 21:21:44 +00:00
PR fixes
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class BookingModel {
|
||||
String uuid, roomName, date, timeSlot;
|
||||
int cost;
|
||||
final String uuid, roomName, date, timeSlot;
|
||||
final int cost;
|
||||
BookingModel({
|
||||
required this.uuid,
|
||||
required this.roomName,
|
||||
@ -18,11 +16,11 @@ class BookingModel {
|
||||
cost: -1,
|
||||
);
|
||||
factory BookingModel.fromJson(Map<String, dynamic> json) => BookingModel(
|
||||
uuid: json['uuid'],
|
||||
roomName: json['roomName'],
|
||||
date: json['date'],
|
||||
timeSlot: json['timeSlot'],
|
||||
cost: json['cost'],
|
||||
uuid: json['uuid'] as String,
|
||||
roomName: json['roomName'] as String,
|
||||
date: json['date'] as String,
|
||||
timeSlot: json['timeSlot'] as String,
|
||||
cost: json['cost'] as int,
|
||||
);
|
||||
|
||||
static List<BookingModel> fromJsonList(List<dynamic> jsonList) => jsonList
|
||||
|
||||
@ -13,7 +13,7 @@ class PastBookingsBloc extends Bloc<PastBookingsEvent, PastBookingsState> {
|
||||
PastBookingsBloc(this._bookingService) : super(PastBookingsInitial()) {
|
||||
on<GetPastBookingsEvent>(_onGetPastBookingsEvent);
|
||||
}
|
||||
_onGetPastBookingsEvent(
|
||||
Future<void> _onGetPastBookingsEvent(
|
||||
GetPastBookingsEvent event,
|
||||
Emitter<PastBookingsState> emit,
|
||||
) async {
|
||||
|
||||
@ -7,13 +7,13 @@ part 'upcoming_bookings_event.dart';
|
||||
part 'upcoming_bookings_state.dart';
|
||||
|
||||
class UpcomingBookingsBloc
|
||||
extends Bloc<GetUpcomingBookingsEvent, UpcomingBookingsState> {
|
||||
extends Bloc<UpcomingBookingsEvent, UpcomingBookingsState> {
|
||||
final BookingService _bookingService;
|
||||
UpcomingBookingsBloc(this._bookingService)
|
||||
: super(UpcomingBookingsInitial()) {
|
||||
on<GetUpcomingBookingsEvent>(_onGetUpcomingBookingsEvent);
|
||||
}
|
||||
_onGetUpcomingBookingsEvent(
|
||||
Future<void> _onGetUpcomingBookingsEvent(
|
||||
GetUpcomingBookingsEvent event,
|
||||
Emitter<UpcomingBookingsState> emit,
|
||||
) async {
|
||||
|
||||
@ -13,7 +13,7 @@ class BookPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
padding: EdgeInsets.all(0),
|
||||
padding: EdgeInsets.zero,
|
||||
appBar: BookingAppBar(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@ -4,7 +4,7 @@ import '../../../../utils/resource_manager/color_manager.dart';
|
||||
import '../screens/book_page.dart';
|
||||
|
||||
class CurrentBalanceWidget extends StatelessWidget {
|
||||
final String? userBalance;
|
||||
final String userBalance;
|
||||
const CurrentBalanceWidget({
|
||||
super.key,
|
||||
required this.userBalance,
|
||||
@ -15,9 +15,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.onPrimaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20),
|
||||
)),
|
||||
borderRadius: BorderRadius.circular(20)),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@ -45,7 +43,7 @@ class CurrentBalanceWidget extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'$userBalance',
|
||||
userBalance,
|
||||
style: TextStyle(
|
||||
color: ColorsManager.blueColor1,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
double deviceHeight(BuildContext context) => MediaQuery.of(context).size.height;
|
||||
double deviceWidth(BuildContext context) => MediaQuery.of(context).size.width;
|
||||
double deviceHeight(BuildContext context) => MediaQuery.sizeOf(context).height;
|
||||
double deviceWidth(BuildContext context) => MediaQuery.sizeOf(context).width;
|
||||
|
||||
Reference in New Issue
Block a user