Skip to content

Commit

Permalink
🔉 Smart Speaker
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Jan 19, 2022
1 parent 4854cb6 commit 68442da
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 10 deletions.
Binary file added assets/icons/speaker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/kakao_mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/routes/routes.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:domus/src/screens/smart_ac/smart_ac.dart';
import 'package:domus/src/screens/smart_light/smart_light.dart';
import 'package:domus/src/screens/smart_speaker/smart_speaker.dart';
import 'package:domus/src/screens/splash_screen/splash_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:domus/src/screens/home_screen/home_screen.dart';
Expand All @@ -9,4 +10,5 @@ final Map<String, WidgetBuilder> routes = {
SmartLight.routeName: (context) => SmartLight(),
SplashScreen.routeName: (context) => SplashScreen(),
SmartAC.routeName: (context) => SmartAC(),
SmartSpeaker.routeName: (context) => SmartSpeaker(),
};
13 changes: 8 additions & 5 deletions lib/src/screens/home_screen/components/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:domus/src/screens/home_screen/components/reusable_container.dart
import 'package:domus/src/screens/home_screen/components/weather_container.dart';
import 'package:domus/src/screens/smart_ac/smart_ac.dart';
import 'package:domus/src/screens/smart_light/smart_light.dart';
import 'package:domus/src/screens/smart_speaker/smart_speaker.dart';
import 'package:domus/view/home_screen_view_model.dart';
import 'package:flutter/material.dart';

Expand Down Expand Up @@ -37,7 +38,7 @@ class Body extends StatelessWidget {
padding: EdgeInsets.all(getProportionateScreenHeight(5)),
child: ReusableCard(
title: 'Smart Light',
icon1: 'assets/icons/Light_off.png',
icon1: 'assets/icons/Light.png',
isON: model.isLightOn,
context: context,
onTap: () {
Expand Down Expand Up @@ -72,11 +73,13 @@ class Body extends StatelessWidget {
child: Padding(
padding: EdgeInsets.all(getProportionateScreenHeight(5)),
child: ReusableCard(
title: 'Smart TV',
isON: model.isTVON,
icon1: 'assets/icons/TV.png',
title: 'Smart Speaker',
isON: model.isSpeakerON,
icon1: 'assets/icons/speaker.png',
context: context,
onTap: () {},
onTap: () {
Navigator.of(context).pushNamed(SmartSpeaker.routeName);
},
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ Widget ReusableCard(
),
],
),
Text(
title,
style: Theme.of(context).textTheme.headline2,
InkWell(
onTap: onTap,
child: Text(
title,
style: Theme.of(context).textTheme.headline2,
),
),
],
),
Expand Down
11 changes: 11 additions & 0 deletions lib/src/screens/smart_speaker/components/body.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:domus/src/screens/smart_speaker/components/connect_speaker.dart';
import 'package:flutter/material.dart';

class Body extends StatelessWidget {
const Body({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Center(child: ConnectSpeaker());
}
}
68 changes: 68 additions & 0 deletions lib/src/screens/smart_speaker/components/connect_speaker.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import 'package:domus/config/size_config.dart';
import 'package:flutter/material.dart';

class ConnectSpeaker extends StatelessWidget {
const ConnectSpeaker({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SizedBox(
height: getProportionateScreenHeight(40),
),
Align(
alignment: Alignment.centerLeft,
child: InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(Icons.arrow_back_outlined),
),
),
Text(
'Kakao Mini C',
style: Theme.of(context).textTheme.headline1,
),
Text(
'Smart Speaker',
style: Theme.of(context).textTheme.headline3,
),
SizedBox(
height: getProportionateScreenHeight(40),
),
Material(
child: Image.asset(
'assets/images/kakao_mini.png',
height: getProportionateScreenHeight(300),
width: getProportionateScreenWidth(150),
fit: BoxFit.contain,
),
color: Colors.transparent,
),
SizedBox(
height: getProportionateScreenHeight(40),
),
OutlinedButton(
onPressed: () {},
child: Text(
'Connect',
style: Theme.of(context).textTheme.headline3,
),
style: OutlinedButton.styleFrom(
padding: EdgeInsets.symmetric(
horizontal: getProportionateScreenWidth(80),
vertical: getProportionateScreenHeight(10),
),
shape: StadiumBorder(),
),
)
],
),
);
}
}
6 changes: 5 additions & 1 deletion lib/src/screens/smart_speaker/smart_speaker.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import 'package:flutter/material.dart';
import 'components/body.dart';

class SmartSpeaker extends StatelessWidget {
static String routeName = 'smart-speaker';
const SmartSpeaker({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container();
return Scaffold(
backgroundColor: Color(0xFFF2F2F2),
body: Body(),
);
}
}
2 changes: 1 addition & 1 deletion lib/view/home_screen_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HomeScreenViewModel extends BaseModel {
final PageController pageController = PageController();
bool isLightOn = true;
bool isACON = false;
bool isTVON = false;
bool isSpeakerON = false;
bool isFanON = false;

void generateRandomNumber() {
Expand Down

0 comments on commit 68442da

Please sign in to comment.