diff --git a/example/.metadata b/example/.metadata
index 02e9c7bfd..329f72cae 100644
--- a/example/.metadata
+++ b/example/.metadata
@@ -15,7 +15,7 @@ migration:
- platform: root
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- - platform: web
+ - platform: android
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
diff --git a/example/lib/main.dart b/example/lib/main.dart
index dae1c352a..efce4a049 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -1,34 +1,10 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
-import 'lang/translation_service.dart';
-import 'routes/app_pages.dart';
-import 'shared/logger/logger_utils.dart';
+// import 'lang/translation_service.dart';
+// import 'routes/app_pages.dart';
+// import 'shared/logger/logger_utils.dart';
-void main() {
- runApp(const MyApp());
-}
-
-class MyApp extends StatelessWidget {
- const MyApp({Key? key}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- return GetMaterialApp(
- theme: ThemeData(useMaterial3: true),
- debugShowCheckedModeBanner: false,
- enableLog: true,
- logWriterCallback: Logger.write,
- initialRoute: AppPages.INITIAL,
- getPages: AppPages.routes,
- locale: TranslationService.locale,
- fallbackLocale: TranslationService.fallbackLocale,
- translations: TranslationService(),
- );
- }
-}
-
-// /// Nav 2 snippet
// void main() {
// runApp(const MyApp());
// }
@@ -39,141 +15,172 @@ class MyApp extends StatelessWidget {
// @override
// Widget build(BuildContext context) {
// return GetMaterialApp(
-// getPages: [
-// GetPage(
-// participatesInRootNavigator: true,
-// name: '/first',
-// page: () => const First()),
-// GetPage(
-// name: '/second',
-// page: () => const Second(),
-// transition: Transition.downToUp,
-// ),
-// GetPage(
-// name: '/third',
-// page: () => const Third(),
-// ),
-// ],
+// theme: ThemeData(useMaterial3: true),
// debugShowCheckedModeBanner: false,
+// enableLog: true,
+// logWriterCallback: Logger.write,
+// initialRoute: AppPages.INITIAL,
+// getPages: AppPages.routes,
+// locale: TranslationService.locale,
+// fallbackLocale: TranslationService.fallbackLocale,
+// translations: TranslationService(),
// );
// }
// }
-// class FirstController extends GetxController {
-// @override
-// void onClose() {
-// print('on close first');
-// super.onClose();
-// }
-// }
+/// Nav 2 snippet
+void main() {
+ runApp(const MyApp());
+}
-// class First extends StatelessWidget {
-// const First({Key? key}) : super(key: key);
+class MyApp extends StatelessWidget {
+ const MyApp({Key? key}) : super(key: key);
-// @override
-// Widget build(BuildContext context) {
-// print('First rebuild');
-// Get.put(FirstController());
-// return Scaffold(
-// appBar: AppBar(
-// title: const Text('page one'),
-// leading: IconButton(
-// icon: const Icon(Icons.more),
-// onPressed: () {
-// Get.snackbar(
-// 'title',
-// "message",
-// mainButton:
-// TextButton(onPressed: () {}, child: const Text('button')),
-// isDismissible: true,
-// duration: Duration(seconds: 5),
-// snackbarStatus: (status) => print(status),
-// );
-// // print('THEME CHANGED');
-// // Get.changeTheme(
-// // Get.isDarkMode ? ThemeData.light() : ThemeData.dark());
-// },
-// ),
-// ),
-// body: Center(
-// child: SizedBox(
-// height: 300,
-// width: 300,
-// child: ElevatedButton(
-// onPressed: () {
-// Get.toNamed('/second?id=123');
-// },
-// child: const Text('next screen'),
-// ),
-// ),
-// ),
-// );
-// }
-// }
+ @override
+ Widget build(BuildContext context) {
+ return GetMaterialApp(
+ getPages: [
+ GetPage(
+ participatesInRootNavigator: true,
+ name: '/first',
+ page: () => const First()),
+ GetPage(
+ name: '/second',
+ page: () => const Second(),
+ transition: Transition.downToUp,
+ ),
+ GetPage(
+ name: '/third',
+ page: () => const Third(),
+ ),
+ ],
+ debugShowCheckedModeBanner: false,
+ );
+ }
+}
-// class SecondController extends GetxController {
-// final textEdit = TextEditingController();
-// @override
-// void onClose() {
-// print('on close second');
-// textEdit.dispose();
-// super.onClose();
-// }
-// }
+class FirstController extends GetxController {
+ @override
+ void onClose() {
+ print('on close first');
+ super.onClose();
+ }
+}
-// class Second extends StatelessWidget {
-// const Second({Key? key}) : super(key: key);
+class First extends StatelessWidget {
+ const First({Key? key}) : super(key: key);
-// @override
-// Widget build(BuildContext context) {
-// final controller = Get.put(SecondController());
-// print('second rebuild');
-// return Scaffold(
-// appBar: AppBar(
-// title: Text('page two ${Get.parameters["id"]}'),
-// ),
-// body: Center(
-// child: Column(
-// children: [
-// Expanded(
-// child: TextField(
-// controller: controller.textEdit,
-// )),
-// SizedBox(
-// height: 300,
-// width: 300,
-// child: ElevatedButton(
-// onPressed: () {},
-// child: const Text('next screen'),
-// ),
-// ),
-// ],
-// ),
-// ),
-// );
-// }
-// }
+ @override
+ Widget build(BuildContext context) {
+ print('First rebuild');
+ Get.put(FirstController());
+ return Scaffold(
+ appBar: AppBar(
+ title: const Text('page one'),
+ leading: IconButton(
+ icon: const Icon(Icons.more),
+ onPressed: () {
+ Get.snackbar(
+ 'title',
+ "message",
+ mainButton:
+ TextButton(onPressed: () {}, child: const Text('button')),
+ isDismissible: true,
+ duration: Duration(seconds: 5),
+ snackbarStatus: (status) => print(status),
+ );
+ // print('THEME CHANGED');
+ // Get.changeTheme(
+ // Get.isDarkMode ? ThemeData.light() : ThemeData.dark());
+ },
+ ),
+ ),
+ body: Center(
+ child: SizedBox(
+ height: 300,
+ width: 300,
+ child: ElevatedButton(
+ onPressed: () {
+ Get.toNamed('/second?id=123');
+ },
+ child: const Text('next screen'),
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+class SecondController extends GetxController {
+ final textEdit = TextEditingController();
+ @override
+ void onClose() {
+ print('on close second');
+ textEdit.dispose();
+ super.onClose();
+ }
+}
-// class Third extends StatelessWidget {
-// const Third({Key? key}) : super(key: key);
+class Second extends StatelessWidget {
+ const Second({Key? key}) : super(key: key);
-// @override
-// Widget build(BuildContext context) {
-// return Scaffold(
-// backgroundColor: Colors.red,
-// appBar: AppBar(
-// title: const Text('page three'),
-// ),
-// body: Center(
-// child: SizedBox(
-// height: 300,
-// width: 300,
-// child: ElevatedButton(
-// onPressed: () {},
-// child: const Text('go to first screen'),
-// ),
-// ),
-// ),
-// );
-// }
-// }
+ @override
+ Widget build(BuildContext context) {
+ final controller = Get.put(SecondController());
+ print('second rebuild');
+ return Scaffold(
+ appBar: AppBar(
+ title: Text('page two ${Get.parameters["id"]}'),
+ ),
+ body: Center(
+ child: Column(
+ children: [
+ Expanded(
+ child: TextField(
+ controller: controller.textEdit,
+ )),
+ SizedBox(
+ height: 300,
+ width: 300,
+ child: ElevatedButton(
+ onPressed: () {
+ Get.toNamed('/third');
+ },
+ child: const Text('next screen'),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class Third extends StatelessWidget {
+ const Third({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: Colors.red,
+ appBar: AppBar(
+ title: const Text('page three'),
+ ),
+ body: Center(
+ child: SizedBox(
+ height: 300,
+ width: 300,
+ child: ElevatedButton(
+ onPressed: () {
+ Get.until((route) {
+ print(Get.currentRoute);
+ return Get.currentRoute == '/first';
+ });
+ },
+ child: const Text('go to first screen'),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart
deleted file mode 100644
index ac1e5fb1d..000000000
--- a/example/test/widget_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// This is a basic Flutter widget test.
-//
-// To perform an interaction with a widget in your test, use the WidgetTester
-// utility in the flutter_test package. For example, you can send tap and scroll
-// gestures. You can also use WidgetTester to find child widgets in the widget
-// tree, read text, and verify that the values of widget properties are correct.
-
-import 'package:flutter/material.dart';
-import 'package:flutter_test/flutter_test.dart';
-import 'package:get_demo/main.dart';
-
-void main() {
- testWidgets('Counter increments smoke test', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.pumpWidget(const MyApp());
-
- // Verify that our counter starts at 0.
- expect(find.text('0'), findsOneWidget);
- expect(find.text('1'), findsNothing);
-
- // Tap the '+' icon and trigger a frame.
- await tester.tap(find.byIcon(Icons.add));
- await tester.pump();
-
- // Verify that our counter has incremented.
- expect(find.text('0'), findsNothing);
- expect(find.text('1'), findsOneWidget);
- });
-}
diff --git a/example_nav2/.metadata b/example_nav2/.metadata
index caa269cf4..90eabcfff 100644
--- a/example_nav2/.metadata
+++ b/example_nav2/.metadata
@@ -1,11 +1,11 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
-# This file should be version controlled.
+# This file should be version controlled and should not be manually edited.
version:
- revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- channel: stable
+ revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
+ channel: "stable"
project_type: app
@@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: android
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: ios
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: linux
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: macos
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: web
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: windows
- create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
+ create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
+ base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
# User provided section
diff --git a/example_nav2/ios/RunnerTests/RunnerTests.swift b/example_nav2/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 000000000..86a7c3b1b
--- /dev/null
+++ b/example_nav2/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Flutter
+import UIKit
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/example_nav2/macos/RunnerTests/RunnerTests.swift b/example_nav2/macos/RunnerTests/RunnerTests.swift
new file mode 100644
index 000000000..61f3bd1fc
--- /dev/null
+++ b/example_nav2/macos/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Cocoa
+import FlutterMacOS
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/example_nav2/pubspec.yaml b/example_nav2/pubspec.yaml
index 53f4ada67..f3d001ccf 100644
--- a/example_nav2/pubspec.yaml
+++ b/example_nav2/pubspec.yaml
@@ -3,7 +3,7 @@ version: 1.0.0+1
publish_to: none
description: A new Flutter project.
environment:
- sdk: ">=2.19.2 <3.0.0"
+ sdk: ">=3.0.0 <4.0.0"
dependencies:
cupertino_icons: ^1.0.2
diff --git a/example_nav2/web/index.html b/example_nav2/web/index.html
index 0bb814ebe..112ab3f37 100644
--- a/example_nav2/web/index.html
+++ b/example_nav2/web/index.html
@@ -10,8 +10,11 @@
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
+
+ This is a placeholder for base href that will be replaced by the value of
+ the `--base-href` argument provided to `flutter build`.
-->
-