diff --git a/assets/fonts/BowlInFont.ttf b/assets/fonts/BowlInFont.ttf new file mode 100644 index 0000000..ab67db7 Binary files /dev/null and b/assets/fonts/BowlInFont.ttf differ diff --git a/assets/images/card_game.png b/assets/images/card_game.png new file mode 100644 index 0000000..a49150a Binary files /dev/null and b/assets/images/card_game.png differ diff --git a/assets/images/image_score.png b/assets/images/image_score.png new file mode 100644 index 0000000..0ccca09 Binary files /dev/null and b/assets/images/image_score.png differ diff --git a/lib/main.dart b/lib/main.dart index aa29029..29462a2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,7 @@ +import 'package:bowl_in/views/main_screen.dart'; import 'package:bowl_in/views/welcome_screen.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; void main() { runApp(const MyApp()); @@ -11,9 +13,11 @@ class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { + SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive); + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle(statusBarColor: Colors.transparent)); return MaterialApp( debugShowCheckedModeBanner: false, - title: 'Flutter Demo', theme: ThemeData( // This is the theme of your application. @@ -27,7 +31,7 @@ class MyApp extends StatelessWidget { // is not restarted. primarySwatch: Colors.blue, ), - home: const WelcomeScreen(), + home: const MainScreen(), ); } } diff --git a/lib/presentation/font.dart b/lib/presentation/font.dart new file mode 100644 index 0000000..8985c5d --- /dev/null +++ b/lib/presentation/font.dart @@ -0,0 +1,17 @@ +import 'package:flutter/widgets.dart'; + +class BowlInFont { + BowlInFont._(); + + static const _kFontFam = 'BowlInFont'; + static const String? _kFontPkg = null; + + static const IconData stats_icon = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData profil_icon = + IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = + IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData rank_icon = + IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); +} diff --git a/lib/views/main_screen.dart b/lib/views/main_screen.dart new file mode 100644 index 0000000..30acd20 --- /dev/null +++ b/lib/views/main_screen.dart @@ -0,0 +1,149 @@ +import 'package:bowl_in/presentation/font.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../widgets/scores_list_widget.dart'; + +class MainScreen extends StatefulWidget { + const MainScreen({Key? key}) : super(key: key); + + @override + State createState() => _MainScreenState(); +} + +class _MainScreenState extends State { + int _index = 0; + int get index => _index; + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xff19BDE0), + Color(0xff4A17DC), + ], + )), + ), + Align( + alignment: AlignmentDirectional.topCenter, + child: Container( + height: 120, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/image_score.png"), + )), + child: Center( + child: Text( + "Scores", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 20), + )), + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Positioned( + bottom: 0, + child: Container( + height: MediaQuery.of(context).size.height - 200, + width: MediaQuery.of(context).size.width, + child: ListCardGame(), + )), + ) + ], + ), + bottomNavigationBar: SizedBox( + height: 75, + child: NavigationBarTheme( + data: NavigationBarThemeData( + indicatorColor: Colors.transparent, + ), + child: ConstrainedBox( + constraints: const BoxConstraints( + minHeight: 200, + maxHeight: 200, + ), + child: Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.8), + blurRadius: 500, + ), + ], + ), + child: NavigationBar( + animationDuration: const Duration(microseconds: 800), + selectedIndex: index, + labelBehavior: + NavigationDestinationLabelBehavior.alwaysHide, + height: MediaQuery.of(context).size.height * 0.1, + onDestinationSelected: (index) => + setState(() => _index = index), + backgroundColor: Colors.white, + destinations: const [ + NavigationDestination( + icon: Icon( + BowlInFont.home_icon, + color: Colors.grey, + size: 21, + ), + label: 'Profil', + selectedIcon: Icon( + BowlInFont.home_icon, + size: 21, + ), + ), + NavigationDestination( + icon: Icon( + Icons.show_chart, + color: Colors.grey, + size: 21, + ), + label: '', + selectedIcon: Icon( + Icons.show_chart, + size: 21, + ), + ), + NavigationDestination( + icon: Icon( + BowlInFont.rank_icon, + color: Colors.grey, + size: 21, + ), + label: '', + selectedIcon: Icon( + BowlInFont.rank_icon, + size: 21, + ), + ), + NavigationDestination( + icon: Icon( + BowlInFont.profil_icon, + color: Colors.grey, + size: 21, + ), + label: '', + selectedIcon: Icon( + BowlInFont.profil_icon, + size: 21, + ), + ), + ], + ), + ), + ), + ))); + } +} diff --git a/lib/widgets/scores_list_widget.dart b/lib/widgets/scores_list_widget.dart new file mode 100644 index 0000000..f6ea67c --- /dev/null +++ b/lib/widgets/scores_list_widget.dart @@ -0,0 +1,52 @@ +import 'package:flutter/cupertino.dart'; + +class CardGame extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.fromLTRB(0, 0, 0, 10), + child: Container( + width: MediaQuery.of(context).size.width, + height: 100, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/card_game.png"), + ), + )), + ); + } +} + +class CustomScroll extends ScrollBehavior { + @override + Widget buildViewportChrome( + BuildContext context, Widget child, AxisDirection axisDirection) { + return child; + } +} + +class ListCardGame extends StatelessWidget { + @override + Widget build(BuildContext context) { + return ScrollConfiguration( + behavior: CustomScroll(), + child: Expanded( + child: ListView( + shrinkWrap: true, + children: [ + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + CardGame(), + ], + ))); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index cdfb2df..852db74 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,6 +62,7 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/images/ + - assets/fonts/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware @@ -74,17 +75,9 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # + fonts: + - family: BowlInFont + fonts: + - asset: assets/fonts/BowlInFont.ttf # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages