Initial commit
This commit is contained in:
47
lib/ui/components/current_status_component.dart
Normal file
47
lib/ui/components/current_status_component.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart' show DateFormat;
|
||||
import 'package:reverse_nn/application/controllers/schedule_controller.dart';
|
||||
|
||||
class CurrentStatusComponent extends StatelessWidget {
|
||||
const CurrentStatusComponent({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ScheduleController controller = Get.put(ScheduleController());
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: GetBuilder<ScheduleController>(
|
||||
builder: (scheduleController) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.exit_to_app, size: 96),
|
||||
const SizedBox(width: 16),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if(scheduleController.currentSchedule.value != null) ...[
|
||||
Text(scheduleController.currentSchedule.value?['direction'] ?? '', style: Theme.of(context).textTheme.headlineLarge),
|
||||
Text('C ${formatDate(scheduleController.currentSchedule.value?['start'])} До ${formatDate(scheduleController.currentSchedule.value!['end'])}', style: Theme.of(context).textTheme.titleMedium)
|
||||
]
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String formatDate(DateTime date) => DateFormat('hh:mm').format(date);
|
||||
|
||||
}
|
||||
33
lib/ui/components/grid_menu_item.dart
Normal file
33
lib/ui/components/grid_menu_item.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GridMenuItem extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String label;
|
||||
final void Function()? onTap;
|
||||
|
||||
const GridMenuItem({super.key, required this.icon, required this.label, this.onTap});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Icon(icon, size: 64),
|
||||
const SizedBox(height: 6),
|
||||
Text(label, style: Theme.of(context).textTheme.titleMedium, textAlign: TextAlign.center)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user