mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 23:27:55 +00:00
Added create a unit screen, and implemented otp screen bloc and view
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/scene_cubit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/create_unit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
@@ -17,100 +19,102 @@ class SceneView extends StatelessWidget {
|
||||
create: (BuildContext context) => SceneCubit(),
|
||||
child: BlocBuilder<SceneCubit, SceneState>(
|
||||
builder: (context, state) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const TitleMedium(
|
||||
text: StringsManager.routine,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const BodySmall(
|
||||
text: StringsManager.tapToRunRoutine,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
child: DefaultContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
height: 50,
|
||||
width: 50,
|
||||
Assets.assetsIconsHot1,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_circle,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
const BodyMedium(
|
||||
text: StringsManager.summerMode,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
return HomeCubit.getInstance().spaces?.isEmpty ?? true
|
||||
? const CreateUnitWidget()
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const TitleMedium(
|
||||
text: StringsManager.routine,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
child: DefaultContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
height: 50,
|
||||
width: 50,
|
||||
Assets.assetsIconsWinter1,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_circle,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
const BodyMedium(
|
||||
text: StringsManager.winterMode,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const BodySmall(
|
||||
text: StringsManager.tapToRunRoutine,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
child: DefaultContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
height: 50,
|
||||
width: 50,
|
||||
Assets.assetsIconsHot1,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_circle,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
const BodyMedium(
|
||||
text: StringsManager.summerMode,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
child: DefaultContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
height: 50,
|
||||
width: 50,
|
||||
Assets.assetsIconsWinter1,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_circle,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
const BodyMedium(
|
||||
text: StringsManager.winterMode,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user