Skip to content

Commit

Permalink
feat: notification badge color, remove unnecessary keyword new
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Sep 3, 2019
1 parent 80e6332 commit ae1536b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
31 changes: 20 additions & 11 deletions lib/main.dart
Expand Up @@ -42,17 +42,26 @@ class _HomeState extends State<Home> {
}

// String text = count > 99 ? '99+' : count.toString();

// https://stackoverflow.com/a/45434404
return new Stack(children: <Widget>[
new Icon(Icons.notifications_none),
new Positioned(
// draw a red marble
top: 0.0,
right: 0.0,
child: new Icon(Icons.brightness_1, size: 8.0, color: Colors.redAccent),
)
]);
return Stack(
children: <Widget>[
Icon(Icons.notifications_none),
Positioned(
right: 0,
child: Container(
width: 8,
height: 8,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4)),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [PrimerColors.red400, PrimerColors.red600],
),
),
),
)
],
);
}

List<BottomNavigationBarItem> _buildNavigationItems() {
Expand Down
6 changes: 3 additions & 3 deletions lib/providers/settings.dart
Expand Up @@ -49,7 +49,7 @@ class SettingsProvider extends StatefulWidget {
}

@override
SettingsProviderState createState() => new SettingsProviderState();
SettingsProviderState createState() => SettingsProviderState();
}

class SettingsProviderState extends State<SettingsProvider> {
Expand Down Expand Up @@ -286,7 +286,7 @@ class SettingsProviderState extends State<SettingsProvider> {
final data = json.decode(res.body);

if (data['errors'] != null) {
throw new Exception(data['errors'][0]['message']);
throw Exception(data['errors'][0]['message']);
}

return data['data'];
Expand Down Expand Up @@ -341,7 +341,7 @@ class SettingsProviderState extends State<SettingsProvider> {

@override
Widget build(BuildContext context) {
return new _InheritedSettingsProvider(
return _InheritedSettingsProvider(
data: this,
child: widget.child,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/repo_item.dart
Expand Up @@ -62,7 +62,7 @@ class RepoItem extends StatelessWidget {
Container(
width: 10,
height: 10,
decoration: new BoxDecoration(
decoration: BoxDecoration(
color: convertColor(
payload['primaryLanguage']['color']),
shape: BoxShape.circle,
Expand Down

0 comments on commit ae1536b

Please sign in to comment.