mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-13 05:30:59 +01:00
design_system 0.4.0: import material_ui
Flutter 3.50 deprecates package:flutter/material.dart for the material_ui package; its ThemeData is a different type, so apps on 3.50 need the theme builders to return material_ui's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0ef5461805
commit
db1ce8c378
@ -1,8 +1,8 @@
|
||||
/// Confirmation for destructive actions.
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// Asks the user to confirm a destructive action, returning true if they do.
|
||||
///
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
library;
|
||||
|
||||
import 'package:design_system/src/tokens.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// A centred icon, headline and explanation for an empty list.
|
||||
///
|
||||
|
||||
@ -8,7 +8,7 @@ library;
|
||||
|
||||
import 'package:design_system/src/status_colors.dart';
|
||||
import 'package:design_system/src/tokens.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// How long a neutral confirmation stays up.
|
||||
const Duration _toastDuration = Duration(seconds: 3);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:design_system/src/tokens.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// A grid of square cells that always fits its box, so it never scrolls
|
||||
/// vertically.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
library;
|
||||
|
||||
import 'package:design_system/src/tokens.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// A section title, optionally with a trailing action.
|
||||
///
|
||||
@ -13,12 +13,7 @@ import 'package:flutter/material.dart';
|
||||
/// caller can adopt it without a visual change.
|
||||
class SectionHeader extends StatelessWidget {
|
||||
/// Creates a section header.
|
||||
const SectionHeader(
|
||||
this.title, {
|
||||
this.action,
|
||||
this.padding,
|
||||
super.key,
|
||||
});
|
||||
const SectionHeader(this.title, {this.action, this.padding, super.key});
|
||||
|
||||
/// The section's title.
|
||||
final String title;
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
library;
|
||||
|
||||
import 'package:design_system/src/tokens.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// The four status colors, plus the text color to draw on top of them.
|
||||
@immutable
|
||||
|
||||
@ -7,7 +7,7 @@ library;
|
||||
|
||||
import 'package:design_system/src/status_colors.dart';
|
||||
import 'package:design_system/src/tokens.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// Builds the shared light [ThemeData].
|
||||
ThemeData buildLightTheme() {
|
||||
|
||||
@ -5,7 +5,7 @@ description: >-
|
||||
helpers that were each reimplemented in three or more repos. Owns the tokens
|
||||
-- consumers import them rather than transcribing the token table by hand.
|
||||
publish_to: 'none'
|
||||
version: 0.3.1
|
||||
version: 0.4.0
|
||||
|
||||
environment:
|
||||
sdk: ^3.12.2
|
||||
@ -13,6 +13,7 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
material_ui: 1.11.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
/// Built at runtime rather than inlined as a literal, so the `EmptyState`
|
||||
@ -44,9 +44,7 @@ void main() {
|
||||
await _pumpEmptyState(tester);
|
||||
final scheme = buildDarkTheme().colorScheme;
|
||||
|
||||
final message = tester.widget<Text>(
|
||||
find.text(_message(0)),
|
||||
);
|
||||
final message = tester.widget<Text>(find.text(_message(0)));
|
||||
expect(message.style?.color, scheme.onSurfaceVariant);
|
||||
expect(message.textAlign, TextAlign.center);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
/// Pumps a screen whose button calls [onPressed] with a context that has a
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
final _dot = find.byWidgetPredicate(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
Future<void> _pumpHeader(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
@ -100,10 +100,7 @@ void main() {
|
||||
final focused = input.focusedBorder! as OutlineInputBorder;
|
||||
expect(focused.borderSide.color, AppPalette.accent);
|
||||
expect(focused.borderSide.width, 2.0);
|
||||
expect(
|
||||
focused.borderRadius,
|
||||
BorderRadius.circular(AppRadius.sm),
|
||||
);
|
||||
expect(focused.borderRadius, BorderRadius.circular(AppRadius.sm));
|
||||
|
||||
for (final border in [input.border!, input.enabledBorder!]) {
|
||||
expect(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user