Skip to content

Commit c056b75

Browse files
lisa-liaoRedBrogdon
lisa-liao
authored andcommitted
Adding Rally App to Flutter Samples (#135)
1 parent 3348c2f commit c056b75

31 files changed

+2348
-0
lines changed

LICENSE

+299
Large diffs are not rendered by default.

material_studies/rally/.gitignore

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# Visual Studio Code related
19+
.vscode/
20+
21+
# Flutter/Dart/Pub related
22+
**/doc/api/
23+
.dart_tool/
24+
.flutter-plugins
25+
.packages
26+
.pub-cache/
27+
.pub/
28+
/build/
29+
30+
# Android related
31+
**/android/**/gradle-wrapper.jar
32+
**/android/.gradle
33+
**/android/captures/
34+
**/android/gradlew
35+
**/android/gradlew.bat
36+
**/android/local.properties
37+
**/android/**/GeneratedPluginRegistrant.java
38+
39+
# iOS/XCode related
40+
**/ios/**/*.mode1v3
41+
**/ios/**/*.mode2v3
42+
**/ios/**/*.moved-aside
43+
**/ios/**/*.pbxuser
44+
**/ios/**/*.perspectivev3
45+
**/ios/**/*sync/
46+
**/ios/**/.sconsign.dblite
47+
**/ios/**/.tags*
48+
**/ios/**/.vagrant/
49+
**/ios/**/DerivedData/
50+
**/ios/**/Icon?
51+
**/ios/**/Pods/
52+
**/ios/**/.symlinks/
53+
**/ios/**/profile
54+
**/ios/**/xcuserdata
55+
**/ios/.generated/
56+
**/ios/Flutter/App.framework
57+
**/ios/Flutter/Flutter.framework
58+
**/ios/Flutter/Generated.xcconfig
59+
**/ios/Flutter/app.flx
60+
**/ios/Flutter/app.zip
61+
**/ios/Flutter/flutter_assets/
62+
**/ios/ServiceDefinitions.json
63+
**/ios/Runner/GeneratedPluginRegistrant.*
64+
65+
# Exceptions to above rules.
66+
!**/ios/**/default.mode1v3
67+
!**/ios/**/default.mode2v3
68+
!**/ios/**/default.pbxuser
69+
!**/ios/**/default.perspectivev3
70+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

material_studies/rally/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Rally
2+
3+
A Flutter sample app based on the Material study Rally (a hypothetical, personal finance app). It
4+
showcases custom tabs, custom painted widgets, and custom animations.
5+
6+
For info on the Rally Material Study, see: https://material.io/design/material-studies/rally.html
7+
8+
## Goals
9+
10+
* Show how to customize a tab bar.
11+
* Show how to create reusable custom widgets with composition and custom painting.
12+
* Show how to create an app with tabs and child navigation screens.
13+
14+
## The important bits
15+
16+
### `/charts/*`
17+
18+
These are the custom charts. The circle chart and line chart are custom painters,
19+
while the single vertical bar chart is a simple composition of boxes.
20+
21+
### `/sections/*`
22+
23+
These are the main sections for the tab views and the child screen with the details and line chart.
24+
The financial entity is a reusable screen that is the base for the accounts, bills, and budgets
25+
screens.
26+
27+
## Questions/issues
28+
29+
If you have a general question about any of the techniques you see in
30+
the sample, the best places to go are:
31+
32+
* [The FlutterDev Google Group](https://groups.google.com/forum/#!forum/flutter-dev)
33+
* [The Flutter Gitter channel](https://gitter.im/flutter/flutter)
34+
* [StackOverflow](https://stackoverflow.com/questions/tagged/flutter)
35+
36+
If you run into an issue with the sample itself, please file an issue
37+
in the [main Flutter repo](https://github.com/flutter/flutter/issues).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include: package:pedantic/analysis_options.1.7.0.yaml
2+
3+
analyzer:
4+
strong-mode:
5+
implicit-casts: false
6+
implicit-dynamic: false
7+
8+
linter:
9+
rules:
10+
- avoid_types_on_closure_parameters
11+
- avoid_void_async
12+
- await_only_futures
13+
- camel_case_types
14+
- cancel_subscriptions
15+
- close_sinks
16+
- constant_identifier_names
17+
- control_flow_in_finally
18+
- empty_statements
19+
- hash_and_equals
20+
- implementation_imports
21+
- non_constant_identifier_names
22+
- package_api_docs
23+
- package_names
24+
- package_prefixed_library_names
25+
- test_types_in_equals
26+
- throw_in_finally
27+
- unnecessary_brace_in_string_interps
28+
- unnecessary_getters_setters
29+
- unnecessary_new
30+
- unnecessary_statements
6.14 KB
Loading
3.2 KB
Loading
311 KB
Binary file not shown.
302 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

material_studies/rally/lib/app.dart

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright 2019-present the Flutter authors. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import 'package:flutter/material.dart';
16+
import 'package:flutter/widgets.dart';
17+
18+
import 'package:rally/colors.dart';
19+
import 'package:rally/home.dart';
20+
import 'package:rally/login.dart';
21+
22+
/// The RallyApp is a MaterialApp with a theme and 2 routes.
23+
///
24+
/// The home route is the main page with tabs for sub pages.
25+
/// The login route is the initial route.
26+
class RallyApp extends StatelessWidget {
27+
@override
28+
Widget build(BuildContext context) {
29+
return MaterialApp(
30+
title: 'Rally',
31+
theme: _buildRallyTheme(),
32+
home: HomePage(),
33+
initialRoute: '/login',
34+
routes: {'/login': (context) => LoginPage()},
35+
);
36+
}
37+
38+
ThemeData _buildRallyTheme() {
39+
final ThemeData base = ThemeData.dark();
40+
return ThemeData(
41+
scaffoldBackgroundColor: RallyColors.primaryBackground,
42+
primaryColor: RallyColors.primaryBackground,
43+
textTheme: _buildRallyTextTheme(base.textTheme),
44+
inputDecorationTheme: InputDecorationTheme(
45+
labelStyle:
46+
TextStyle(color: RallyColors.gray, fontWeight: FontWeight.w500),
47+
filled: true,
48+
fillColor: RallyColors.inputBackground,
49+
focusedBorder: InputBorder.none,
50+
),
51+
);
52+
}
53+
54+
TextTheme _buildRallyTextTheme(TextTheme base) {
55+
return base
56+
.copyWith(
57+
body1: base.body1.copyWith(
58+
fontFamily: 'Roboto Condensed',
59+
fontSize: 14,
60+
fontWeight: FontWeight.w400,
61+
),
62+
body2: base.body2.copyWith(
63+
fontFamily: 'Eczar',
64+
fontSize: 40,
65+
fontWeight: FontWeight.w400,
66+
letterSpacing: 1.4,
67+
),
68+
button: base.button.copyWith(
69+
fontFamily: 'Roboto Condensed',
70+
fontWeight: FontWeight.w700,
71+
letterSpacing: 2.8,
72+
),
73+
headline: base.body2.copyWith(
74+
fontFamily: 'Eczar',
75+
fontSize: 40,
76+
fontWeight: FontWeight.w600,
77+
letterSpacing: 1.4,
78+
),
79+
)
80+
.apply(
81+
displayColor: Colors.white,
82+
bodyColor: Colors.white,
83+
);
84+
}
85+
}

0 commit comments

Comments
 (0)