prasule/lib/pw/platformroute.dart

17 lines
452 B
Dart
Raw Permalink Normal View History

2024-06-30 20:25:36 +02:00
// SPDX-FileCopyrightText: (C) 2024 Matyáš Caras
//
// SPDX-License-Identifier: AGPL-3.0-only
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// Creates a PageRoute based on [Platform]
Route<T> platformRoute<T extends Object?>(
Widget Function(BuildContext) builder,
) =>
(Platform.isIOS)
? CupertinoPageRoute<T>(builder: builder)
: MaterialPageRoute<T>(builder: builder);