zzz
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UxApp extends InheritedWidget {
|
||||
final Widget child;
|
||||
|
||||
UxApp({this.child});
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [Positioned.fill(child: child)],
|
||||
);
|
||||
}
|
||||
|
||||
bool updateShouldNotify(InheritedWidget oldWidget) => false;
|
||||
|
||||
UxApp of(BuildContext context) => context.dependOnInheritedWidgetOfExactType<UxApp>();
|
||||
}
|
||||
|
||||
|
||||
35
lib/ux.dart
35
lib/ux.dart
@@ -1,16 +1,37 @@
|
||||
library scoped;
|
||||
|
||||
import 'dart:async';
|
||||
import 'package:flutter/services.dart';
|
||||
library ux;
|
||||
|
||||
export 'src/bend_box.dart';
|
||||
export 'src/note.dart';
|
||||
export 'src/ux_app.dart';
|
||||
export 'src/json_extension.dart';
|
||||
|
||||
class Ux {
|
||||
static const MethodChannel _channel =
|
||||
const MethodChannel('ux');
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'src/note.dart';
|
||||
|
||||
class UX {
|
||||
static const MethodChannel _channel = const MethodChannel('ux');
|
||||
|
||||
static Future<String> get platformVersion async {
|
||||
final String version = await _channel.invokeMethod('getPlatformVersion');
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
extension UxExtension on BuildContext {
|
||||
showText<T>(String text,
|
||||
{bool modal = false,
|
||||
double backdropBlur = 0.0,
|
||||
Duration duration = const Duration(seconds: 3)}) =>
|
||||
Note<T>(
|
||||
duration: duration,
|
||||
modalBackdropBlur: backdropBlur,
|
||||
isModal: modal,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: Color(0xFF202020)),
|
||||
child: ListTile(
|
||||
title:
|
||||
Text(text, style: TextStyle(color: Colors.white)))))
|
||||
.show(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user