refactor(ui): Remove SafeArea where they are not needed

pull/193/head
Inex Code 2023-02-01 01:40:42 +03:00
parent 80547785d3
commit c271331f29
2 changed files with 47 additions and 53 deletions

View File

@ -21,17 +21,15 @@ class _OnboardingPageState extends State<OnboardingPage> {
} }
@override @override
Widget build(final BuildContext context) => SafeArea( Widget build(final BuildContext context) => Scaffold(
child: Scaffold( body: PageView(
body: PageView( controller: pageController,
controller: pageController, children: [
children: [ _withPadding(firstPage()),
_withPadding(firstPage()), _withPadding(secondPage()),
_withPadding(secondPage()), ],
], ),
), );
),
);
Widget _withPadding(final Widget child) => Padding( Widget _withPadding(final Widget child) => Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
@ -60,15 +58,13 @@ class _OnboardingPageState extends State<OnboardingPage> {
style: Theme.of(context).textTheme.bodyMedium, style: Theme.of(context).textTheme.bodyMedium,
), ),
const SizedBox(height: 32), const SizedBox(height: 32),
Flexible( Center(
child: Center( child: Image.asset(
child: Image.asset( _fileName(
_fileName( context: context,
context: context, path: 'assets/images/onboarding',
path: 'assets/images/onboarding', fileExtention: 'png',
fileExtention: 'png', fileName: 'onboarding1',
fileName: 'onboarding1',
),
), ),
), ),
), ),

View File

@ -52,40 +52,38 @@ class _RootPageState extends State<RootPage> with TickerProviderStateMixin {
final bool isReady = context.watch<ServerInstallationCubit>().state final bool isReady = context.watch<ServerInstallationCubit>().state
is ServerInstallationFinished; is ServerInstallationFinished;
return SafeArea( return Provider<ChangeTab>(
child: Provider<ChangeTab>( create: (final _) => ChangeTab(tabController.animateTo),
create: (final _) => ChangeTab(tabController.animateTo), child: Scaffold(
child: Scaffold( body: TabBarView(
body: TabBarView( controller: tabController,
controller: tabController, children: const [
children: const [ ProvidersPage(),
ProvidersPage(), ServicesPage(),
ServicesPage(), UsersPage(),
UsersPage(), MorePage(),
MorePage(), ],
],
),
bottomNavigationBar: BrandTabBar(
controller: tabController,
),
floatingActionButton: isReady
? SizedBox(
height: 104 + 16,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ScaleTransition(
scale: _animation,
child: const AddUserFab(),
),
const SizedBox(height: 16),
const BrandFab(),
],
),
)
: null,
), ),
bottomNavigationBar: BrandTabBar(
controller: tabController,
),
floatingActionButton: isReady
? SizedBox(
height: 104 + 16,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ScaleTransition(
scale: _animation,
child: const AddUserFab(),
),
const SizedBox(height: 16),
const BrandFab(),
],
),
)
: null,
), ),
); );
} }