mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 20:54:55 +00:00
initialized Application theme
This commit is contained in:
24
lib/features/home/view/widgets/home_view_body.dart
Normal file
24
lib/features/home/view/widgets/home_view_body.dart
Normal file
@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/home/bloc/home_cubit.dart';
|
||||
|
||||
import 'home_view_no_devices.dart';
|
||||
|
||||
class HomeViewBody extends StatelessWidget {
|
||||
const HomeViewBody({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => HomeCubit(),
|
||||
child: BlocBuilder<HomeCubit, HomeState>(
|
||||
builder: (context, state) {
|
||||
return HomeCubit.get(context).devices.isEmpty
|
||||
? const HomeViewNoDevices()
|
||||
: const SizedBox();
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
39
lib/features/home/view/widgets/home_view_no_devices.dart
Normal file
39
lib/features/home/view/widgets/home_view_no_devices.dart
Normal file
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_text_button.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
|
||||
class HomeViewNoDevices extends StatelessWidget {
|
||||
const HomeViewNoDevices({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
ImageManager.boxEmpty,
|
||||
opacity: const AlwaysStoppedAnimation(0.5),
|
||||
scale: 1,
|
||||
width: 140,
|
||||
),
|
||||
const Gap(15),
|
||||
const Text(
|
||||
'No Devices',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
const Gap(15),
|
||||
const DefaultTextButton(
|
||||
text: 'Add Device',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user