Fakultas Ilmu Komputer UI

Commit 6ee30340 authored by Tsamara Esperanti Erwin's avatar Tsamara Esperanti Erwin 🦄
Browse files

Coldfix pbi7

parent 73d09c86
......@@ -351,9 +351,11 @@ class _ModalCartItem extends StatelessWidget {
flex: 5,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceAround,
children: <Widget>[
Ink(
width: 30,
height: 30,
decoration: const ShapeDecoration(
color: Colors.red,
shape: CircleBorder(),
......@@ -366,7 +368,7 @@ class _ModalCartItem extends StatelessWidget {
.decrement();
},
color: Colors.white,
iconSize: 30)),
iconSize: 15)),
Consumer<CounterItem>(
builder: (_, counter, __) => Text(
'${counter.total}',
......@@ -375,6 +377,8 @@ class _ModalCartItem extends StatelessWidget {
),
),
Ink(
width: 30,
height: 30,
decoration: const ShapeDecoration(
color: Colors.green,
shape: CircleBorder(),
......@@ -387,7 +391,7 @@ class _ModalCartItem extends StatelessWidget {
.increment();
},
color: Colors.white,
iconSize: 30,
iconSize: 15,
)),
],
),
......
......@@ -151,9 +151,11 @@ class _DonasiBarangState extends State<DonasiBarang> {
),
const SizedBox(width: 70),
Container(
width: 187,
width: MediaQuery.of(context).size.width / 1.8,
height: 80,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: TextFormField(
controller: addressController,
keyboardType:
......@@ -165,7 +167,8 @@ class _DonasiBarangState extends State<DonasiBarang> {
return null;
},
maxLines: 5,
decoration: _inputDecoration()))
decoration: _inputDecoration()),
))
],
);
});
......@@ -359,7 +362,7 @@ class _GoodsFormState extends State<GoodsForm> {
),
const SizedBox(width: 20),
Container(
width: 187,
width: MediaQuery.of(context).size.width / 1.8,
height: 50,
child: TextFormField(
key: const Key('goods-desc'),
......@@ -399,7 +402,7 @@ class _GoodsFormState extends State<GoodsForm> {
),
const SizedBox(width: 70),
Container(
width: 187,
width: MediaQuery.of(context).size.width / 1.8,
height: 50,
color: Colors.white,
child: TextFormField(
......
......@@ -336,7 +336,7 @@ class _FormViewState extends State<_FormView> {
onPressed: _buttonSendClicked,
label: context.watch<Donation>() != null
? 'Unggah ulang'
: 'Donasi')),
: 'Donasi Sekarang')),
const Divider(
height: 10,
),
......
......@@ -68,6 +68,8 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
firstChild: Material(
color: Colors.transparent,
child: Ink(
height: 40,
width: 40,
decoration: ShapeDecoration(
color: Colors.grey.withOpacity(0.7),
shape: const CircleBorder(),
......@@ -184,6 +186,8 @@ class _ActionFlexibleExpanded extends StatelessWidget {
return Material(
color: Colors.transparent,
child: Ink(
height: 40,
width: 40,
decoration: ShapeDecoration(
color: Colors.grey.withOpacity(0.7),
shape: const CircleBorder(),
......
......@@ -118,9 +118,11 @@ class _BodyDetailProduct extends StatelessWidget {
flex: 5,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceAround,
children: <Widget>[
Ink(
width: 30,
height: 30,
decoration:
const ShapeDecoration(
color: Colors.red,
......@@ -134,7 +136,7 @@ class _BodyDetailProduct extends StatelessWidget {
.decrement();
},
color: Colors.white,
iconSize: 30)),
iconSize: 15)),
Consumer<CounterItem>(
builder: (_, counter, __) => Text(
'${counter.total}',
......@@ -143,6 +145,8 @@ class _BodyDetailProduct extends StatelessWidget {
),
),
Ink(
width: 30,
height: 30,
decoration: const ShapeDecoration(
color: Colors.green,
shape: CircleBorder(),
......@@ -155,7 +159,7 @@ class _BodyDetailProduct extends StatelessWidget {
.increment();
},
color: Colors.white,
iconSize: 30,
iconSize: 15,
)),
],
),
......
......@@ -12,6 +12,7 @@ import 'package:home_industry/Pages/Profile/bloc/profile_event.dart';
import 'package:home_industry/Pages/Profile/bloc/profile_state.dart';
import 'package:home_industry/Pages/Profile/model/profile.dart';
import 'package:image_picker/image_picker.dart';
import 'package:outline_material_icons/outline_material_icons.dart';
class EditProfile extends StatelessWidget {
const EditProfile({Key key}) : super(key: key);
......@@ -344,7 +345,7 @@ class _EditFormState extends State<EditForm> {
flex: 20,
child: CustomTextInputForm(
isNumberOnly: true,
prefixIcon: Icons.my_location,
prefixIcon: OMIcons.nearMe,
key: const Key('rt'),
label: 'RT',
onSave: _updateRt,
......@@ -359,7 +360,7 @@ class _EditFormState extends State<EditForm> {
flex: 20,
child: CustomTextInputForm(
isNumberOnly: true,
prefixIcon: Icons.my_location,
prefixIcon: OMIcons.nearMe,
key: const Key('rw'),
label: 'RW',
onSave: _updateRw,
......@@ -378,7 +379,7 @@ class _EditFormState extends State<EditForm> {
flex: 20,
child: CustomTextInputForm(
key: const Key('kelurahan'),
prefixIcon: Icons.location_searching,
prefixIcon: Icons.near_me,
label: 'Kelurahan',
onSave: _updateKelurahan,
maxLength: 100,
......@@ -393,7 +394,7 @@ class _EditFormState extends State<EditForm> {
child: CustomTextInputForm(
key: const Key('kecamatan'),
label: 'Kecamatan',
prefixIcon: Icons.location_searching,
prefixIcon: Icons.near_me,
onSave: _updateKecamatan,
maxLength: 100,
initialValue: widget.profile.subDistrict,
......
......@@ -73,11 +73,9 @@ class DetailProgram extends StatelessWidget {
'${formatDate(program.startDateTime)}'),
if (program.endDateTime != null)
_DeskripsiRow(
icon: Icons.cancel,
icon: Icons.schedule,
label:
'${formatTime(program.startDateTime)}'
' - '
'${formatTime(program.endDateTime)}',
'${formatTime(program.startDateTime)}',
),
if (program.location != null &&
program.location != '')
......
......@@ -64,7 +64,7 @@ class _ProgramsState extends State<Programs> {
RepositoryProvider.of<ProgramRepository>(context))
..add(const FetchProgram()),
child: Column(children: <Widget>[
programList
programList,
]),
),
),
......@@ -157,9 +157,9 @@ class __ListProgramState extends State<_ListProgram> {
),
);
} else {
return SizedBox(
height: MediaQuery.of(context).size.height - 50,
child: ListView.builder(
return Column(
children: [
ListView.builder(
itemCount: state.hasReachedMax
? state.programs.length
: state.programs.length + 1,
......@@ -169,13 +169,13 @@ class __ListProgramState extends State<_ListProgram> {
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return index >= state.programs.length
? const Center(
child: CustomCircularIndicator(),
)
? Container()
: ProgramCard(
program: state.programs[index],
);
}),
Container(height: 10)
],
);
}
} else if (state is ListProgramsSortedLoaded) {
......@@ -187,9 +187,9 @@ class __ListProgramState extends State<_ListProgram> {
),
);
} else {
return SizedBox(
height: MediaQuery.of(context).size.height - 50,
child: ListView.builder(
return Column(
children: [
ListView.builder(
itemCount: state.hasReachedMax
? state.programs.length
: state.programs.length + 1,
......@@ -199,13 +199,13 @@ class __ListProgramState extends State<_ListProgram> {
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return index >= state.programs.length
? const Center(
child: CustomCircularIndicator(),
)
? Container()
: ProgramCard(
program: state.programs[index],
);
}),
Container(height: 10)
],
);
}
}
......@@ -269,9 +269,9 @@ class __ListProgramSortStatusState extends State<_ListProgramSortStatus> {
),
);
} else {
return SizedBox(
height: MediaQuery.of(context).size.height - 50,
child: ListView.builder(
return Column(
children: [
ListView.builder(
itemCount: state.hasReachedMax
? state.programs.length
: state.programs.length + 1,
......@@ -281,13 +281,13 @@ class __ListProgramSortStatusState extends State<_ListProgramSortStatus> {
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return index >= state.programs.length
? const Center(
child: CustomCircularIndicator(),
)
? Container()
: ProgramCard(
program: state.programs[index],
);
}),
Container(height: 10)
],
);
}
}
......
......@@ -7,6 +7,7 @@ import 'package:home_industry/Pages/Register/bloc/bloc.dart';
import 'package:home_industry/Pages/Register/model/register_model.dart';
import 'package:home_industry/Pages/Register/repositories/register_repository.dart';
import 'package:home_industry/State/Auth/repositories/depedencies_repositories.dart';
import 'package:outline_material_icons/outline_material_icons.dart';
class Register extends StatelessWidget {
const Register({Key key}) : super(key: key);
......@@ -219,7 +220,7 @@ class _RegisterFormState extends State<RegisterForm> {
flex: 20,
child: CustomTextInputForm(
isNumberOnly: true,
prefixIcon: Icons.my_location,
prefixIcon: OMIcons.nearMe,
key: const Key('rt'),
label: 'RT',
onSave: _updateRt,
......@@ -233,7 +234,7 @@ class _RegisterFormState extends State<RegisterForm> {
flex: 20,
child: CustomTextInputForm(
isNumberOnly: true,
prefixIcon: Icons.my_location,
prefixIcon: OMIcons.nearMe,
key: const Key('rw'),
label: 'RW',
onSave: _updateRw,
......@@ -251,7 +252,7 @@ class _RegisterFormState extends State<RegisterForm> {
flex: 20,
child: CustomTextInputForm(
key: const Key('kelurahan'),
prefixIcon: Icons.location_searching,
prefixIcon: Icons.near_me,
label: 'Kelurahan',
onSave: _updateKelurahan,
maxLength: 100,
......@@ -265,7 +266,7 @@ class _RegisterFormState extends State<RegisterForm> {
child: CustomTextInputForm(
key: const Key('kecamatan'),
label: 'Kecamatan',
prefixIcon: Icons.location_searching,
prefixIcon: Icons.near_me,
onSave: _updateKecamatan,
maxLength: 100,
onSubmit: _handleSubmitted,
......
......@@ -260,8 +260,6 @@ class __BodyState extends State<_Body> {
);
} else if (state is FetchOrderSuccess && (state.transaction.transactionStatus ==
StatusTransaction.waitProof || state.transaction.transactionStatus ==
StatusTransaction.canceled ||
state.transaction.transactionStatus ==
StatusTransaction.waitSellerConfirmation)) {
return Provider<Transaction>.value(
value: state.transaction,
......@@ -271,6 +269,8 @@ class __BodyState extends State<_Body> {
.add(const RefreshOrderDetail());
return _refreshCompleter.future;
},
child: Padding(
padding: const EdgeInsets.only(bottom: 50),
child: ListView(
physics: const AlwaysScrollableScrollPhysics(
parent: BouncingScrollPhysics()),
......@@ -278,6 +278,13 @@ class __BodyState extends State<_Body> {
const EdgeInsets.symmetric(horizontal: 15, vertical: 20),
children: const <Widget>[
_Alamat(),
Padding(
padding: EdgeInsets.only(left: 10.0, top: 5.0),
child: Text('Barang akan dikirim setelah transaksi terkonfirmasi',
style: TextStyle(
fontSize: 12,
color: Color.fromRGBO(60, 141, 188, 1)),),
),
Divider(
height: 20,
thickness: 2,
......@@ -291,6 +298,42 @@ class __BodyState extends State<_Body> {
],
),
),
),
);
}
else if (state is FetchOrderSuccess && (state.transaction.transactionStatus ==
StatusTransaction.canceled) ) {
return Provider<Transaction>.value(
value: state.transaction,
child: RefreshIndicator(
onRefresh: () {
BlocProvider.of<DetailOrderBloc>(context)
.add(const RefreshOrderDetail());
return _refreshCompleter.future;
},
child: Padding(
padding: const EdgeInsets.only(bottom: 50),
child: ListView(
physics: const AlwaysScrollableScrollPhysics(
parent: BouncingScrollPhysics()),
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 20),
children: const <Widget>[
_Alamat(),
Divider(
height: 20,
thickness: 2,
),
_Summary(),
Divider(
height: 20,
thickness: 2,
),
_PaymentMethod(),
],
),
),
),
);
}
else if (state is FetchOrderSuccess && (
......@@ -308,6 +351,8 @@ class __BodyState extends State<_Body> {
.add(const RefreshOrderDetail());
return _refreshCompleter.future;
},
child: Padding(
padding: const EdgeInsets.only(bottom: 50),
child: ListView(
physics: const AlwaysScrollableScrollPhysics(
parent: BouncingScrollPhysics()),
......@@ -329,6 +374,7 @@ class __BodyState extends State<_Body> {
],
),
),
),
);
}
return const Center(
......@@ -461,7 +507,7 @@ class _Summary extends StatelessWidget {
);
},
icon: Icon(
Icons.description,
Icons.visibility,
color: Theme.of(context).primaryColor,
),
label: Text(
......
......@@ -208,7 +208,7 @@ void main() {
expect(find.text('GTXWP3PJ'), findsOneWidget);
expect(find.text('Rp155.040'), findsOneWidget);
expect(find.text('Unggah bukti pembayaran'), findsOneWidget);
await tester.tap(find.byIcon(Icons.description));
await tester.tap(find.byIcon(Icons.visibility));
await tester.pumpAndSettle();
expect(
find.byWidgetPredicate((Widget widget) =>
......
......@@ -128,7 +128,7 @@ void main() {
testWidgets('Donation page loads', (WidgetTester tester) async {
await tester.pumpWidget(widgetTested);
expect(find.byType(Form), findsOneWidget);
expect(find.text('Donasi'), findsNWidgets(2));
expect(find.text('Donasi'), findsOneWidget);
expect(find.text('Terima kasih! Silahkan transfer ke:'), findsOneWidget);
expect(find.byType(TextFormField), findsNWidgets(3));
expect(find.text('Belum memilih foto'), findsOneWidget);
......
......@@ -151,9 +151,9 @@ void main() {
await tester.pumpWidget(widgetTested);
expect(find.byType(CustomCircularIndicator), findsOneWidget);
await tester.pump(Duration(seconds: 3));
expect(find.byType(Card), findsNWidgets(3));
expect(find.text('Rumah Belajar'), findsNWidgets(3));
expect(find.text('DETAIL'), findsNWidgets(3));
expect(find.byType(Card), findsNWidgets(11));
expect(find.text('Rumah Belajar'), findsNWidgets(11));
expect(find.text('DETAIL'), findsNWidgets(11));
expect(find.text('Selesai'), findsNothing);
});
......
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