feat: current outlet
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:enaklo_pos/core/components/spaces.dart';
|
||||
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
||||
import 'package:enaklo_pos/presentation/home/bloc/current_outlet/current_outlet_bloc.dart';
|
||||
import 'package:enaklo_pos/presentation/home/dialog/outlet_dialog.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../core/components/search_input.dart';
|
||||
import '../../../core/constants/colors.dart';
|
||||
@@ -32,23 +34,46 @@ class HomeTitle extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (context) => OutletDialog(),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Text(
|
||||
'DEFAULT OUTLET',
|
||||
style: TextStyle(
|
||||
color: AppColors.primary,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SpaceWidth(2),
|
||||
Icon(Icons.keyboard_arrow_down, color: AppColors.primary),
|
||||
],
|
||||
child: BlocBuilder<CurrentOutletBloc, CurrentOutletState>(
|
||||
builder: (context, state) {
|
||||
return Row(
|
||||
children: [
|
||||
state.maybeWhen(
|
||||
orElse: () => const Text(
|
||||
'DEFAULT OUTLET',
|
||||
style: TextStyle(
|
||||
color: AppColors.primary,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
loading: () => Center(
|
||||
child: SizedBox(
|
||||
height: 16,
|
||||
width: 16,
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
loaded: (outlet) => Text(
|
||||
outlet.name ?? 'DEFAULT OUTLET',
|
||||
style: TextStyle(
|
||||
color: AppColors.primary,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
SpaceWidth(2),
|
||||
Icon(Icons.keyboard_arrow_down, color: AppColors.primary),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 300.0,
|
||||
width: context.deviceWidth * 0.2,
|
||||
child: SearchInput(
|
||||
controller: controller,
|
||||
onChanged: onChanged,
|
||||
|
||||
Reference in New Issue
Block a user