Skip to content

Commit c6ef89f

Browse files
committed
Initial commit
0 parents  commit c6ef89f

16 files changed

+257
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See https://www.dartlang.org/guides/libraries/private-files
2+
3+
# Files and directories created by pub
4+
.dart_tool/
5+
.packages
6+
build/
7+
# If you're building an application, you may want to check-in your pubspec.lock
8+
pubspec.lock
9+
10+
# Directory created by dartdoc
11+
# If you don't generate documentation locally you can remove this line.
12+
doc/api/
13+
14+
# dotenv environment variables file
15+
.env*
16+
17+
# Avoid committing generated Javascript files:
18+
*.dart.js
19+
*.info.json # Produced by the --dump-info flag.
20+
*.js # When generated by dart2js. Don't specify *.js if your
21+
# project includes source files written in JavaScript.
22+
*.js_
23+
*.js.deps
24+
*.js.map
25+
26+
.flutter-plugins
27+
.flutter-plugins-dependencies

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.1.0+1
2+
3+
- TODO: Describe initial release.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Prashant Nigam
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# easy_app_navbar
2+
3+
A new brick created with the Mason CLI.
4+
5+
_Generated by [mason][1] 🧱_
6+
7+
## Getting Started 🚀
8+
9+
This is a starting point for a new brick.
10+
A few resources to get you started if this is your first brick template:
11+
12+
- [Official Mason Documentation][2]
13+
- [Code generation with Mason Blog][3]
14+
- [Very Good Livestream: Felix Angelov Demos Mason][4]
15+
16+
[1]: https://github.com/felangel/mason
17+
[2]: https://github.com/felangel/mason/tree/master/packages/mason_cli#readme
18+
[3]: https://verygood.ventures/blog/code-generation-with-mason
19+
[4]: https://youtu.be/G4PTjA6tpTU
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import 'package:flutter/material.dart';
2+
3+
// ignore: unused_import
4+
import '../../{{first_screen.snakeCase()}}/{{first_screen.snakeCase()}}.dart';
5+
// ignore: unused_import
6+
import '../../{{second_screen.snakeCase()}}/{{second_screen.snakeCase()}}.dart';
7+
// ignore: unused_import
8+
import '../../{{third_screen.snakeCase()}}/{{third_screen.snakeCase()}}.dart';
9+
// ignore: unused_import
10+
import '../../{{forth_screen.snakeCase()}}/{{forth_screen.snakeCase()}}.dart';
11+
12+
class {{dashboard.pascalCase()}}Page extends StatefulWidget {
13+
const {{dashboard.pascalCase()}}Page({Key? key}) : super(key: key);
14+
15+
@override
16+
State<{{dashboard.pascalCase()}}Page> createState() => _{{dashboard.pascalCase()}}PageState();
17+
}
18+
19+
class _{{dashboard.pascalCase()}}PageState extends State<{{dashboard.pascalCase()}}Page> {
20+
int _currentIndex = 0;
21+
final List<Widget> _pages = [
22+
const {{first_screen.pascalCase()}}Page(),
23+
const {{third_screen.pascalCase()}}Page(),
24+
const {{second_screen.pascalCase()}}Page(),
25+
const {{forth_screen.pascalCase()}}Page()
26+
];
27+
28+
@override
29+
Widget build(BuildContext context) {
30+
return Scaffold(
31+
appBar: AppBar(
32+
title: const Text('{{dashboard.pascalCase()}} Page'),
33+
),
34+
body: _pages[_currentIndex],
35+
bottomNavigationBar: NavigationBar(
36+
selectedIndex: _currentIndex,
37+
onDestinationSelected: (int newIndex) {
38+
setState(() => _currentIndex = newIndex);
39+
},
40+
destinations: const [
41+
NavigationDestination(
42+
icon: Icon(Icons.{{first_screen.snakeCase()}}_outlined),
43+
selectedIcon: Icon(Icons.{{first_screen.snakeCase()}}),
44+
label: '{{first_screen.pascalCase()}}',
45+
),
46+
NavigationDestination(
47+
icon: Icon(Icons.{{second_screen.snakeCase()}}_outlined),
48+
selectedIcon: Icon(Icons.{{second_screen.snakeCase()}}),
49+
label: '{{second_screen.pascalCase()}}',
50+
),
51+
NavigationDestination(
52+
icon: Icon(Icons.{{third_screen.snakeCase()}}_outline),
53+
selectedIcon: Icon(Icons.{{third_screen.snakeCase()}}),
54+
label: '{{third_screen.pascalCase()}}',
55+
),
56+
NavigationDestination(
57+
icon: Icon(Icons.{{forth_screen.snakeCase()}}_outline),
58+
selectedIcon: Icon(Icons.{{forth_screen.snakeCase()}}),
59+
label: '{{forth_screen.pascalCase()}}',
60+
),
61+
],
62+
),
63+
);
64+
}
65+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export 'view/{{dashboard.snakeCase()}}_page.dart';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import 'package:flutter/material.dart';
2+
3+
class {{first_screen.pascalCase()}}Page extends StatelessWidget {
4+
const {{first_screen.pascalCase()}}Page({Key? key}) : super(key: key);
5+
6+
static const String routeName = '/{{first_screen.camelCase()}}';
7+
static const String name = '{{first_screen.pascalCase()}}';
8+
9+
@override
10+
Widget build(BuildContext context) {
11+
return const Center(
12+
child: Text('{{first_screen.pascalCase()}} Page'),
13+
);
14+
}
15+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export 'utils/utils.dart';
2+
export 'view/{{first_screen.snakeCase()}}_page.dart';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import 'package:flutter/material.dart';
2+
3+
class {{forth_screen.pascalCase()}}Page extends StatelessWidget {
4+
const {{forth_screen.pascalCase()}}Page({Key? key}) : super(key: key);
5+
6+
static const String routeName = '/{{forth_screen.camelCase()}}';
7+
static const String name = '{{forth_screen.pascalCase()}}';
8+
9+
@override
10+
Widget build(BuildContext context) {
11+
return const Center(
12+
child: Text('{{forth_screen.pascalCase()}} Page'),
13+
);
14+
}
15+
}

0 commit comments

Comments
 (0)