diegoveloper / flutter_percent_indicator

Flutter percent indicator library
BSD 2-Clause "Simplified" License
677 stars 206 forks source link

arcType: ArcType.HALF, it occupying size for full circle #165

Closed Salam-pc closed 2 years ago

Salam-pc commented 2 years ago

Even though I'm using arcType: ArcType.HALF, it still uses a circle Size, so it shows a vacuum space between this and the next widget

// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart'; import 'package:percent_indicator/percent_indicator.dart';

void main() { runApp(MyApp()); }

class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold(body: MyHomePage()), ); } }

class MyHomePage extends StatelessWidget { @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( body: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ CircularPercentIndicator( radius: 120.0, animation: true, animationDuration: 2000, lineWidth: 10.0, percent: .56, reverse: false, arcBackgroundColor: Colors.grey[700], arcType: ArcType.HALF, center: const Text("20 hours"), circularStrokeCap: CircularStrokeCap.round, backgroundColor: Colors.transparent, progressColor: Colors.green, ), Text('data') ], ), ), ); } }

arzakmiftakhul commented 2 years ago

You can use SizedBox and SingleChildScrollView with NeverScrollableScrollPhysics as explained here.