1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-22 23:11:40 +00:00

Remove code_sharing and place_tracker, cleanup repo (#2831)

Fixes #2818, #2523, #2528
This commit is contained in:
Eric Windmill
2026-04-15 13:02:16 -07:00
committed by GitHub
parent d626e058a4
commit d66d8c49b5
295 changed files with 82 additions and 9279 deletions

View File

@@ -1,38 +1,14 @@
// Copyright 2021, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:window_size/window_size.dart';
import 'src/app.dart';
void main() {
setupWindow();
// Removed setupWindow() call
runApp(const Bookstore());
}
const double windowWidth = 480;
const double windowHeight = 854;
void setupWindow() {
if (!kIsWeb &&
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
WidgetsFlutterBinding.ensureInitialized();
setWindowTitle('Navigation and routing');
setWindowMinSize(const Size(windowWidth, windowHeight));
setWindowMaxSize(const Size(windowWidth, windowHeight));
getCurrentScreen().then((screen) {
setWindowFrame(
Rect.fromCenter(
center: screen!.frame.center,
width: windowWidth,
height: windowHeight,
),
);
});
}
}

View File

@@ -73,8 +73,6 @@ class _BookstoreState extends State<Bookstore> {
pageBuilder: (context, state, child) {
return FadeTransitionPage<dynamic>(
key: state.pageKey,
// Use a builder to get the correct BuildContext
// TODO (johnpryan): remove when https://github.com/flutter/flutter/issues/108177 lands
child: Builder(
builder: (context) {
return BooksScreen(
@@ -103,8 +101,6 @@ class _BookstoreState extends State<Bookstore> {
path: '/books/popular',
pageBuilder: (context, state) {
return FadeTransitionPage<dynamic>(
// Use a builder to get the correct BuildContext
// TODO (johnpryan): remove when https://github.com/flutter/flutter/issues/108177 lands
key: state.pageKey,
child: Builder(
builder: (context) {
@@ -139,8 +135,6 @@ class _BookstoreState extends State<Bookstore> {
pageBuilder: (context, state) {
return FadeTransitionPage<dynamic>(
key: state.pageKey,
// Use a builder to get the correct BuildContext
// TODO (johnpryan): remove when https://github.com/flutter/flutter/issues/108177 lands
child: Builder(
builder: (context) {
return BookList(
@@ -174,8 +168,6 @@ class _BookstoreState extends State<Bookstore> {
pageBuilder: (context, state) {
return FadeTransitionPage<dynamic>(
key: state.pageKey,
// Use a builder to get the correct BuildContext
// TODO (johnpryan): remove when https://github.com/flutter/flutter/issues/108177 lands
child: Builder(
builder: (context) {
return BookList(
@@ -234,7 +226,6 @@ class _BookstoreState extends State<Bookstore> {
int.parse(state.pathParameters['authorId']!),
);
// Use a builder to get the correct BuildContext
// TODO (johnpryan): remove when https://github.com/flutter/flutter/issues/108177 lands
return Builder(
builder: (context) {
return AuthorDetailsScreen(
@@ -266,7 +257,6 @@ class _BookstoreState extends State<Bookstore> {
path: '/sign-in',
builder: (context, state) {
// Use a builder to get the correct BuildContext
// TODO (johnpryan): remove when https://github.com/flutter/flutter/issues/108177 lands
return Builder(
builder: (context) {
return SignInScreen(

View File

@@ -7,13 +7,9 @@
#include "generated_plugin_registrant.h"
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_size/window_size_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) window_size_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin");
window_size_plugin_register_with_registrar(window_size_registrar);
}

View File

@@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@@ -6,9 +6,7 @@ import FlutterMacOS
import Foundation
import url_launcher_macos
import window_size
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin"))
}

View File

@@ -14,10 +14,6 @@ dependencies:
sdk: flutter
go_router: ^16.0.0
url_launcher: ^6.1.1
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
dev_dependencies:
analysis_defaults:

View File

@@ -7,11 +7,8 @@
#include "generated_plugin_registrant.h"
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_size/window_size_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowSizePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowSizePlugin"));
}

View File

@@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST