Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Migrate layout/ to null safety (#578)
Browse files Browse the repository at this point in the history
* Migrated layout/ to null safety

* Rebased on latest

* Fixed Analyzer issues

* Fixed Format errors

Co-authored-by: Pierre-Louis <[email protected]>
  • Loading branch information
amanv8060 and guidezpl authored Jan 4, 2022
1 parent b25ac1d commit 4e28f7a
Show file tree
Hide file tree
Showing 186 changed files with 509 additions and 18 deletions.
2 changes: 2 additions & 0 deletions lib/codeviewer/code_displayer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

typedef CodeDisplayer = TextSpan Function(BuildContext context);
126 changes: 126 additions & 0 deletions lib/codeviewer/code_segments.dart

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/codeviewer/code_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

class CodeStyle extends InheritedWidget {
Expand Down
2 changes: 2 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

// Only put constants shared between files here.

// height of the 'Gallery' header
Expand Down
2 changes: 2 additions & 0 deletions lib/data/demos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:collection';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/data/gallery_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:async';

import 'package:flutter/material.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/data/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

class GalleryIcons {
Expand Down
2 changes: 2 additions & 0 deletions lib/deferred_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:async';
import 'package:flutter/material.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_activity_indicator_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_alert_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_button_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_context_menu_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_demos.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @dart=2.9

export 'package:gallery/demos/cupertino/cupertino_activity_indicator_demo.dart';
export 'package:gallery/demos/cupertino/cupertino_alert_demo.dart';
export 'package:gallery/demos/cupertino/cupertino_button_demo.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_navigation_bar_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_picker_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:intl/intl.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_refresh_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:math' show Random;

import 'package:flutter/cupertino.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_segmented_control_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_slider_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_switch_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_tab_bar_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/cupertino_text_field_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/cupertino/demo_types.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @dart=2.9

enum AlertDemoType {
alert,
alertTitle,
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/app_bar_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/banner_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/bottom_app_bar_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/bottom_navigation_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/bottom_sheet_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/button_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/cards_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/chip_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/data_table_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/data/gallery_options.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/dialog_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/divider_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/grid_list_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/list_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/material_demo_types.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @dart=2.9

enum BottomNavigationDemoType {
withLabels,
withoutLabels,
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/material_demos.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @dart=2.9

export 'package:gallery/demos/material/app_bar_demo.dart';
export 'package:gallery/demos/material/banner_demo.dart';
export 'package:gallery/demos/material/bottom_app_bar_demo.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/menu_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/navigation_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/navigation_rail_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/picker_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/progress_indicator_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/selection_controls_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/sliders_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:math' as math;

import 'package:flutter/material.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/snackbar_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/demos/material/tabs_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
Expand Down
Loading

0 comments on commit 4e28f7a

Please sign in to comment.