Closed Salam-pc closed 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') ], ), ), ); } }
You can use SizedBox and SingleChildScrollView with NeverScrollableScrollPhysics as explained here.
SizedBox
SingleChildScrollView
NeverScrollableScrollPhysics
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') ], ), ), ); } }