You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:sonnat/core/theme/cubit/theme_cubit.dart';
|
|
|
|
extension ContextExtentions on BuildContext {
|
|
double get height {
|
|
return MediaQuery.of(this).size.height;
|
|
}
|
|
|
|
double get width {
|
|
return MediaQuery.of(this).size.width;
|
|
}
|
|
|
|
Container get horizontalDivider {
|
|
return Container(
|
|
height: 2,
|
|
margin: const EdgeInsets.symmetric(horizontal: 16),
|
|
width: width,
|
|
color: theme.colors.primary80.withOpacity(0.05),
|
|
);
|
|
}
|
|
|
|
Container get verticalDivider {
|
|
return Container(
|
|
height: 12,
|
|
width: 1,
|
|
color: theme.colors.primary80.withOpacity(0.05),
|
|
);
|
|
}
|
|
|
|
ThemeCubit get theme {
|
|
return read<ThemeCubit>();
|
|
}
|
|
|
|
Future<dynamic> push(Widget page) async {
|
|
await Navigator.push(this, MaterialPageRoute(builder: (_) => page));
|
|
}
|
|
|
|
Future<dynamic> pushNamed(String name) async {
|
|
await Navigator.pushNamed(this, name);
|
|
}
|
|
|
|
Future<dynamic> pushReplacement(Widget page) async {
|
|
await Navigator.pushReplacement(this, MaterialPageRoute(builder: (_) => page));
|
|
}
|
|
|
|
Future<void> pop(Widget page, [result]) async {
|
|
Navigator.pop(this, result);
|
|
}
|
|
}
|