Fakultas Ilmu Komputer UI

Commit 1497d4aa authored by Tsamara Esperanti Erwin's avatar Tsamara Esperanti Erwin
Browse files

[CHORES] Clean code

parent 070f1c29
Pipeline #61129 passed with stages
in 27 minutes and 22 seconds
......@@ -155,7 +155,7 @@ class Router {
RepositoryProvider.of<DependenciesRepositories>(
context)
.dio),
child: Programs()
child: const Programs()
));
case detailProgramPage:
......
......@@ -60,7 +60,7 @@ class ProgramBloc extends Bloc<ProgramEvent, ProgramState> {
}
} else if ((event is FetchProgramByStatus) && !_hasReachedMaxSorted(currentState)) {
try {
var programs =
final programs =
await programRepository.fetchProgram(page: currentState.page + 1);
if (currentState is ListProgramsLoaded || currentState is InitialListProgramState) {
programs.results.sort((a,b) => b.endDateTime.compareTo(a.endDateTime));
......
......@@ -69,17 +69,17 @@ class _ProgramsState extends State<Programs> {
),
),
bottomNavigationBar: Container(
margin: EdgeInsets.symmetric(horizontal: 25.0),
margin: const EdgeInsets.symmetric(horizontal: 25.0),
child: Wrap(children: [
Padding(
padding: const EdgeInsets.only(top: 20),
const Padding(
padding: EdgeInsets.only(top: 20),
child: Text('Urutkan Berdasarkan:',
style: TextStyle(fontSize: 16.0),),
),
GestureDetector(
onTap: () {
setState(() {
programList = _ListProgramSortStatus();
programList = const _ListProgramSortStatus();
});
},
child: FilterButton(sort: 'Status')
......@@ -87,7 +87,7 @@ class _ProgramsState extends State<Programs> {
GestureDetector(
onTap: () {
setState(() {
programList = _ListProgram();
programList = const _ListProgram();
});
},
child: FilterButton(sort: 'Tanggal')
......@@ -336,7 +336,7 @@ class ProgramCard extends StatelessWidget {
class _ProgramDescription extends StatelessWidget {
final Program program;
_ProgramDescription({Key key, @required this.program})
const _ProgramDescription({Key key, @required this.program})
: assert(program != null),
super(key: key);
......@@ -383,7 +383,7 @@ class _ProgramDescription extends StatelessWidget {
),
if ( program.endDateTime != null &&
program.endDateTime.compareTo(CustomizableDateTime.current) < 1)
Text(
const Text(
'Selesai',
style: TextStyle(fontWeight: FontWeight.bold),
)
......@@ -429,7 +429,9 @@ class _DonasiButton extends StatelessWidget {
class FilterButton extends StatelessWidget {
final String sort;
FilterButton({Key key, @required this.sort});
FilterButton({Key key, @required this.sort})
: assert(sort != null),
super(key: key);
@override
Widget build(BuildContext context) {
......@@ -442,7 +444,7 @@ class FilterButton extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
child: Text(sort,
style: TextStyle(color: Colors.white),
style: const TextStyle(color: Colors.white),
),
),
);
......
Supports Markdown
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