Skip to content

[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
merged 70 commits into from
Apr 23, 2018
Merged
Show file tree
Hide file tree
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 Apr 2, 2018
a772890
[102] Dummy data.
willlarche Apr 2, 2018
af4cab3
[102] Fake data.
willlarche Apr 3, 2018
adef0e7
[102] Card currency formatting.
willlarche Apr 3, 2018
7ee8838
[102] Starting to make the currency localized.
willlarche Apr 4, 2018
2a45e8f
[102] Sync.
willlarche Apr 7, 2018
ec6cefe
[102] Import order correction.
willlarche Apr 7, 2018
d11cb4d
[103] Initial commit.
willlarche Apr 5, 2018
766e330
[103] Sync.
willlarche Apr 6, 2018
81153d5
[103] Theming start.
willlarche Apr 6, 2018
1da2372
[103] Lots of styling done.
willlarche Apr 6, 2018
a749a22
[103] Sync.
willlarche Apr 7, 2018
bad42d9
[102] rebase fix and Dart 2.
willlarche Apr 11, 2018
64ffef9
[103] font files.
willlarche Apr 11, 2018
fe8e68b
[103] Changes from 102 PR.
willlarche Apr 11, 2018
bbf5536
[103] Formatting.
willlarche Apr 11, 2018
dc4b5f5
[103] No rounded corners.
willlarche Apr 11, 2018
2a2760b
[103] Beginning horizontal scroll.
willlarche Apr 11, 2018
a02c671
[103] Compiling again in Dart 2.
willlarche Apr 12, 2018
f1dc58a
[101] Adding back in consts and news.
willlarche Apr 13, 2018
99bbede
[103] Sync.
willlarche Apr 13, 2018
b4cf2c6
[103] Consts and news.
willlarche Apr 13, 2018
d09d2a0
[103] New and Const.
willlarche Apr 15, 2018
cde618f
[103] Removing unnecessary function.
willlarche Apr 15, 2018
6002376
[103] Began product columns.
willlarche Apr 15, 2018
f4ec6d4
[103] List columns.
willlarche Apr 15, 2018
0325b00
[103] Card formatting.
willlarche Apr 15, 2018
534e59d
[103] Failed attempt at card layout.
willlarche Apr 16, 2018
58bebc0
[103] Grid layout works!
willlarche Apr 17, 2018
6067eda
[103] Formatting.
willlarche Apr 17, 2018
c3d4d10
[103] Text field styling.
willlarche Apr 17, 2018
61490a0
[103] Dynamic type support.
willlarche Apr 17, 2018
cef3036
[103] Padding correction.
willlarche Apr 17, 2018
454e1de
[103] Sync.
willlarche Apr 17, 2018
45095f1
[103] Beginning octagonal border.
willlarche Apr 17, 2018
225183f
[103] Asymmetric layout.
willlarche Apr 17, 2018
5f67986
[103] Theming organization.
willlarche Apr 17, 2018
1d4da81
[103] Theming.
willlarche Apr 18, 2018
ee57229
[103] Notched corner begun.
willlarche Apr 18, 2018
ea1b39f
[103] Began notched corner text fields.
willlarche Apr 18, 2018
b1eceda
[103] Removing unimplemented function.
willlarche Apr 18, 2018
a1f0473
[103] Color corrections.
willlarche Apr 18, 2018
8ad2aa1
[103] Cleanup of imports.
willlarche Apr 18, 2018
f2ee410
[103] Removing unused import.
willlarche Apr 18, 2018
e183611
[103] Missing explicit new.
willlarche Apr 18, 2018
d9e0b8c
[103] Formatting.
willlarche Apr 18, 2018
18fdc36
[103] Formatting.
willlarche Apr 18, 2018
c99f350
[103] New const correction.
willlarche Apr 18, 2018
38d6c0d
[103] Removing unused widget.
willlarche Apr 18, 2018
71a46ca
[101] Missing explicit new.
willlarche Apr 18, 2018
e92ffe7
[103] Explicit news.
willlarche Apr 18, 2018
b69ca4b
[103] Explicit news and consts.
willlarche Apr 18, 2018
786516d
[103] Explicit const.
willlarche Apr 18, 2018
b9ea25e
[103] Notched corners except animation.
willlarche Apr 19, 2018
3840981
[103] Colors.
willlarche Apr 19, 2018
7d17497
[103] Notched corner animation.
willlarche Apr 19, 2018
ccddf26
[103] Custom widget for the primary color setting on the text fields.
willlarche Apr 20, 2018
7bf5092
[103] Updated Theme code from Hans.
willlarche Apr 20, 2018
1b4c4d5
[103] More work on shapes.
willlarche Apr 22, 2018
f362843
[103] Correction to text fields.
willlarche Apr 22, 2018
922eda3
[103] Shape added to flat button for ink.
willlarche Apr 23, 2018
cae18fe
[103] PR feedback.
willlarche Apr 23, 2018
87f030e
[103] PR feedback.
willlarche Apr 23, 2018
9285a58
[103] Renaming.
willlarche Apr 23, 2018
59c8de1
[103] Formatting.
willlarche Apr 23, 2018
a15c3a3
[103] PR feedback.
willlarche Apr 23, 2018
44cee9f
[103] PR feedback.
willlarche Apr 23, 2018
6d8ccb1
[103] Comments.
willlarche Apr 23, 2018
5d1f717
[103] PR feedback about lerp.
willlarche Apr 23, 2018
faf5834
[103] Lerping correctiong.
willlarche Apr 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added MDC-103/complete/assets/0-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/assets/1-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/assets/2-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/assets/2.0x/diamond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/assets/3-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/assets/3.0x/diamond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/assets/diamond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MDC-103/complete/fonts/Rubik-Medium.ttf
Binary file not shown.
Binary file added MDC-103/complete/fonts/Rubik-Regular.ttf
Binary file not shown.
85 changes: 85 additions & 0 deletions MDC-103/complete/lib/app.dart
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,
);
}
37 changes: 37 additions & 0 deletions MDC-103/complete/lib/home.dart
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()),
);
}
}
99 changes: 99 additions & 0 deletions MDC-103/complete/lib/login.dart
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),
);
}
}
5 changes: 5 additions & 0 deletions MDC-103/complete/lib/main.dart
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());
90 changes: 90 additions & 0 deletions MDC-103/complete/lib/model/data.dart
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,
),
];
}
26 changes: 26 additions & 0 deletions MDC-103/complete/lib/model/product.dart
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)';
}
Loading