Compare commits

...

2 Commits

Author SHA1 Message Date
AlexisDanlos
4a8478c20d fix: replace MaterialStateProperty with WidgetStateProperty in SearchBar
All checks were successful
/ mirror (push) Successful in 4s
2024-12-06 19:26:24 +01:00
AlexisDanlos
66b7435574 Added SafeArea class to avoid OS interface
All checks were successful
/ mirror (push) Successful in 4s
2024-12-06 18:03:49 +01:00
2 changed files with 5 additions and 5 deletions

View File

@ -83,7 +83,7 @@ class _MyHomePageState extends State<MyHomePage>
builder: (BuildContext context, SearchController controller) {
return SearchBar(
controller: controller,
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.only(
top: 6.0,
bottom: 6.0,
@ -95,10 +95,10 @@ class _MyHomePageState extends State<MyHomePage>
controller.openView();
_onSearchChanged('');
},
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStateProperty.all(
const Color.fromARGB(255, 30, 30, 30)),
hintText: 'Search contacts',
hintStyle: MaterialStateProperty.all(
hintStyle: WidgetStateProperty.all(
const TextStyle(color: Colors.grey, fontSize: 16.0),
),
leading: const Icon(
@ -106,7 +106,7 @@ class _MyHomePageState extends State<MyHomePage>
color: Colors.grey,
size: 24.0,
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),

View File

@ -16,7 +16,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
brightness: Brightness.dark
),
home: const MyHomePage(),
home: SafeArea(child: MyHomePage()),
)
);
}