Wrap PlatformProvider in MaterialApp and Scaffold

Some material elements, like AdaptiveSwitch, won't work in iOS without it.
This commit is contained in:
Ian VanSchooten 2024-09-03 11:01:43 -04:00
parent 7fa98cabda
commit 7d11658662
1 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:flutter/cupertino.dart' show CupertinoThemeData, DefaultCupertinoLocalizations;
import 'package:flutter/material.dart'
show BottomSheetThemeData, Colors, DefaultMaterialLocalizations, Theme, ThemeData, ThemeMode;
show BottomSheetThemeData, Colors, DefaultMaterialLocalizations, ThemeData, ThemeMode, MaterialApp, Scaffold;
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
@ -82,10 +82,10 @@ class _AppState extends State<App> {
),
);
// This theme is required since icons light/dark mode will look for it
return Theme(
data: brightness == Brightness.light ? lightTheme : darkTheme,
child: PlatformProvider(
return MaterialApp(
theme: brightness == Brightness.light ? lightTheme : darkTheme,
home: Scaffold(
body: PlatformProvider(
//initialPlatform: initialPlatform,
builder: (context) => PlatformApp(
debugShowCheckedModeBanner: false,
@ -122,6 +122,7 @@ class _AppState extends State<App> {
},
),
),
),
);
}
}