1
+ import 'dart:ui' ;
2
+
1
3
import 'package:banking_app/configs/colours.dart' ;
4
+ import 'package:banking_app/widgets/clipper.dart' ;
5
+ import 'package:floating_bottom_navigation_bar/floating_bottom_navigation_bar.dart' ;
2
6
import 'package:flutter/material.dart' ;
3
7
import 'package:provider/provider.dart' ;
4
8
@@ -24,21 +28,61 @@ class _HomePageState extends State<HomePage> {
24
28
@override
25
29
Widget build (BuildContext context) {
26
30
return Scaffold (
27
- backgroundColor: lighten (Theme .of (context).primaryColorLight),
28
- appBar: AppBar (
29
- title: Text (
30
- "Banking" ,
31
- style: TextStyle (
32
- color: Theme .of (context).primaryColorDark,
31
+ backgroundColor:
32
+ MediaQuery .of (context).platformBrightness == Brightness .dark
33
+ ? lighten (Theme .of (context).primaryColorLight, factor: 0.15 )
34
+ : darken (Theme .of (context).primaryColorLight, factor: 0.05 ),
35
+ // appBar: AppBar(
36
+ // title: Text(
37
+ // "Banking",
38
+ // style: TextStyle(
39
+ // color: Theme.of(context).primaryColorDark,
40
+ // ),
41
+ // ),
42
+ // shadowColor: Colors.black.withOpacity(0.2),
43
+ // centerTitle: true,
44
+ // backgroundColor:
45
+ // lighten(Theme.of(context).primaryColorLight, factor: 0.1),
46
+ // ),
47
+ body: Stack (
48
+ children: [
49
+ Container (
50
+ transform: Matrix4 .translationValues (0.0 , - 65.0 , 0.0 ),
51
+ child: ClipPath (
52
+ clipper: BgClipper $(),
53
+ child: Container (
54
+ color: Colors .black.withOpacity (0.125 ),
55
+ ),
56
+ ),
33
57
),
34
- ),
35
- shadowColor: Colors .black.withOpacity (0.2 ),
36
- centerTitle: true ,
37
- backgroundColor:
38
- lighten (Theme .of (context).primaryColorLight, factor: 0.1 ),
39
- ),
40
- body: _bnbSelected == 0
41
- ? MultiProvider (
58
+ BackdropFilter (
59
+ filter: ImageFilter .blur (sigmaX: 7 , sigmaY: 7 ),
60
+ child: Container (
61
+ transform: Matrix4 .translationValues (0.0 , - 65.0 , 0.0 ),
62
+ // color: Colors.white.withOpacity(0.25),
63
+ ),
64
+ ),
65
+ Container (
66
+ transform: Matrix4 .translationValues (0.0 , - 65.0 , 0.0 ),
67
+ child: ClipPath (
68
+ clipper: BgClipper $(),
69
+ child: Container (
70
+ color: lighten (Theme .of (context).primaryColorLight),
71
+ ),
72
+ ),
73
+ ),
74
+ Center (
75
+ child: Icon (
76
+ Icons .monetization_on,
77
+ size: 125 ,
78
+ color: MediaQuery .of (context).platformBrightness ==
79
+ Brightness .light
80
+ ? darken (Theme .of (context).primaryColorLight, factor: 0.15 )
81
+ : lighten (Theme .of (context).primaryColorLight),
82
+ ),
83
+ ),
84
+ if (_bnbSelected == 0 ) ...[
85
+ MultiProvider (
42
86
providers: [
43
87
ChangeNotifierProvider .value (
44
88
value: widget.transfers,
@@ -47,36 +91,43 @@ class _HomePageState extends State<HomePage> {
47
91
child: HomePageHome (
48
92
users: widget.users,
49
93
),
94
+ ),
95
+ ] else if (_bnbSelected == 1 ) ...[
96
+ MultiProvider (
97
+ providers: [
98
+ ChangeNotifierProvider .value (
99
+ value: widget.users,
100
+ ),
101
+ ChangeNotifierProvider .value (
102
+ value: widget.transfers,
103
+ ),
104
+ ],
105
+ child: const HomePageViewUsers (),
50
106
)
51
- : _bnbSelected == 1
52
- ? MultiProvider (
53
- providers: [
54
- ChangeNotifierProvider .value (
55
- value: widget.users,
56
- ),
57
- ChangeNotifierProvider .value (
58
- value: widget.transfers,
59
- ),
60
- ],
61
- child: const HomePageViewUsers (),
62
- )
63
- : Container (),
64
- bottomNavigationBar: BottomNavigationBar (
107
+ ],
108
+ ],
109
+ ),
110
+ extendBody: true ,
111
+ bottomNavigationBar: FloatingNavbar (
112
+ elevation: 30 ,
113
+ borderRadius: 20 ,
114
+ selectedBackgroundColor:
115
+ lighten (Theme .of (context).primaryColorLight, factor: 0.4 ),
65
116
backgroundColor:
66
- lighten (Theme .of (context).primaryColorLight, factor: 0.1 ),
117
+ lighten (Theme .of (context).primaryColorLight, factor: 0.3 ),
67
118
selectedItemColor: Theme .of (context).primaryColorDark,
68
119
unselectedItemColor:
69
120
Theme .of (context).primaryColorDark.withOpacity (0.5 ),
70
121
currentIndex: _bnbSelected,
71
122
onTap: (value) => setState (() => _bnbSelected = value),
72
- items: const [
73
- BottomNavigationBarItem (
74
- icon: Icon ( Icons .home) ,
75
- label : "Home" ,
123
+ items: [
124
+ FloatingNavbarItem (
125
+ icon: Icons .home,
126
+ title : "Home" ,
76
127
),
77
- BottomNavigationBarItem (
78
- icon: Icon ( Icons .list) ,
79
- label : "View Users" ,
128
+ FloatingNavbarItem (
129
+ icon: Icons .list,
130
+ title : "View Users" ,
80
131
),
81
132
],
82
133
),
0 commit comments