Skip to content

Commit

Permalink
Reimpl widgets in material
Browse files Browse the repository at this point in the history
  • Loading branch information
rk0cc committed Dec 8, 2023
1 parent a92db7d commit d3d776c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 deletions.
9 changes: 9 additions & 0 deletions widgets/material/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.2.0

* Update dependencies constraints:
* `oghref_model`: `^2.1.1`
* `oghref_builder`: `^3.0.1`
* `oghref_media_control`: `^3.0.5`
* Add icon for `OgHrefMaterialTile` if the website of URL failed to retrive content.
* Uses `WidthSizeMeasurment` mixin from `oghref_builder` to measure width.

## 1.1.4

* Fix content broken issue
Expand Down
15 changes: 15 additions & 0 deletions widgets/material/example/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ class _OgHrefMaterialExampleHomeState extends State<OgHrefMaterialExampleHome> {
},
icon: Icon(multimedia ? Icons.movie : Icons.movie_outlined)))
]),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
const DrawerHeader(child: null),
ListTile(
leading: const Icon(Icons.keyboard_return),
title: const Text("Redirect"), trailing: Switch(value: MetaFetch().allowRedirect, onChanged: (newVal) {
setState(() {
MetaFetch().allowRedirect = newVal;
});
}))
],
),
),
body: Column(
children: [
Padding(
Expand Down
2 changes: 1 addition & 1 deletion widgets/material/example/lib/theme_preference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ final class ThemePreference extends ChangeNotifier {
bool _materialThree;
bool _darkMode;

ThemePreference({bool materialThree = false, bool darkMode = false})
ThemePreference({bool materialThree = true, bool darkMode = false})
: _materialThree = materialThree,
_darkMode = darkMode;

Expand Down
8 changes: 4 additions & 4 deletions widgets/material/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ packages:
dependency: transitive
description:
name: oghref_builder
sha256: "0e3ed6cd448ee1b0e35770fb0caa513504cb322c994312f7f8003aa9e06f3f2c"
sha256: "5604ae3d2227827cc877603d792f28e48987de3894a64450d6257bd696c1912b"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "3.0.1"
oghref_material:
dependency: "direct main"
description:
Expand All @@ -411,10 +411,10 @@ packages:
dependency: transitive
description:
name: oghref_model
sha256: d31684dbe7299e35c393b34b73d308e3a023fdb34fe5061a421ee1699a2f2f9d
sha256: b4e1a31fbc0557549be2c23fa33689c266520017554382494f210d81902a8230
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
package_config:
dependency: transitive
description:
Expand Down
4 changes: 3 additions & 1 deletion widgets/material/lib/oghref_material.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ abstract final class OgHrefMaterialBinding {
/// Initalize all necessary setup which will be required to used later.
static void ensureInitialized() {
MediaKit.ensureInitialized();
MetaFetch().register(const OpenGraphPropertyParser());
MetaFetch()
..register(const OpenGraphPropertyParser())
..primaryPrefix = "og";
}
}
1 change: 1 addition & 0 deletions widgets/material/lib/src/widgets/tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ base class OgHrefMaterialTile extends StatelessWidget
onTap: () => _openLinkConfirm(context, openLink));
},
onFetchFailed: (context, exception, openLink) => ListTile(
leading: const Icon(Icons.web),
title: Text("$url",
style: tileTitleTextStyle, overflow: TextOverflow.ellipsis),
onTap: () => _openLinkConfirm(context, openLink)),
Expand Down
4 changes: 2 additions & 2 deletions widgets/material/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ environment:
dependencies:
flutter:
sdk: flutter
oghref_builder: ^3.0.0
oghref_builder: ^3.0.1
oghref_media_control: ^3.0.5
oghref_model: ^2.1.0
oghref_model: ^2.1.1
meta: ^1.9.1
media_kit: ^1.1.10+1
dev_dependencies:
Expand Down

0 comments on commit d3d776c

Please sign in to comment.