Question: I have this subroutine to turn on/off some of `Application`'s properties.

```
Public Sub OPTIMIZE_VBA(ByVal isOn As Boolean)
Dim bHolder As Boolean
bHolder = Not isOn
On Error Resume Next
With Application
  .DisplayAlerts = bHolder
  .ScreenUpdating = bHolder
  .EnableEvents = bHolder
  .Calculation = IIf(isOn, xlCalculationManual, xlCalculationAutomatic)
  .Calculate
    If .VERSION > 12 Then .PrintCommunication = bHolder
End With
On Error GoTo 0
End Sub

```

Say that there is a different instance of application that I wish to turn on/off the same properties,how would I be able to modify this code to accept an argument/parameter as a different application?
I'm expecting something like;

```
Public Sub OPTIMIZE_VBA(ByVal isOn As Boolean, Optional ByVal ExApp As Excel.Application = thisApplication)
' rest of the code
End Sub

```

With this I can call it like;

```
Sub Create_New_Excel_and_Disable_Properties()
'<~ Declare and prepare the new application
  Dim NewExcel As Excel.Application
  Set NewExcel = New Excel.Application

'<~ declare and set the workbook variable
Dim ExcelWbk As Excel.Workbook
Set ExcelWbk = NewExcel.Workbooks.Open("folder\template.xlsx")

'<~ call the sub that disables the Application.properties
OPTIMIZE_VBA False, NewExcel
End Sub

```

Answer: 
It sounds like you are trying to show an animated text widget that changes over time. I would use an [`AnimatedWidget`](https://docs.flutter.io/flutter/widgets/AnimatedWidget-class.html) with a [`StepTween`](https://docs.flutter.io/flutter/animation/StepTween-class.html) to ensure that the countdown only shows integer values.

[![countdown](https://i.stack.imgur.com/PB213.png)](https://i.stack.imgur.com/PB213.png)

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

void main() {
  runApp(new MaterialApp(
    home: new MyApp(),
  ));
}

class Countdown extends AnimatedWidget {
  Countdown({ Key key, this.animation }) : super(key: key, listenable: animation);
  Animation<int> animation;

  @override
  build(BuildContext context){
    return new Text(
      animation.value.toString(),
      style: new TextStyle(fontSize: 150.0),
    );
  }
}

class MyApp extends StatefulWidget {
  State createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
  AnimationController _controller;

  static const int kStartValue = 4;

  @override
  void initState() {
    super.initState();
    _controller = new AnimationController(
      vsync: this,
      duration: new Duration(seconds: kStartValue),
    );
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      floatingActionButton: new FloatingActionButton(
        child: new Icon(Icons.play_arrow),
        onPressed: () => _controller.forward(from: 0.0),
      ),
      body: new Container(
        child: new Center(
          child: new Countdown(
            animation: new StepTween(
              begin: kStartValue,
              end: 0,
            ).animate(_controller),
          ),
        ),
      ),
    );
  }
}

```
based on @raju-bitter answer, alternative to use async/await on countdown stream

```
  void countdown() async {
    cd = new CountDown(new Duration(seconds:4));
    await for (var v in cd.stream) {
      setState(() => val = v.inSeconds);
    }
  }

```