Wrap PlatformProvider in MaterialApp and Scaffold
Some material elements, like AdaptiveSwitch, won't work in iOS without it.
This commit is contained in:
parent
7fa98cabda
commit
7d11658662
|
@ -2,7 +2,7 @@ import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart' show CupertinoThemeData, DefaultCupertinoLocalizations;
|
import 'package:flutter/cupertino.dart' show CupertinoThemeData, DefaultCupertinoLocalizations;
|
||||||
import 'package:flutter/material.dart'
|
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/scheduler.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.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 MaterialApp(
|
||||||
return Theme(
|
theme: brightness == Brightness.light ? lightTheme : darkTheme,
|
||||||
data: brightness == Brightness.light ? lightTheme : darkTheme,
|
home: Scaffold(
|
||||||
child: PlatformProvider(
|
body: PlatformProvider(
|
||||||
//initialPlatform: initialPlatform,
|
//initialPlatform: initialPlatform,
|
||||||
builder: (context) => PlatformApp(
|
builder: (context) => PlatformApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
|
@ -122,6 +122,7 @@ class _AppState extends State<App> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue