Verify storage controls and provide isolated browser fixture
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pipelines_app/features/settings/storage/storage_screen.dart';
|
||||
import 'storage_probe_fixture.dart';
|
||||
|
||||
void main() {
|
||||
final query = Uri.base.queryParameters;
|
||||
final cupertino = query['platform'] == 'cupertino';
|
||||
final dark = query['theme'] == 'dark';
|
||||
final scale = double.tryParse(query['scale'] ?? '') ?? 1;
|
||||
final screen = StorageScreen(
|
||||
gateway: StorageProbeGateway()..unsupported = query['unsupported'] == '1',
|
||||
);
|
||||
Widget scaled(BuildContext context, Widget? child) => MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(scale)),
|
||||
child: child!,
|
||||
);
|
||||
runApp(
|
||||
cupertino
|
||||
? CupertinoApp(
|
||||
theme: CupertinoThemeData(
|
||||
brightness: dark ? Brightness.dark : Brightness.light,
|
||||
),
|
||||
builder: scaled,
|
||||
home: screen,
|
||||
)
|
||||
: MaterialApp(
|
||||
theme: ThemeData(
|
||||
brightness: dark ? Brightness.dark : Brightness.light,
|
||||
),
|
||||
builder: scaled,
|
||||
home: screen,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user