Commit 4dcc87e2 authored by NguyenTienManh's avatar NguyenTienManh

update

parent 7b73b6a0
...@@ -14,17 +14,4 @@ class RemoteCourseDetail{ ...@@ -14,17 +14,4 @@ class RemoteCourseDetail{
} }
return null; return null;
} }
} }
\ No newline at end of file
// class RemoteCourseDetail{
// Future<CourseDetailModel?> getCourseDetailModel() async{
// var dio = Dio();
// String url = ("https://imes-api.myitsol.com/api/v1/public/course/ef6c4a7b-54f7-46b7-9ffd-99b057baa757");
// var response = await dio.get(url);
// if(response.statusCode == 200){
// var json = response.data;
// return CourseDetailModel.fromJson(json);
// }
// return null;
// }
// }
\ No newline at end of file
...@@ -22,67 +22,83 @@ class LoginPage extends StatelessWidget { ...@@ -22,67 +22,83 @@ class LoginPage extends StatelessWidget {
}, },
builder: (context, state) { builder: (context, state) {
return return
Column( Container(
children: [ color: AppColors.background,
Padding( child: Column(
padding: const EdgeInsets.only(left: 60, right: 60), children: [
child: Padding(
TextFormField( padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
decoration: const InputDecoration( child: Row(
labelText: 'Product Name', mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Dang Ky & Tu Van',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16),),
],
), ),
controller: _userController,
), ),
), Padding(
padding: const EdgeInsets.only(left: 60, right: 60),
Padding( child:
padding: const EdgeInsets.only(left: 60, right: 60), TextFormField(
child: decoration: const InputDecoration(
TextFormField( labelText: 'Product Name',
decoration: const InputDecoration( ),
labelText: 'PassWord', controller: _userController,
), ),
controller: _passController,
), ),
), Padding(
padding: const EdgeInsets.only(left: 60, right: 60),
OutlinedButton( child:
style: OutlinedButton.styleFrom(minimumSize: Size(400, 50),backgroundColor: AppColors.primary, TextFormField(
shape: RoundedRectangleBorder( decoration: const InputDecoration(
borderRadius: BorderRadius.circular(20.0), labelText: 'PassWord',
), ),
controller: _passController,
), ),
onPressed: () async { ),
BlocProvider.of<LoginBloc>(context).add(
RequestLogin( Padding(
context: context, padding: const EdgeInsets.all(20.0),
username: _userController.text, child: OutlinedButton(
password: _passController.text)); style: OutlinedButton.styleFrom(
}, minimumSize: const Size.fromHeight(50),
child: Text("Submit Form".toUpperCase(), backgroundColor: AppColors.primary,
style: const TextStyle( shape: RoundedRectangleBorder(
color: AppColors.white, borderRadius: BorderRadius.circular(20.0),
fontWeight: FontWeight.bold),) ),
), ),
BlocBuilder<LoginBloc, LoginState>( onPressed: () async {
builder: (context, state) { BlocProvider.of<LoginBloc>(context).add(
if (state is LoginLoading) { RequestLogin(
context: context,
username: _userController.text,
password: _passController.text));
},
child: Text("Dang Nhap".toUpperCase(),
style: const TextStyle(
color: AppColors.white,
fontWeight: FontWeight.bold),)
),
),
BlocBuilder<LoginBloc, LoginState>(
builder: (context, state) {
if (state is LoginLoading) {
return const CircularProgressIndicator();
}
if (state is LoginFailed) {
return const Text('login false!');
}
if (state is LoginInitial) {
return
Text('LoginInitial');
}
if (state is LoginSuccess) {
return
Text('Dang Nhap Thanh Cong');
}
return const CircularProgressIndicator(); return const CircularProgressIndicator();
} }),
if (state is LoginFailed) { ],
return const Text('login false!'); ),
}
if (state is LoginInitial) {
return
Text('LoginInitial');
}
if (state is LoginSuccess) {
return
Text('Dang Nhap Thanh Cong');
}
return const CircularProgressIndicator();
}),
],
); );
}, },
); );
......
This diff is collapsed.
...@@ -124,14 +124,14 @@ class _HomePageState extends State<HomePage> { ...@@ -124,14 +124,14 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
height: 40, height: 40,
width: 200, width: checkLandscape(context)?getWidth(context)*0.7:getWidth(context)*0.5,
child: Padding( child: const Padding(
padding: const EdgeInsets.fromLTRB(5, 10, 0, 10), padding: EdgeInsets.fromLTRB(5, 10, 0, 10),
child: Text('Tim Kiem',style: TextStyle(fontSize: 15,color: Colors.white),), child: Text('Tim Kiem',style: TextStyle(fontSize: 15,color: Colors.white),),
), ),
), ),
), ),
Image.asset(Images.notify,height: 40,width: 40,), Image.asset(Images.notify,height: 30,width: 30,),
],), ],),
); );
} }
......
...@@ -534,6 +534,13 @@ packages: ...@@ -534,6 +534,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.99"
smooth_page_indicator:
dependency: "direct main"
description:
name: smooth_page_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
source_gen: source_gen:
dependency: transitive dependency: transitive
description: description:
......
...@@ -44,6 +44,7 @@ dependencies: ...@@ -44,6 +44,7 @@ dependencies:
json_annotation: ^4.7.0 json_annotation: ^4.7.0
flutter_swiper_view: ^1.1.8 flutter_swiper_view: ^1.1.8
youtube_player_flutter: ^8.1.2 youtube_player_flutter: ^8.1.2
smooth_page_indicator: ^1.0.1
dev_dependencies: dev_dependencies:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment