Base Flutter App
This commit is contained in:
15
web_native/lib/screens/example1/components/body.dart
Normal file
15
web_native/lib/screens/example1/components/body.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Body extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: RaisedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('Go back!'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
web_native/lib/screens/example1/example-bloc.dart
Normal file
20
web_native/lib/screens/example1/example-bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:imagini/models/contact.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imagini/bloc/bloc.dart';
|
||||
|
||||
class ExampleBloc extends Bloc {
|
||||
StreamSubscription _audioPlayerStateSubscription;
|
||||
|
||||
Stream<String> get example => _exampleSubject.stream;
|
||||
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||
|
||||
ExampleBloc();
|
||||
|
||||
void dispose() {
|
||||
_exampleSubject.close();
|
||||
}
|
||||
}
|
||||
40
web_native/lib/screens/example1/examplescreen1.dart
Normal file
40
web_native/lib/screens/example1/examplescreen1.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imagini/screens/example1/components/body.dart';
|
||||
import 'package:imagini/screens/example1/example-bloc.dart';
|
||||
import 'package:imagini/bloc/bloc-prov.dart';
|
||||
|
||||
class ExScreen1 extends StatefulWidget {
|
||||
@override
|
||||
_ExScreen1State createState() => _ExScreen1State();
|
||||
}
|
||||
|
||||
class _ExScreen1State extends State<ExScreen1> {
|
||||
ExampleBloc exampleBloc;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
exampleBloc = ExampleBloc();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
exampleBloc.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
bloc: exampleBloc,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("First Screen"),
|
||||
),
|
||||
body: Body(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user