Skip to content

Commit

Permalink
chore: update to 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ziofat committed Jun 9, 2023
1 parent 2e946b7 commit 89bf06b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 47 deletions.
5 changes: 0 additions & 5 deletions .gitpod.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.0.7296

* **Breaking Change**: MdiIcons.* variables are no longer const, to avoid breaking tree-shaking. See [issue #54](https://github.com/ziofat/material_design_icons_flutter/issues/54)
* Support for Dart 3.0

## 6.0.7296

Update icons to 7.2.96 of mdi. Icons that have been added can be found at https://pictogrammers.com/library/mdi/version/7.2.96.
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ziofat/material_design_icons_flutter)

# material_design_icons_flutter

The [Material Design Icons](https://materialdesignicons.com/) Icon pack available as set of Flutter Icons.
Expand All @@ -13,7 +11,7 @@ Based on Material Design Icons 7.2.96. See a [web demo](https://ziofat.github.io
In the `dependencies:` section of your `pubspec.yaml`, add the following line:

```yaml
material_design_icons_flutter: 6.0.7196
material_design_icons_flutter: 7.0.7296
```

**WARNING**: MDI's version is based on their icons quantity, which does not strictly respect semver guide. They do try their best to keep icons in same name between minor releases but name changing may still appear. To not break your application, using a fix version in your `pubspec.yaml` is highly recommended.
Expand Down
76 changes: 40 additions & 36 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@ import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

void main() {
runApp(new MdiGalleryApp());
runApp(const MdiGalleryApp());
}

class MdiGalleryApp extends StatelessWidget {
const MdiGalleryApp({super.key});

@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
title: 'Material Design Icons Flutter Gallery',
theme: new ThemeData(
iconTheme: new IconThemeData(size: 36.0, color: Colors.black87),
theme: ThemeData(
iconTheme: const IconThemeData(size: 36.0, color: Colors.black87),
primarySwatch: Colors.blue,
textTheme: new TextTheme(
bodyMedium: new TextStyle(fontSize: 16.0, color: Colors.black87),
textTheme: const TextTheme(
bodyMedium: TextStyle(fontSize: 16.0, color: Colors.black87),
),
),
home: new MdiGalleryHome(),
home: const MdiGalleryHome(),
);
}
}

class MdiGalleryHome extends StatefulWidget {
const MdiGalleryHome({super.key});

@override
State<StatefulWidget> createState() => new MdiGalleryHomeState();
State<StatefulWidget> createState() => MdiGalleryHomeState();
}

class MdiGalleryHomeState extends State<MdiGalleryHome> {
Expand All @@ -40,32 +44,32 @@ class MdiGalleryHomeState extends State<MdiGalleryHome> {
.toList();
final orientation = MediaQuery.of(context).orientation;

return new Scaffold(
return Scaffold(
appBar: _isSearching ? _searchBar(context) : _titleBar(),
body: new GridView.builder(
body: GridView.builder(
itemCount: filteredIcons.length,
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: orientation == Orientation.portrait ? 2 : 3,
),
itemBuilder: (context, index) {
final icon = filteredIcons[index];

return new InkWell(
return InkWell(
onTap: () {
Navigator.push(
context,
new MaterialPageRoute<Null>(
MaterialPageRoute<void>(
builder: (BuildContext context) {
return new GestureDetector(
return GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: new Container(
child: Container(
color: Colors.white,
child: new SizedBox.expand(
child: new Hero(
child: SizedBox.expand(
child: Hero(
tag: icon,
child: new Icon(
child: Icon(
icon.iconData,
size: 100.0,
),
Expand All @@ -77,13 +81,13 @@ class MdiGalleryHomeState extends State<MdiGalleryHome> {
),
);
},
child: new Column(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Hero(tag: icon, child: new Icon(icon.iconData)),
new Container(
padding: new EdgeInsets.only(top: 16.0),
child: new Text(icon.title),
Hero(tag: icon, child: Icon(icon.iconData)),
Container(
padding: const EdgeInsets.only(top: 16.0),
child: Text(icon.title),
)
],
),
Expand All @@ -93,14 +97,14 @@ class MdiGalleryHomeState extends State<MdiGalleryHome> {
}

AppBar _titleBar() {
return new AppBar(
title: new Text("Material Design Icons Gallery"),
return AppBar(
title: const Text("Material Design Icons Gallery"),
actions: [
new IconButton(
icon: new Icon(MdiIcons.magnify),
IconButton(
icon: Icon(MdiIcons.magnify),
onPressed: () {
ModalRoute.of(context)!.addLocalHistoryEntry(
new LocalHistoryEntry(
LocalHistoryEntry(
onRemove: () {
setState(() {
_searchTerm = "";
Expand All @@ -119,9 +123,9 @@ class MdiGalleryHomeState extends State<MdiGalleryHome> {
}

AppBar _searchBar(BuildContext context) {
return new AppBar(
leading: new IconButton(
icon: new Icon(MdiIcons.magnify),
return AppBar(
leading: IconButton(
icon: Icon(MdiIcons.magnify),
onPressed: () {
setState(
() {
Expand All @@ -132,11 +136,11 @@ class MdiGalleryHomeState extends State<MdiGalleryHome> {
);
},
),
title: new TextField(
title: TextField(
onChanged: (text) => setState(() => _searchTerm = text),
autofocus: true,
style: new TextStyle(fontSize: 18.0),
decoration: new InputDecoration(),
style: const TextStyle(fontSize: 18.0),
decoration: const InputDecoration(),
),
);
}
Expand All @@ -146,8 +150,8 @@ class IconDefinition implements Comparable {
IconData? iconData;
late String title;
IconDefinition(String key) {
this.iconData = iconLib[key];
this.title = this.toKebabCase(key);
iconData = iconLib[key];
title = toKebabCase(key);
}

String toKebabCase(String str) {
Expand Down
1 change: 0 additions & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:mdi_gallery/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: material_design_icons_flutter
description: The Material Design Icons designed by the community for Flutter
homepage: https://github.com/ziofat/material_design_icons_flutter
version: 6.0.7296
version: 7.0.7296

dependencies:
flutter:
Expand All @@ -14,5 +14,5 @@ flutter:
- asset: lib/fonts/materialdesignicons-webfont.ttf

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0 <4.0.0"
flutter: ">=0.1.2"

0 comments on commit 89bf06b

Please sign in to comment.