performance_indicator 0.0.1
performance_indicator: ^0.0.1 copied to clipboard
checks internet speed and gives opportunity to change quality of downloaded content
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:performance_indicator/performance_indicator.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
/// Performance indicator has also further functions.
///
/// You can start current speed check anytime.
/// This will influence the color of performance indicator pulsing button.
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
await PerformanceIndicator.checkCurrentSpeed(
badResponseTime: 500,
url: 'https://google.com',
);
});
final theme = ThemeData(
brightness: Brightness.dark,
);
return MaterialApp(
title: 'Example for performance indicator',
home: Center(
///Performance indicator can be used placed everywhere
///as e.g. an already defined with quality dialog options.
child: PerformanceIndicator.quality(
width: 100.0,
checkUri: Uri(host: 'google.com', scheme: 'https'),
badResponseTimeInMs: 150,
),
),
themeMode: ThemeMode.dark,
theme: theme,
color: Colors.black,
);
}
}