I'm new to Flutter but when I run the example with await TimeMachine.initialize({'rootBundle': rootBundle}), it fails with the message "the await expression can only be used in an async function." However, when I take out the await, the error goes away. Is the doc not up to date or am I doing something wrong with the setup??
#pubspec.yaml
dependencies:
time_machine:
git:
url: https://github.com/Dana-Ferguson/time_machine
ref: master
# The following section is specific to Flutter.
flutter:
assets:
- packages/time_machine/data/cultures/cultures.bin
- packages/time_machine/data/tzdb/tzdb.bi
#main.dart
import 'package:flutter/services.dart';
import 'package:time_machine/time_machine.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
await TimeMachine.initialize({'rootBundle': rootBundle});
runApp(MyApp());
}
I'm new to Flutter but when I run the example with
await TimeMachine.initialize({'rootBundle': rootBundle}), it fails with the message "the await expression can only be used in an async function." However, when I take out theawait, the error goes away. Is the doc not up to date or am I doing something wrong with the setup??#pubspec.yaml
#main.dart