Widget doesn't work properly in the release version of Flutter,
In the debug mode: the widget works properly as I desired.
In release mode: the widget of the card is a bit messy when launching the app for the first time, it only works when I navigate other tab and I get back to that tab.
Command used : flutter build apk
Code provided below:
import 'package:course_app/constants.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
class CategoryCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Container(
height: size.height * 0.18,
width: size.width * 0.3,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
offset: const Offset(1, 1),
blurRadius: 5,
color: Colors.grey.withOpacity(0.3)),
]),
child: Column(children: [
SizedBox(
height: size.height * 16 / 780,
),
CircularPercentIndicator(
radius: size.height * 30/780,
lineWidth: 5.0,
percent: 0.5,
center: Text("100%", style: TextStyle(fontSize: size.height * 14/780),),
animation: true,
progressColor: kPrimaryColor,
),
SizedBox(
height: size.height * 14 / 780,
),
Text(
"Makanan",
style: TextStyle(fontSize: size.height * 16 / 780),
),
SizedBox(
height: size.height * 4 / 780,
),
Text(
"Rp. 30.000",
style: TextStyle(fontSize: size.height * 14 / 780, color: Colors.black.withOpacity(0.6)),
),
]),
);
}
}
Release version:
Debug version: