-
Notifications
You must be signed in to change notification settings - Fork 247
[103] First attempt at notched corner text fields and all other 103 features #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
willlarche
merged 70 commits into
material-components:master
from
willlarche:feature-103-complete
Apr 23, 2018
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
1fadce5
[102] Starting data model.
willlarche a772890
[102] Dummy data.
willlarche af4cab3
[102] Fake data.
willlarche adef0e7
[102] Card currency formatting.
willlarche 7ee8838
[102] Starting to make the currency localized.
willlarche 2a45e8f
[102] Sync.
willlarche ec6cefe
[102] Import order correction.
willlarche d11cb4d
[103] Initial commit.
willlarche 766e330
[103] Sync.
willlarche 81153d5
[103] Theming start.
willlarche 1da2372
[103] Lots of styling done.
willlarche a749a22
[103] Sync.
willlarche bad42d9
[102] rebase fix and Dart 2.
willlarche 64ffef9
[103] font files.
willlarche fe8e68b
[103] Changes from 102 PR.
willlarche bbf5536
[103] Formatting.
willlarche dc4b5f5
[103] No rounded corners.
willlarche 2a2760b
[103] Beginning horizontal scroll.
willlarche a02c671
[103] Compiling again in Dart 2.
willlarche f1dc58a
[101] Adding back in consts and news.
willlarche 99bbede
[103] Sync.
willlarche b4cf2c6
[103] Consts and news.
willlarche d09d2a0
[103] New and Const.
willlarche cde618f
[103] Removing unnecessary function.
willlarche 6002376
[103] Began product columns.
willlarche f4ec6d4
[103] List columns.
willlarche 0325b00
[103] Card formatting.
willlarche 534e59d
[103] Failed attempt at card layout.
willlarche 58bebc0
[103] Grid layout works!
willlarche 6067eda
[103] Formatting.
willlarche c3d4d10
[103] Text field styling.
willlarche 61490a0
[103] Dynamic type support.
willlarche cef3036
[103] Padding correction.
willlarche 454e1de
[103] Sync.
willlarche 45095f1
[103] Beginning octagonal border.
willlarche 225183f
[103] Asymmetric layout.
willlarche 5f67986
[103] Theming organization.
willlarche 1d4da81
[103] Theming.
willlarche ee57229
[103] Notched corner begun.
willlarche ea1b39f
[103] Began notched corner text fields.
willlarche b1eceda
[103] Removing unimplemented function.
willlarche a1f0473
[103] Color corrections.
willlarche 8ad2aa1
[103] Cleanup of imports.
willlarche f2ee410
[103] Removing unused import.
willlarche e183611
[103] Missing explicit new.
willlarche d9e0b8c
[103] Formatting.
willlarche 18fdc36
[103] Formatting.
willlarche c99f350
[103] New const correction.
willlarche 38d6c0d
[103] Removing unused widget.
willlarche 71a46ca
[101] Missing explicit new.
willlarche e92ffe7
[103] Explicit news.
willlarche b69ca4b
[103] Explicit news and consts.
willlarche 786516d
[103] Explicit const.
willlarche b9ea25e
[103] Notched corners except animation.
willlarche 3840981
[103] Colors.
willlarche 7d17497
[103] Notched corner animation.
willlarche ccddf26
[103] Custom widget for the primary color setting on the text fields.
willlarche 7bf5092
[103] Updated Theme code from Hans.
willlarche 1b4c4d5
[103] More work on shapes.
willlarche f362843
[103] Correction to text fields.
willlarche 922eda3
[103] Shape added to flat button for ink.
willlarche cae18fe
[103] PR feedback.
willlarche 87f030e
[103] PR feedback.
willlarche 9285a58
[103] Renaming.
willlarche 59c8de1
[103] Formatting.
willlarche a15c3a3
[103] PR feedback.
willlarche 44cee9f
[103] PR feedback.
willlarche 6d8ccb1
[103] Comments.
willlarche 5d1f717
[103] PR feedback about lerp.
willlarche faf5834
[103] Lerping correctiong.
willlarche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
import 'home.dart'; | ||
import 'login.dart'; | ||
import 'notched_corner_border.dart'; | ||
import 'supplemental/theming.dart'; | ||
|
||
class ShrineApp extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); | ||
|
||
return MaterialApp( | ||
title: 'Shrine', | ||
home: new HomePage(), | ||
initialRoute: '/login', | ||
onGenerateRoute: _getRoute, | ||
theme: _kShrineTheme, | ||
); | ||
} | ||
|
||
Route<dynamic> _getRoute(RouteSettings settings) { | ||
if (settings.name == '/login') { | ||
return new MaterialPageRoute<void>( | ||
settings: settings, | ||
builder: (BuildContext context) => new LoginPage(), | ||
fullscreenDialog: true, | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
|
||
final ThemeData _kShrineTheme = _buildShrineTheme(); | ||
|
||
IconThemeData _customIconTheme(IconThemeData original) { | ||
return original.copyWith(color: kShrineBrown900); | ||
} | ||
|
||
ThemeData _buildShrineTheme() { | ||
final ThemeData base = new ThemeData.light(); | ||
return base.copyWith( | ||
accentColor: kShrineBrown900, | ||
primaryColor: kShrinePink100, | ||
buttonColor: kShrinePink100, | ||
scaffoldBackgroundColor: kShrineBackgroundWhite, | ||
cardColor: kShrineBackgroundWhite, | ||
textSelectionColor: kShrinePink100, | ||
errorColor: kShrineErrorRed, | ||
buttonTheme: const ButtonThemeData( | ||
textTheme: ButtonTextTheme.accent, | ||
), | ||
primaryIconTheme: base.iconTheme.copyWith( | ||
color: kShrineBrown900 | ||
), | ||
inputDecorationTheme: new InputDecorationTheme( | ||
border: new NotchedCornerBorder(), | ||
), | ||
textTheme: _buildShrineTextTheme(base.textTheme), | ||
primaryTextTheme: _buildShrineTextTheme(base.primaryTextTheme), | ||
accentTextTheme: _buildShrineTextTheme(base.accentTextTheme), | ||
iconTheme: _customIconTheme(base.iconTheme), | ||
); | ||
} | ||
|
||
TextTheme _buildShrineTextTheme(TextTheme base) { | ||
return base.copyWith( | ||
headline: base.headline.copyWith( | ||
fontWeight: FontWeight.w500, | ||
), | ||
title: base.title.copyWith( | ||
fontSize: 18.0 | ||
), | ||
caption: base.caption.copyWith( | ||
fontWeight: FontWeight.w400, | ||
fontSize: 14.0, | ||
), | ||
).apply( | ||
fontFamily: 'Rubik', | ||
displayColor: kShrineBrown900, | ||
bodyColor: kShrineBrown900, | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'model/data.dart'; | ||
import 'supplemental/asymmetric_grid.dart'; | ||
|
||
class HomePage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return new Scaffold( | ||
appBar: new AppBar( | ||
brightness: Brightness.light, | ||
leading: new IconButton( | ||
icon: const Icon(Icons.menu), | ||
onPressed: () { | ||
print('Menu button'); | ||
}, | ||
), | ||
title: const Text('SHRINE'), | ||
actions: <Widget>[ | ||
new IconButton( | ||
icon: const Icon(Icons.search), | ||
onPressed: () { | ||
print('Search button'); | ||
}, | ||
), | ||
new IconButton( | ||
icon: const Icon(Icons.tune), | ||
onPressed: () { | ||
print('Filter button'); | ||
}, | ||
), | ||
], | ||
), | ||
body: ProductsView(products: getAllProducts()), | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'supplemental/theming.dart'; | ||
|
||
class LoginPage extends StatefulWidget { | ||
@override | ||
LoginPageState createState() { | ||
return new LoginPageState(); | ||
} | ||
} | ||
|
||
class LoginPageState extends State<LoginPage> { | ||
final _usernameController = new TextEditingController(); | ||
final _passwordController = new TextEditingController(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return new Scaffold( | ||
body: new SafeArea( | ||
child: new ListView( | ||
padding: const EdgeInsets.symmetric(horizontal: 24.0), | ||
children: <Widget>[ | ||
const SizedBox(height: 80.0), | ||
new Column( | ||
children: <Widget>[ | ||
new Image.asset('assets/diamond.png'), | ||
const SizedBox(height: 16.0), | ||
new Text( | ||
'SHRINE', | ||
style: Theme.of(context).textTheme.headline, | ||
), | ||
], | ||
), | ||
const SizedBox(height: 120.0), | ||
new PrimaryColorOverride( | ||
color: kShrineBrown900, | ||
child: new TextField( | ||
controller: _usernameController, | ||
decoration: const InputDecoration( | ||
labelText: 'Username', | ||
), | ||
), | ||
), | ||
const SizedBox(height: 12.0), | ||
new PrimaryColorOverride( | ||
color: kShrineBrown900, | ||
child: new TextField( | ||
controller: _passwordController, | ||
decoration: const InputDecoration( | ||
labelText: 'Password', | ||
), | ||
), | ||
), | ||
new ButtonBar( | ||
children: <Widget>[ | ||
new FlatButton( | ||
child: const Text('CANCEL'), | ||
shape: BeveledRectangleBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(7.0)), | ||
), | ||
onPressed: () { | ||
_usernameController.clear(); | ||
_passwordController.clear(); | ||
}, | ||
), | ||
new RaisedButton( | ||
child: const Text('NEXT'), | ||
elevation: 8.0, | ||
shape: BeveledRectangleBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(7.0)), | ||
), | ||
onPressed: () { | ||
Navigator.pop(context); | ||
}, | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class PrimaryColorOverride extends StatelessWidget { | ||
const PrimaryColorOverride({Key key, this.color, this.child}) | ||
: super(key: key); | ||
|
||
final Color color; | ||
final Widget child; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return new Theme( | ||
child: child, | ||
data: Theme.of(context).copyWith(primaryColor: color), | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'app.dart'; | ||
|
||
void main() => runApp(new ShrineApp()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import 'product.dart'; | ||
|
||
List<Product> getAllProducts() { | ||
return const <Product>[ | ||
Product( | ||
category: Category.home, | ||
id: 0, | ||
isFeatured: true, | ||
name: 'Tab Can', | ||
price: 35, | ||
), | ||
Product( | ||
category: Category.accessories, | ||
id: 1, | ||
isFeatured: false, | ||
name: 'Pineapple Wall', | ||
price: 80, | ||
), | ||
Product( | ||
category: Category.clothing, | ||
id: 2, | ||
isFeatured: false, | ||
name: 'Tab & Fresca Cold', | ||
price: 100, | ||
), | ||
Product( | ||
category: Category.home, | ||
id: 3, | ||
isFeatured: false, | ||
name: 'Capris', | ||
price: 5, | ||
), | ||
Product( | ||
category: Category.home, | ||
id: 0, | ||
isFeatured: true, | ||
name: 'Tab Can', | ||
price: 35, | ||
), | ||
Product( | ||
category: Category.accessories, | ||
id: 1, | ||
isFeatured: false, | ||
name: 'Pineapple Wall', | ||
price: 80, | ||
), | ||
Product( | ||
category: Category.clothing, | ||
id: 2, | ||
isFeatured: false, | ||
name: 'Tab & Fresca Cold', | ||
price: 100, | ||
), | ||
Product( | ||
category: Category.home, | ||
id: 3, | ||
isFeatured: false, | ||
name: 'Capris', | ||
price: 5, | ||
), | ||
Product( | ||
category: Category.home, | ||
id: 0, | ||
isFeatured: true, | ||
name: 'Tab Can', | ||
price: 35, | ||
), | ||
Product( | ||
category: Category.accessories, | ||
id: 1, | ||
isFeatured: false, | ||
name: 'Pineapple Wall', | ||
price: 80, | ||
), | ||
Product( | ||
category: Category.clothing, | ||
id: 2, | ||
isFeatured: false, | ||
name: 'Tab & Fresca Cold', | ||
price: 100, | ||
), | ||
Product( | ||
category: Category.home, | ||
id: 3, | ||
isFeatured: false, | ||
name: 'Capris', | ||
price: 5, | ||
), | ||
]; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:flutter/foundation.dart'; | ||
|
||
enum Category { none, accessories, clothing, home } | ||
|
||
class Product { | ||
const Product({ | ||
@required this.category, | ||
@required this.id, | ||
@required this.isFeatured, | ||
@required this.name, | ||
@required this.price, | ||
}) : assert(category != null), | ||
assert(id != null), | ||
assert(isFeatured != null), | ||
assert(name != null), | ||
assert(price != null); | ||
|
||
final Category category; | ||
final int id; | ||
final bool isFeatured; | ||
final String name; | ||
final int price; | ||
|
||
@override | ||
String toString() => '$name (id=$id)'; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.