migrate mozilla components into project

This commit is contained in:
Fabian Freund
2024-09-07 08:49:38 +02:00
parent 10a49def87
commit 3b047b5d8a
67 changed files with 5840 additions and 0 deletions
@@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
MyAppState createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Native Fragment Example'),
actions: [
MenuAnchor(
builder: (context, controller, child) => IconButton(
onPressed: () {
controller.open();
},
icon: const Icon(Icons.menu)),
menuChildren: [
MenuItemButton(
onPressed: () async {
await GeckoSessionService.forCurrentTab().reload();
},
child: const Text('Reload'),
),
MenuItemButton(
onPressed: () async {
await GeckoSessionService.forCurrentTab().goBack();
},
child: const Text('Back'),
)
])
],
),
body: const SafeArea(
child: Center(
child: GeckoView(),
),
),
),
);
}
}