12 lines
355 B
Dart
12 lines
355 B
Dart
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);
|