title: The argument type 'int' can't be assigned to the parameter type 'double'
body: <p>can anyone help me I am trying to make a circular percent indicator for battery percentage but I am getting this error, this for my college project work, and writing this post for the first time I have never done this before and I am also new at coding.</p>
  <p><strong>lib/pages/device_dashboard.dart:139:36: Error: The argument type 'int' can't be assigned to the parameter type 'double'.
  percent: _batteryLevel,
  ^</strong></p>
  <p>here is my code</p>
  <pre><code>import 'dart:async';
  import 'package:flutter/cupertino.dart';
  import 'package:percent_indicator/percent_indicator.dart';
  import 'package:battery/battery.dart';
  import 'package:flutter/material.dart';
  
  class DeviceDashboard extends StatefulWidget {
    @override
    _DeviceDashboardState createState() =&gt; _DeviceDashboardState();
  }
  
  class _DeviceDashboardState extends State&lt;DeviceDashboard&gt; {
    Battery _battery = Battery();
    BatteryState _batteryState;
  
    int _batteryLevel;
  
    StreamSubscription&lt;BatteryState&gt; _batteryStateSubscription;
   
  
    @override
    void initState() {
      super.initState();
      _batteryStateSubscription =
          _battery.onBatteryStateChanged.listen((BatteryState state) {
        setState(() {
          _batteryState = state;
        });
      });
    }
  
    Future&lt;void&gt; _getLevel() async {
      final batteryLevel = await _battery.batteryLevel;
      setState(() {
        _batteryLevel = batteryLevel;
      });
    }
  
    @override
    void dispose() {
      // TODO: implement dispose
      super.dispose();
      if (_batteryStateSubscription != null) {
        _batteryStateSubscription.cancel();
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text('Device Dashboard'),
          ),
        body: SingleChildScrollView(
          child: Column(
            children: &lt;Widget&gt;[
              SizedBox(
                height: 50,
              ),
              Text(
                '$_batteryState',
                style: TextStyle(
                  fontSize: 18,
                  fontWeight: FontWeight.bold,
                  color: Colors.grey[400],
                ),
              ),
  
              Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  CircularPercentIndicator(
                    radius: 100.0,
                    lineWidth: 7.0,
                    center: MaterialButton(
                      onPressed: _getLevel,
                      textColor: Colors.white,
                      child: Text(
                        '$_batteryLevel %',
                        style: TextStyle(
                            color: Colors.white,
                            fontWeight: FontWeight.bold,
                            fontSize: 20),
                      ),
                      padding: EdgeInsets.all(20),
                      shape: CircleBorder(),
                    ),
                    progressColor: Colors.green,
                    percent: 0.5, // after putting _batteryLevel here i m getting that error 
                  ),
                  Text(
                    'Battery',
                    style: TextStyle(
                      fontSize: 20,
                      fontWeight: FontWeight.bold,
                      color: Colors.white,
                    ),
                  ),
                ],
              ),
            ],
          ),
        ),
      );
    }
  }
  
  </code></pre>